endas.cov.to_matrix¶
-
endas.cov.
to_matrix
(C, force_dense=False, out=None)¶ Returns matrix representation of a covariance operator.
If the passed instance is already a covariance matrix, it is returned as-is. Compatible matrix types are
numpy.ndarray
,numpy.matrix
- returned as-is- subclass of
scipy.sparse.spmatrix
- returned as-is ifforce_dense=False
, otherwise converted tonumpy.ndarray
.
If
C
is an instance ofendas.CovarianceOperator
, the result ofC.to_matrix()
is returned. Please note that not all covariance operators support conversion to explicit matrix form.Parameters: - C –
endas.CovarianceOperator
instance or NumPy array. - force_dense – Value passed to
endas.CovarianceOperator.to_matrix()
. - out – If specified, the array is used as the output buffer instead of allocating new array. The provided array must have the correct shape.
Returns: Dense NumPy array (
ndarray
) or sparse SciPy array depending onC
andforce_dense
.Raises: TypeError
– if C is of unsupported typeValueError
– if C is a non-square matrixNotImplementedError
– raised byendas.CovarianceOperator.to_matrix()
MemoryError
– if the covariance matrix array cannot be allocated