Spec-Zone.ru › Octave 5

A.1.6.3 Использование разреженных матриц в файлах Oct

Большинство тех же операторов и функций для разреженных матриц, доступных из интерпретатора Octave, также доступны внутри файлов oct. Основные способы извлечения разреженной матрицы из octave_value, и возвращения её как octave_value, показаны в следующем примере.

octave_value_list retval;

SparseMatrix sm = args(0).sparse_matrix_value ();
SparseComplexMatrix scm = args(1).sparse_complex_matrix_value ();
SparseBoolMatrix sbm = args(2).sparse_bool_matrix_value ();
…
retval(2) = sbm;
retval(1) = scm;
retval(0) = sm;

Преобразование в octave_value выполняется конструкторами разреженных octave_value матриц, поэтому особых мер предосторожности не требуется.

© 1996–2022 The Octave Project Developers
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.
Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions.
https://docs.octave.org/v5.2.0/Using-Sparse-Matrices-in-Oct_002dFiles.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API