![]() |
Eigen
3.3.3
|
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:
Public Member Functions | |
const Map< const Array< Scalar, Dynamic, 1 > > | coeffs () const |
Map< Array< Scalar, Dynamic, 1 > > | coeffs () |
const StorageIndex * | innerIndexPtr () const |
StorageIndex * | innerIndexPtr () |
const StorageIndex * | innerNonZeroPtr () const |
StorageIndex * | innerNonZeroPtr () |
bool | isCompressed () const |
Index | nonZeros () const |
const StorageIndex * | outerIndexPtr () const |
StorageIndex * | outerIndexPtr () |
const Scalar * | valuePtr () const |
Scalar * | valuePtr () |
Protected Member Functions | |
SparseCompressedBase () |
Eigen::SparseCompressedBase< Derived >::SparseCompressedBase | ( | ) | [inline, protected] |
Default constructor. Do nothing.
const Map<const Array<Scalar,Dynamic,1> > Eigen::SparseCompressedBase< Derived >::coeffs | ( | ) | const [inline] |
Map<Array<Scalar,Dynamic,1> > Eigen::SparseCompressedBase< Derived >::coeffs | ( | ) | [inline] |
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
const StorageIndex* Eigen::SparseCompressedBase< Derived >::innerIndexPtr | ( | ) | const [inline] |
Reimplemented in Eigen::SparseMatrix< _Scalar, _Options, _StorageIndex >, Eigen::SparseMatrix< Scalar >, Eigen::SparseMatrix< Scalar, ColMajor, StorageIndex >, Eigen::SparseMatrix< Scalar, ColMajor, int >, Eigen::SparseMatrix< Scalar, RowMajor, StorageIndex >, Eigen::SparseMapBase< Derived, ReadOnlyAccessors >, and Eigen::SparseVector< _Scalar, _Options, _StorageIndex >.
StorageIndex* Eigen::SparseCompressedBase< Derived >::innerIndexPtr | ( | ) | [inline] |
Reimplemented in Eigen::SparseMapBase< Derived, WriteAccessors >, Eigen::SparseMatrix< _Scalar, _Options, _StorageIndex >, Eigen::SparseMatrix< Scalar >, Eigen::SparseMatrix< Scalar, ColMajor, StorageIndex >, Eigen::SparseMatrix< Scalar, ColMajor, int >, Eigen::SparseMatrix< Scalar, RowMajor, StorageIndex >, and Eigen::SparseVector< _Scalar, _Options, _StorageIndex >.
const StorageIndex* Eigen::SparseCompressedBase< Derived >::innerNonZeroPtr | ( | ) | const [inline] |
Reimplemented in Eigen::SparseMatrix< _Scalar, _Options, _StorageIndex >, Eigen::SparseMatrix< Scalar >, Eigen::SparseMatrix< Scalar, ColMajor, StorageIndex >, Eigen::SparseMatrix< Scalar, ColMajor, int >, Eigen::SparseMatrix< Scalar, RowMajor, StorageIndex >, Eigen::SparseMapBase< Derived, ReadOnlyAccessors >, and Eigen::SparseVector< _Scalar, _Options, _StorageIndex >.
StorageIndex* Eigen::SparseCompressedBase< Derived >::innerNonZeroPtr | ( | ) | [inline] |
Reimplemented in Eigen::SparseMatrix< _Scalar, _Options, _StorageIndex >, Eigen::SparseMatrix< Scalar >, Eigen::SparseMatrix< Scalar, ColMajor, StorageIndex >, Eigen::SparseMatrix< Scalar, ColMajor, int >, Eigen::SparseMatrix< Scalar, RowMajor, StorageIndex >, Eigen::SparseMapBase< Derived, WriteAccessors >, and Eigen::SparseVector< _Scalar, _Options, _StorageIndex >.
bool Eigen::SparseCompressedBase< Derived >::isCompressed | ( | ) | const [inline] |
*this
is in compressed form. Reimplemented in Eigen::SparseMapBase< Derived, ReadOnlyAccessors >.
Index Eigen::SparseCompressedBase< Derived >::nonZeros | ( | ) | const [inline] |
Reimplemented in Eigen::SparseVector< _Scalar, _Options, _StorageIndex >, and Eigen::SparseMapBase< Derived, ReadOnlyAccessors >.
const StorageIndex* Eigen::SparseCompressedBase< Derived >::outerIndexPtr | ( | ) | const [inline] |
Reimplemented in Eigen::SparseMatrix< _Scalar, _Options, _StorageIndex >, Eigen::SparseMatrix< Scalar >, Eigen::SparseMatrix< Scalar, ColMajor, StorageIndex >, Eigen::SparseMatrix< Scalar, ColMajor, int >, Eigen::SparseMatrix< Scalar, RowMajor, StorageIndex >, Eigen::SparseMapBase< Derived, ReadOnlyAccessors >, and Eigen::SparseVector< _Scalar, _Options, _StorageIndex >.
StorageIndex* Eigen::SparseCompressedBase< Derived >::outerIndexPtr | ( | ) | [inline] |
Reimplemented in Eigen::SparseMapBase< Derived, WriteAccessors >, Eigen::SparseMatrix< _Scalar, _Options, _StorageIndex >, Eigen::SparseMatrix< Scalar >, Eigen::SparseMatrix< Scalar, ColMajor, StorageIndex >, Eigen::SparseMatrix< Scalar, ColMajor, int >, Eigen::SparseMatrix< Scalar, RowMajor, StorageIndex >, and Eigen::SparseVector< _Scalar, _Options, _StorageIndex >.
const Scalar* Eigen::SparseCompressedBase< Derived >::valuePtr | ( | ) | const [inline] |
Reimplemented in Eigen::SparseMatrix< _Scalar, _Options, _StorageIndex >, Eigen::SparseMatrix< Scalar >, Eigen::SparseMatrix< Scalar, ColMajor, StorageIndex >, Eigen::SparseMatrix< Scalar, ColMajor, int >, Eigen::SparseMatrix< Scalar, RowMajor, StorageIndex >, Eigen::SparseMapBase< Derived, ReadOnlyAccessors >, and Eigen::SparseVector< _Scalar, _Options, _StorageIndex >.
Scalar* Eigen::SparseCompressedBase< Derived >::valuePtr | ( | ) | [inline] |
Reimplemented in Eigen::SparseMapBase< Derived, WriteAccessors >, Eigen::SparseMatrix< _Scalar, _Options, _StorageIndex >, Eigen::SparseMatrix< Scalar >, Eigen::SparseMatrix< Scalar, ColMajor, StorageIndex >, Eigen::SparseMatrix< Scalar, ColMajor, int >, Eigen::SparseMatrix< Scalar, RowMajor, StorageIndex >, and Eigen::SparseVector< _Scalar, _Options, _StorageIndex >.