get_diagonal_matrix T_get_diagonal_matrix GetDiagonalMatrix GetDiagonalMatrix get_diagonal_matrix (Operator)
Name
get_diagonal_matrix T_get_diagonal_matrix GetDiagonalMatrix GetDiagonalMatrix get_diagonal_matrix
— Get the diagonal elements of a matrix.
Signature
Description
The operator get_diagonal_matrix get_diagonal_matrix GetDiagonalMatrix GetDiagonalMatrix GetDiagonalMatrix get_diagonal_matrix
generates a new matrix
Vector
and copies the diagonal elements of the
Matrix
to this new matrix. The Matrix
is
defined by the matrix handle MatrixID MatrixID MatrixID MatrixID matrixID matrix_id
. The matrix
Vector
has one column and n rows, where n = number of
diagonal elements. The operator returns the matrix handle
VectorID VectorID VectorID VectorID vectorID vector_id
of the matrix Vector
. Access to the
elements of the matrix is possible e.g., with the operator
get_full_matrix get_full_matrix GetFullMatrix GetFullMatrix GetFullMatrix get_full_matrix
.
If Diagonal Diagonal Diagonal Diagonal diagonal diagonal
= 0, the output of the Vector
is the
main diagonal of the Matrix
.
Example:
Diagonal Diagonal Diagonal Diagonal diagonal diagonal
= 0
If Diagonal Diagonal Diagonal Diagonal diagonal diagonal
is positive, the output Vector
is the
Diagonal Diagonal Diagonal Diagonal diagonal diagonal
-th super-diagonal of the Matrix
.
Example:
Diagonal Diagonal Diagonal Diagonal diagonal diagonal
= 2
If Diagonal Diagonal Diagonal Diagonal diagonal diagonal
is negative, the Diagonal Diagonal Diagonal Diagonal diagonal diagonal
-th
sub-diagonal of the Matrix
is copied.
Example:
Diagonal Diagonal Diagonal Diagonal diagonal diagonal
= -1
Execution Information
Multithreading type: reentrant (runs in parallel with non-exclusive operators).
Multithreading scope: global (may be called from any thread).
Processed without parallelization.
Parameters
MatrixID MatrixID MatrixID MatrixID matrixID matrix_id
(input_control) matrix →
HMatrix , HTuple HHandle HTuple Htuple (handle) (IntPtr ) (HHandle ) (handle )
Matrix handle of the input matrix.
Diagonal Diagonal Diagonal Diagonal diagonal diagonal
(input_control) integer →
HTuple int HTuple Htuple (integer) (int / long) (Hlong ) (Hlong )
Number of the desired diagonal.
Default:
0
Suggested values:
-20, -10, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 10, 20
VectorID VectorID VectorID VectorID vectorID vector_id
(output_control) matrix →
HMatrix , HTuple HHandle HTuple Htuple (handle) (IntPtr ) (HHandle ) (handle )
Matrix handle containing the diagonal elements.
Result
If the parameters are valid, the operator
get_diagonal_matrix get_diagonal_matrix GetDiagonalMatrix GetDiagonalMatrix GetDiagonalMatrix get_diagonal_matrix
returns the value 2 (
H_MSG_TRUE )
. If necessary,
an exception is raised.
Possible Predecessors
create_matrix create_matrix CreateMatrix CreateMatrix CreateMatrix create_matrix
Possible Successors
get_full_matrix get_full_matrix GetFullMatrix GetFullMatrix GetFullMatrix get_full_matrix
,
get_value_matrix get_value_matrix GetValueMatrix GetValueMatrix GetValueMatrix get_value_matrix
See also
set_diagonal_matrix set_diagonal_matrix SetDiagonalMatrix SetDiagonalMatrix SetDiagonalMatrix set_diagonal_matrix
Module
Foundation