ComplexSparseMatrix
Factories
identity(const List<integer> shape, as_sparsematrix type) -> ComplexSparseMatrix
Creates an identity matrix (or array; possibly rectangular) with the specified shape and type.
Parameters
- shape: The shape of the container to create.
- type: The type of the container to create.
identity(const List<integer> shape, as_complex | as_sparsematrix type) -> ComplexSparseMatrix
Creates an identity matrix (or array; possibly rectangular) with the specified shape and type.
Parameters
- shape: The shape of the container to create.
- type: The type of the container to create.
matrix(const Operator operator, as_complex | as_sparsematrix type_tag) -> ComplexSparseMatrix
Converts the operator to its sparse matrix representation.
Parameters
- operator: The operator to convert.
- type_tag: A global constant tagging the object type.
matrix(const ComplexMatrix array, as_sparsematrix type) -> ComplexSparseMatrix
Converts a container to a sparse matrix with the same elements.
Arrays support elementwise operations, matrices support matrix algebra (e.g., operator *).
Parameters
- array: The input ComplexMatrix.
- type: The type of the container to create (here, a sparse matrix).
matrix(const Operator operator, as_sparsematrix type_tag) -> ComplexSparseMatrix
Converts the operator to its sparse matrix representation.
Parameters
- operator: The operator to convert.
- type_tag: A global constant tagging the object type.
matrix(const ComplexArray array, as_sparsematrix type) -> ComplexSparseMatrix
Converts a container to a sparse matrix with the same elements.
Arrays support elementwise operations, matrices support matrix algebra (e.g., operator *).
Parameters
- array: The input ComplexArray.
- type: The type of the container to create (here, a sparse matrix).
matrix(const ComplexSparseMatrix array, as_sparsematrix type) -> ComplexSparseMatrix
Converts a container to a sparse matrix with the same elements.
Arrays support elementwise operations, matrices support matrix algebra (e.g., operator *).
Parameters
- array: The input ComplexSparseMatrix.
- type: The type of the container to create (here, a sparse matrix).
matrix(const List list, as_sparsematrix type) -> ComplexSparseMatrix
Converts a list or list of list to a sparse matrix.
Parameters
- list: The list containing the values.
- type: The type of the container to create.
matrix(const List list, as_complex | as_sparsematrix type) -> ComplexSparseMatrix
Converts a list or list of list to a sparse matrix.
Parameters
- list: The list containing the values.
- type: The type of the container to create.
uninitialized(const List<integer> shape, as_complex | as_sparsematrix type) -> ComplexSparseMatrix
Creates a container with the specified shape and type.
Parameters
- shape: The shape of the container to create.
- type: The type of the container to create.
uninitialized(const List<integer> shape, as_sparsematrix type) -> ComplexSparseMatrix
Creates a container with the specified shape and type.
Parameters
- shape: The shape of the container to create.
- type: The type of the container to create.
zeros(const List<integer> shape, as_complex | as_sparsematrix type) -> ComplexSparseMatrix
Creates a container with the specified shape and type, filled with zeros.
Parameters
- shape: The shape of the container to create.
- type: The type of the container to create.
zeros(const List<integer> shape, as_sparsematrix type) -> ComplexSparseMatrix
Creates a container with the specified shape and type, filled with zeros.
Parameters
- shape: The shape of the container to create.
- type: The type of the container to create.
Constructors
ComplexSparseMatrix() -> ComplexSparseMatrix
Creates an empty ComplexSparseMatrix.
ComplexSparseMatrix(integer m) -> ComplexSparseMatrix
Creates an m x 1 ComplexSparseMatrix. The array comes out uninitialized.
Parameters
- m: The number of rows.
ComplexSparseMatrix(integer m, integer n) -> ComplexSparseMatrix
Creates an m x n ComplexSparseMatrix. The array comes out uninitialized.
Parameters
- m: The number of rows.
- n: The number of columns.
Symbols
| Name | Description |
|---|---|
* | Matrix-scalar multiplication operator. |
*= | Matrix-scalar multiplication-assignment compound operator. |
+ | Matrix addition operator. |
+= | Matrix addition-assignment compound operator. |
- | Matrix subtraction operator. |
-= | Matrix subtraction-assignment compound operator. |
/ | Matrix-scalar division operator. |
/= | Matrix-scalar division-assignment compound operator. |
= | Matrix assignment operator. |
[] | Gets or sets the element at row inds[0] and column inds[1] of the ComplexSparseMatrix. |
Members
| Name | Description |
|---|---|
| block | Get a block (sub-ComplexSparseMatrix) of the ComplexSparseMatrix. |
| bottom_left_corner | Get the bottom-left corner of the ComplexSparseMatrix. |
| bottom_right_corner | Get the bottom-right corner of the ComplexSparseMatrix. |
| bottom_rows | Get the bottom rows of the ComplexSparseMatrix. |
| col | Get a column of the ComplexSparseMatrix. |
| cols | Returns the number of columns of a ComplexSparseMatrix. |
| compress | Turns the ComplexSparseMatrix into the compressed format. |
| container_type | Returns the underlying container type of the ComplexSparseMatrix. |
| diagonal | Returns the diagonal elements of the ComplexSparseMatrix as a column-vector. |
| insert | Inserts values into a sparse matrix. |
| is_approx | Returns true if the ComplexSparseMatrix lhs is approximately equal to the ComplexSparseMatrix rhs, within the specified tolerance. |
| is_array | Whether the container is an array (which supports elementwise operations). |
| is_bool | Whether the underlying scalar type of the ComplexSparseMatrix is bool. |
| is_column_vector | Returns true if the container is a column-vector. |
| is_complex | Whether the underlying scalar type of the ComplexSparseMatrix is complex. |
| is_compressed | Checks if the ComplexSparseMatrix is in compressed format. |
| is_dense | Whether the container is dense. |
| is_integer | Whether the underlying scalar type of the ComplexSparseMatrix is integer. |
| is_matrix | Whether the container is a matrix (which supports matrix algebra). |
| is_real | Whether the underlying scalar type of the ComplexSparseMatrix is real. |
| is_row_vector | Returns true if the container is a row-vector. |
| is_scalar | Returns true if the container is a scalar (or a container containing a single element). |
| is_sparse | Whether the container is sparse. |
| is_vector | Returns true if the container is a vector. |
| left_cols | Get the left columns of the ComplexSparseMatrix. |
| middle_cols | Get the middle columns of the ComplexSparseMatrix. |
| middle_rows | Get the middle rows of the ComplexSparseMatrix. |
| nonzeros | Returns the number of non-zero elements in the ComplexSparseMatrix. |
| prune | Prunes the ComplexSparseMatrix lhs. |
| real | Returns the real component of a ComplexSparseMatrix. |
| right_cols | Get the right columns of the ComplexSparseMatrix. |
| row | Get a row of the ComplexSparseMatrix. |
| rows | Returns the number of rows of a ComplexSparseMatrix. |
| scalar_type | Returns the underlying scalar type of the ComplexSparseMatrix. |
| set_identity | Sets the ComplexSparseMatrix lhs to the identity matrix. |
| set_zero | Sets all elements of the ComplexSparseMatrix lhs to 0. |
| shape | Returns the shape of a ComplexSparseMatrix. |
| size | Returns the number of elements of a ComplexSparseMatrix. |
| top_left_corner | Get the top-left corner of the ComplexSparseMatrix. |
| top_right_corner | Get the top-right corner of the ComplexSparseMatrix. |
| top_rows | Get the top rows of the ComplexSparseMatrix. |