Skip to main content

ComplexSparseMatrix

A 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

NameDescription
*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

NameDescription
blockGet a block (sub-ComplexSparseMatrix) of the ComplexSparseMatrix.
bottom_left_cornerGet the bottom-left corner of the ComplexSparseMatrix.
bottom_right_cornerGet the bottom-right corner of the ComplexSparseMatrix.
bottom_rowsGet the bottom rows of the ComplexSparseMatrix.
colGet a column of the ComplexSparseMatrix.
colsReturns the number of columns of a ComplexSparseMatrix.
compressTurns the ComplexSparseMatrix into the compressed format.
container_typeReturns the underlying container type of the ComplexSparseMatrix.
diagonalReturns the diagonal elements of the ComplexSparseMatrix as a column-vector.
insertInserts values into a sparse matrix.
is_approxReturns true if the ComplexSparseMatrix lhs is approximately equal to the ComplexSparseMatrix rhs, within the specified tolerance.
is_arrayWhether the container is an array (which supports elementwise operations).
is_boolWhether the underlying scalar type of the ComplexSparseMatrix is bool.
is_column_vectorReturns true if the container is a column-vector.
is_complexWhether the underlying scalar type of the ComplexSparseMatrix is complex.
is_compressedChecks if the ComplexSparseMatrix is in compressed format.
is_denseWhether the container is dense.
is_integerWhether the underlying scalar type of the ComplexSparseMatrix is integer.
is_matrixWhether the container is a matrix (which supports matrix algebra).
is_realWhether the underlying scalar type of the ComplexSparseMatrix is real.
is_row_vectorReturns true if the container is a row-vector.
is_scalarReturns true if the container is a scalar (or a container containing a single element).
is_sparseWhether the container is sparse.
is_vectorReturns true if the container is a vector.
left_colsGet the left columns of the ComplexSparseMatrix.
middle_colsGet the middle columns of the ComplexSparseMatrix.
middle_rowsGet the middle rows of the ComplexSparseMatrix.
nonzerosReturns the number of non-zero elements in the ComplexSparseMatrix.
prunePrunes the ComplexSparseMatrix lhs.
realReturns the real component of a ComplexSparseMatrix.
right_colsGet the right columns of the ComplexSparseMatrix.
rowGet a row of the ComplexSparseMatrix.
rowsReturns the number of rows of a ComplexSparseMatrix.
scalar_typeReturns the underlying scalar type of the ComplexSparseMatrix.
set_identitySets the ComplexSparseMatrix lhs to the identity matrix.
set_zeroSets all elements of the ComplexSparseMatrix lhs to 0.
shapeReturns the shape of a ComplexSparseMatrix.
sizeReturns the number of elements of a ComplexSparseMatrix.
top_left_cornerGet the top-left corner of the ComplexSparseMatrix.
top_right_cornerGet the top-right corner of the ComplexSparseMatrix.
top_rowsGet the top rows of the ComplexSparseMatrix.