Eigen::SparseCompressedBase
template<typename Derived>
class Eigen::SparseCompressedBase< Derived >
Common base class for sparse [compressed]-{row|column}-storage format.
This class defines the common interface for all derived classes implementing the compressed sparse storage format, such as:
|
Map< Array< Scalar, Dynamic, 1 > > |
coeffs () |
|
const Map< const Array< Scalar, Dynamic, 1 > > |
coeffs () const |
|
StorageIndex * |
innerIndexPtr () |
|
const StorageIndex * |
innerIndexPtr () const |
|
StorageIndex * |
innerNonZeroPtr () |
|
const StorageIndex * |
innerNonZeroPtr () const |
|
bool |
isCompressed () const |
|
Index |
nonZeros () const |
|
StorageIndex * |
outerIndexPtr () |
|
const StorageIndex * |
outerIndexPtr () const |
|
Scalar * |
valuePtr () |
|
const Scalar * |
valuePtr () const |
|
Public Member Functions inherited from Eigen::SparseMatrixBase< Derived >
|
Index |
cols () const |
|
const internal::eval< Derived >::type |
eval () const |
|
Index |
innerSize () const |
|
bool |
isVector () const |
|
template<typename OtherDerived > |
const Product< Derived, OtherDerived, AliasFreeProduct > |
operator* (const SparseMatrixBase< OtherDerived > &other) const |
|
Index |
outerSize () const |
|
const SparseView< Derived > |
pruned (const Scalar &reference=Scalar(0), const RealScalar &epsilon=NumTraits< Scalar >::dummy_precision()) const |
|
Index |
rows () const |
|
Index |
size () const |
|
SparseSymmetricPermutationProduct< Derived, Upper|Lower > |
twistedBy (const PermutationMatrix< Dynamic, Dynamic, StorageIndex > &perm) const |
|
Public Member Functions inherited from Eigen::EigenBase< Derived >
|
EIGEN_CONSTEXPR Index |
cols () const EIGEN_NOEXCEPT |
|
Derived & |
derived () |
|
const Derived & |
derived () const |
|
EIGEN_CONSTEXPR Index |
rows () const EIGEN_NOEXCEPT |
|
EIGEN_CONSTEXPR Index |
size () const EIGEN_NOEXCEPT |
|
|
Public Types inherited from Eigen::SparseMatrixBase< Derived >
|
enum |
{ RowsAtCompileTime , ColsAtCompileTime , SizeAtCompileTime , MaxRowsAtCompileTime , MaxColsAtCompileTime , MaxSizeAtCompileTime , IsVectorAtCompileTime , NumDimensions , Flags , IsRowMajor , InnerSizeAtCompileTime } |
|
typedef internal::traits< Derived >::StorageIndex |
StorageIndex |
|
typedef Scalar |
value_type |
|
Public Types inherited from Eigen::EigenBase< Derived >
|
typedef Eigen::Index |
Index |
|
The interface type of indices. More...
|
|
SparseCompressedBase()
template<typename Derived >
Default constructor. Do nothing.
coeffs() [1/2]
template<typename Derived >
- Returns
- a read-write view of the stored coefficients as a 1D array expression
- Warning
- this method is for compressed storage only, and it will trigger an assertion otherwise.
Here is an example:
SparseMatrix<double> A(3,3);
A.insert(1,2) = 0;
A.insert(0,1) = 1;
A.insert(2,0) = 2;
A.makeCompressed();
cout << "The matrix A is:" << endl << MatrixXd(A) << endl;
cout << "it has " << A.nonZeros() << " stored non zero coefficients that are: " << A.coeffs().transpose() << endl;
A.coeffs() += 10;
cout << "After adding 10 to every stored non zero coefficient, the matrix A is:" << endl << MatrixXd(A) << endl;
and the output is:
The matrix A is:
0 1 0
0 0 0
2 0 0
it has 3 stored non zero coefficients that are: 2 1 0
After adding 10 to every stored non zero coefficient, the matrix A is:
0 11 0
0 0 10
12 0 0
- See also
-
valuePtr(), isCompressed()
coeffs() [2/2]
template<typename Derived >
- Returns
- a read-only view of the stored coefficients as a 1D array expression.
- Warning
- this method is for compressed storage only, and it will trigger an assertion otherwise.
- See also
-
valuePtr(), isCompressed()
innerIndexPtr() [1/2]
template<typename Derived >
- Returns
- a non-const pointer to the array of inner indices. This function is aimed at interoperability with other libraries.
- See also
-
valuePtr(), outerIndexPtr()
innerIndexPtr() [2/2]
template<typename Derived >
- Returns
- a const pointer to the array of inner indices. This function is aimed at interoperability with other libraries.
- See also
-
valuePtr(), outerIndexPtr()
innerNonZeroPtr() [1/2]
template<typename Derived >
- Returns
- a non-const pointer to the array of the number of non zeros of the inner vectors. This function is aimed at interoperability with other libraries.
- Warning
- it returns the null pointer 0 in compressed mode
innerNonZeroPtr() [2/2]
template<typename Derived >
- Returns
- a const pointer to the array of the number of non zeros of the inner vectors. This function is aimed at interoperability with other libraries.
- Warning
- it returns the null pointer 0 in compressed mode
isCompressed()
template<typename Derived >
- Returns
- whether
*this
is in compressed form.
nonZeros()
template<typename Derived >
- Returns
- the number of non zero coefficients
outerIndexPtr() [1/2]
template<typename Derived >
- Returns
- a non-const pointer to the array of the starting positions of the inner vectors. This function is aimed at interoperability with other libraries.
- Warning
- it returns the null pointer 0 for SparseVector
- See also
-
valuePtr(), innerIndexPtr()
outerIndexPtr() [2/2]
template<typename Derived >
- Returns
- a const pointer to the array of the starting positions of the inner vectors. This function is aimed at interoperability with other libraries.
- Warning
- it returns the null pointer 0 for SparseVector
- See also
-
valuePtr(), innerIndexPtr()
valuePtr() [1/2]
template<typename Derived >
- Returns
- a non-const pointer to the array of values. This function is aimed at interoperability with other libraries.
- See also
-
innerIndexPtr(), outerIndexPtr()
valuePtr() [2/2]
template<typename Derived >
- Returns
- a const pointer to the array of values. This function is aimed at interoperability with other libraries.
- See also
-
innerIndexPtr(), outerIndexPtr()
The documentation for this class was generated from the following file: