A versatible sparse matrix representation. More...
Classes | |
struct | IndexPosPair |
class | SingletonVector |
Public Types | |
enum | { Options } |
typedef Diagonal< const SparseMatrix > | ConstDiagonalReturnType |
typedef Diagonal< SparseMatrix > | DiagonalReturnType |
typedef Base::IndexVector | IndexVector |
typedef Eigen::Map< SparseMatrix< Scalar, Options_, StorageIndex > > | Map |
typedef Base::ScalarVector | ScalarVector |
typedef internal::CompressedStorage< Scalar, StorageIndex > | Storage |
Public Types inherited from Eigen::SparseCompressedBase< SparseMatrix< Scalar_, Options_, StorageIndex_ > > | |
typedef SparseMatrixBase< SparseMatrix< Scalar_, Options_, StorageIndex_ > > | Base |
Public Types inherited from Eigen::SparseMatrixBase< SparseMatrix< Scalar_, Options_, StorageIndex_ > > | |
enum | |
typedef std::conditional_t< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, Eigen::Transpose< const SparseMatrix< Scalar_, Options_, StorageIndex_ > > >, Transpose< const SparseMatrix< Scalar_, Options_, StorageIndex_ > > > | AdjointReturnType |
typedef Transpose< const SparseMatrix< Scalar_, Options_, StorageIndex_ > > | ConstTransposeReturnType |
typedef Matrix< StorageIndex, Dynamic, 1 > | IndexVector |
typedef internal::add_const_on_value_type_if_arithmetic< typename internal::packet_traits< Scalar >::type >::type | PacketReturnType |
typedef internal::packet_traits< Scalar >::type | PacketScalar |
typedef SparseMatrix< Scalar, Flags &RowMajorBit ? RowMajor :ColMajor, StorageIndex > | PlainObject |
typedef internal::traits< SparseMatrix< Scalar_, Options_, StorageIndex_ > >::Scalar | Scalar |
typedef Matrix< Scalar, Dynamic, 1 > | ScalarVector |
typedef SparseMatrixBase | StorageBaseType |
typedef internal::traits< SparseMatrix< Scalar_, Options_, StorageIndex_ > >::StorageIndex | StorageIndex |
typedef internal::traits< SparseMatrix< Scalar_, Options_, StorageIndex_ > >::StorageKind | StorageKind |
typedef Transpose< SparseMatrix< Scalar_, Options_, StorageIndex_ > > | TransposeReturnType |
typedef Scalar | value_type |
Public Types inherited from Eigen::EigenBase< SparseMatrix< Scalar_, Options_, StorageIndex_ > > | |
typedef Eigen::Index | Index |
The interface type of indices. More... | |
typedef internal::traits< SparseMatrix< Scalar_, Options_, StorageIndex_ > >::StorageKind | StorageKind |
Public Member Functions | |
Scalar | coeff (Index row, Index col) const |
Scalar & | coeffRef (Index row, Index col) |
template<typename Derived , typename DupFunctor > | |
void | collapseDuplicates (DenseBase< Derived > &wi, DupFunctor dup_func=DupFunctor()) |
Index | cols () const |
void | conservativeResize (Index rows, Index cols) |
Storage & | data () |
const Storage & | data () const |
DiagonalReturnType | diagonal () |
const ConstDiagonalReturnType | diagonal () const |
void | finalize () |
StorageIndex * | innerIndexPtr () |
const StorageIndex * | innerIndexPtr () const |
StorageIndex * | innerNonZeroPtr () |
const StorageIndex * | innerNonZeroPtr () const |
Index | innerSize () const |
Scalar & | insert (Index row, Index col) |
Scalar & | insertBack (Index row, Index col) |
Scalar & | insertBackByOuterInner (Index outer, Index inner) |
Scalar & | insertBackByOuterInnerUnordered (Index outer, Index inner) |
Scalar & | insertBackUncompressed (Index row, Index col) |
Scalar & | insertByOuterInner (Index j, Index i) |
void | insertEmptyOuterVectors (Index j, Index num=1) |
template<typename InputIterators > | |
void | insertFromSortedTriplets (const InputIterators &begin, const InputIterators &end) |
template<typename InputIterators , typename DupFunctor > | |
void | insertFromSortedTriplets (const InputIterators &begin, const InputIterators &end, DupFunctor dup_func) |
template<typename InputIterators > | |
void | insertFromTriplets (const InputIterators &begin, const InputIterators &end) |
template<typename InputIterators , typename DupFunctor > | |
void | insertFromTriplets (const InputIterators &begin, const InputIterators &end, DupFunctor dup_func) |
bool | isCompressed () const |
void | makeCompressed () |
Index | nonZeros () const |
SparseMatrix & | operator= (const SparseMatrix &other) |
template<typename OtherDerived > | |
EIGEN_DONT_INLINE SparseMatrix & | operator= (const SparseMatrixBase< OtherDerived > &other) |
template<typename OtherDerived > | |
EIGEN_DONT_INLINE SparseMatrix< Scalar, Options_, StorageIndex_ > & | operator= (const SparseMatrixBase< OtherDerived > &other) |
SparseMatrix & | operator= (SparseMatrix &&other) |
StorageIndex * | outerIndexPtr () |
const StorageIndex * | outerIndexPtr () const |
Index | outerSize () const |
template<typename KeepFunc > | |
void | prune (const KeepFunc &keep=KeepFunc()) |
void | prune (const Scalar &reference, const RealScalar &epsilon=NumTraits< RealScalar >::dummy_precision()) |
void | removeOuterVectors (Index j, Index num=1) |
template<class SizesType > | |
void | reserve (const SizesType &reserveSizes) |
void | reserve (Index reserveSize) |
void | resize (Index rows, Index cols) |
void | resizeNonZeros (Index size) |
Index | rows () const |
template<typename InputIterators > | |
void | setFromSortedTriplets (const InputIterators &begin, const InputIterators &end) |
template<typename InputIterators , typename DupFunctor > | |
void | setFromSortedTriplets (const InputIterators &begin, const InputIterators &end, DupFunctor dup_func) |
template<typename InputIterators > | |
void | setFromTriplets (const InputIterators &begin, const InputIterators &end) |
template<typename InputIterators , typename DupFunctor > | |
void | setFromTriplets (const InputIterators &begin, const InputIterators &end, DupFunctor dup_func) |
void | setIdentity () |
void | setZero () |
SparseMatrix () | |
template<typename OtherDerived > | |
SparseMatrix (const DiagonalBase< OtherDerived > &other) | |
Copy constructor with in-place evaluation. More... | |
template<typename OtherDerived > | |
SparseMatrix (const ReturnByValue< OtherDerived > &other) | |
Copy constructor with in-place evaluation. More... | |
SparseMatrix (const SparseMatrix &other) | |
template<typename OtherDerived > | |
SparseMatrix (const SparseMatrixBase< OtherDerived > &other) | |
template<typename OtherDerived , unsigned int UpLo> | |
SparseMatrix (const SparseSelfAdjointView< OtherDerived, UpLo > &other) | |
SparseMatrix (Index rows, Index cols) | |
SparseMatrix (SparseMatrix &&other) | |
void | startVec (Index outer) |
Scalar | sum () const |
void | swap (SparseMatrix &other) |
void | uncompress () |
Scalar * | valuePtr () |
const Scalar * | valuePtr () const |
~SparseMatrix () | |
Public Member Functions inherited from Eigen::SparseCompressedBase< SparseMatrix< Scalar_, Options_, StorageIndex_ > > | |
Map< Array< Scalar, Dynamic, 1 > > | coeffs () |
const Map< const Array< Scalar, Dynamic, 1 > > | coeffs () const |
StorageIndex * | innerIndexPtr () |
const StorageIndex * | innerIndexPtr () const |
Index | innerIndicesAreSorted () const |
Index | innerIndicesAreSorted (Index begin, Index end) const |
StorageIndex * | innerNonZeroPtr () |
const StorageIndex * | innerNonZeroPtr () const |
bool | isCompressed () const |
Index | nonZeros () const |
SparseMatrix< Scalar_, Options_, StorageIndex_ > & | operator= (const EigenBase< OtherDerived > &other) |
SparseMatrix< Scalar_, Options_, StorageIndex_ > & | operator= (const ReturnByValue< OtherDerived > &other) |
SparseMatrix< Scalar_, Options_, StorageIndex_ > & | operator= (const SparseMatrix< Scalar_, Options_, StorageIndex_ > &other) |
SparseMatrix< Scalar_, Options_, StorageIndex_ > & | operator= (const SparseMatrixBase< OtherDerived > &other) |
StorageIndex * | outerIndexPtr () |
const StorageIndex * | outerIndexPtr () const |
void | sortInnerIndices () |
void | sortInnerIndices (Index begin, Index end) |
Scalar * | valuePtr () |
const Scalar * | valuePtr () const |
Public Member Functions inherited from Eigen::SparseMatrixBase< SparseMatrix< Scalar_, Options_, StorageIndex_ > > | |
const AdjointReturnType | adjoint () const |
RealScalar | blueNorm () const |
Index | cols () const |
const SparseMatrixBase< SparseMatrix< Scalar_, Options_, StorageIndex_ > >::template CwiseProductDenseReturnType< OtherDerived >::Type | cwiseProduct (const MatrixBase< OtherDerived > &other) const |
const CwiseProductDenseReturnType< OtherDerived >::Type | cwiseProduct (const MatrixBase< OtherDerived > &other) const |
internal::traits< SparseMatrix< Scalar_, Options_, StorageIndex_ > >::Scalar | dot (const MatrixBase< OtherDerived > &other) const |
Scalar | dot (const MatrixBase< OtherDerived > &other) const |
internal::traits< SparseMatrix< Scalar_, Options_, StorageIndex_ > >::Scalar | dot (const SparseMatrixBase< OtherDerived > &other) const |
Scalar | dot (const SparseMatrixBase< OtherDerived > &other) const |
const internal::eval< SparseMatrix< Scalar_, Options_, StorageIndex_ > >::type | eval () const |
Index | innerSize () const |
bool | isApprox (const MatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const |
bool | isApprox (const SparseMatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const |
bool | isRValue () const |
bool | isVector () const |
SparseMatrix< Scalar_, Options_, StorageIndex_ > & | markAsRValue () |
RealScalar | norm () const |
const Product< SparseMatrix< Scalar_, Options_, StorageIndex_ >, OtherDerived > | operator* (const DiagonalBase< OtherDerived > &other) const |
const Product< SparseMatrix< Scalar_, Options_, StorageIndex_ >, OtherDerived > | operator* (const MatrixBase< OtherDerived > &other) const |
const Product< SparseMatrix< Scalar_, Options_, StorageIndex_ >, OtherDerived, AliasFreeProduct > | operator* (const SparseMatrixBase< OtherDerived > &other) const |
SparseMatrix< Scalar_, Options_, StorageIndex_ > & | operator*= (const Scalar &other) |
SparseMatrix< Scalar_, Options_, StorageIndex_ > & | operator*= (const SparseMatrixBase< OtherDerived > &other) |
SparseMatrix< Scalar_, Options_, StorageIndex_ > & | operator+= (const DiagonalBase< OtherDerived > &other) |
SparseMatrix< Scalar_, Options_, StorageIndex_ > & | operator+= (const EigenBase< OtherDerived > &other) |
SparseMatrix< Scalar_, Options_, StorageIndex_ > & | operator+= (const SparseMatrixBase< OtherDerived > &other) |
SparseMatrix< Scalar_, Options_, StorageIndex_ > & | operator-= (const DiagonalBase< OtherDerived > &other) |
SparseMatrix< Scalar_, Options_, StorageIndex_ > & | operator-= (const EigenBase< OtherDerived > &other) |
SparseMatrix< Scalar_, Options_, StorageIndex_ > & | operator-= (const SparseMatrixBase< OtherDerived > &other) |
SparseMatrix< Scalar_, Options_, StorageIndex_ > & | operator/= (const Scalar &other) |
SparseMatrix< Scalar_, Options_, StorageIndex_ > & | operator= (const EigenBase< OtherDerived > &other) |
SparseMatrix< Scalar_, Options_, StorageIndex_ > & | operator= (const ReturnByValue< OtherDerived > &other) |
SparseMatrix< Scalar_, Options_, StorageIndex_ > & | operator= (const SparseMatrix< Scalar_, Options_, StorageIndex_ > &other) |
SparseMatrix< Scalar_, Options_, StorageIndex_ > & | operator= (const SparseMatrixBase< OtherDerived > &other) |
Index | outerSize () const |
const SparseView< SparseMatrix< Scalar_, Options_, StorageIndex_ > > | pruned (const Scalar &reference=Scalar(0), const RealScalar &epsilon=NumTraits< Scalar >::dummy_precision()) const |
Index | rows () const |
SelfAdjointViewReturnType< UpLo >::Type | selfadjointView () |
SparseMatrixBase< SparseMatrix< Scalar_, Options_, StorageIndex_ > >::template SelfAdjointViewReturnType< UpLo >::Type | selfadjointView () |
ConstSelfAdjointViewReturnType< UpLo >::Type | selfadjointView () const |
SparseMatrixBase< SparseMatrix< Scalar_, Options_, StorageIndex_ > >::template ConstSelfAdjointViewReturnType< UpLo >::Type | selfadjointView () const |
Index | size () const |
SparseMatrixBase () | |
RealScalar | squaredNorm () const |
Scalar | sum () const |
DenseMatrixType | toDense () const |
TransposeReturnType | transpose () |
const ConstTransposeReturnType | transpose () const |
const TriangularView< const SparseMatrix< Scalar_, Options_, StorageIndex_ >, Mode > | triangularView () const |
SparseSymmetricPermutationProduct< SparseMatrix< Scalar_, Options_, StorageIndex_ >, Upper|Lower > | twistedBy (const PermutationMatrix< Dynamic, Dynamic, StorageIndex > &perm) const |
Public Member Functions inherited from Eigen::EigenBase< SparseMatrix< Scalar_, Options_, StorageIndex_ > > | |
void | addTo (Dest &dst) const |
void | applyThisOnTheLeft (Dest &dst) const |
void | applyThisOnTheRight (Dest &dst) const |
EIGEN_CONSTEXPR Index | cols () const EIGEN_NOEXCEPT |
SparseMatrix< Scalar_, Options_, StorageIndex_ > & | const_cast_derived () const |
const SparseMatrix< Scalar_, Options_, StorageIndex_ > & | const_derived () const |
SparseMatrix< Scalar_, Options_, StorageIndex_ > & | derived () |
const SparseMatrix< Scalar_, Options_, StorageIndex_ > & | derived () const |
void | evalTo (Dest &dst) const |
EIGEN_CONSTEXPR Index | rows () const EIGEN_NOEXCEPT |
EIGEN_CONSTEXPR Index | size () const EIGEN_NOEXCEPT |
void | subTo (Dest &dst) const |
Protected Types | |
typedef SparseMatrix< Scalar, IsRowMajor ? ColMajor :RowMajor, StorageIndex > | TransposedSparseMatrix |
Protected Types inherited from Eigen::SparseCompressedBase< SparseMatrix< Scalar_, Options_, StorageIndex_ > > | |
typedef Base::IndexVector | IndexVector |
Protected Attributes | |
Storage | m_data |
StorageIndex * | m_innerNonZeros |
Index | m_innerSize |
StorageIndex * | m_outerIndex |
Index | m_outerSize |
Protected Attributes inherited from Eigen::SparseMatrixBase< SparseMatrix< Scalar_, Options_, StorageIndex_ > > | |
bool | m_isRValue |
Private Types | |
typedef SparseCompressedBase< SparseMatrix > | Base |
Private Member Functions | |
EIGEN_STATIC_ASSERT ((Options &(ColMajor|RowMajor))==Options, INVALID_MATRIX_TEMPLATE_PARAMETERS) struct default_prunning_func | |
Additional Inherited Members | |
Static Protected Member Functions inherited from Eigen::SparseMatrixBase< SparseMatrix< Scalar_, Options_, StorageIndex_ > > | |
static StorageIndex | convert_index (const Index idx) |
A versatible sparse matrix representation.
This class implements a more versatile variants of the common compressed row/column storage format. Each colmun's (resp. row) non zeros are stored as a pair of value with associated row (resp. colmiun) index. All the non zeros are stored in a single large buffer. Unlike the compressed format, there might be extra space in between the nonzeros of two successive colmuns (resp. rows) such that insertion of new non-zero can be done with limited memory reallocation and copies.
A call to the function makeCompressed() turns the matrix into the standard compressed format compatible with many library.
More details on this storage sceheme are given in the manual pages.
Scalar_ | the scalar type, i.e. the type of the coefficients |
Options_ | Union of bit flags controlling the storage scheme. Currently the only possibility is ColMajor or RowMajor. The default is 0 which means column-major. |
StorageIndex_ | the type of the indices. It has to be a signed type (e.g., short, int, std::ptrdiff_t). Default is int . |
SparseMatrix::Index
was improperly defined as the storage index type (e.g., int), whereas it is now (starting from Eigen 3.3) deprecated and always defined as Eigen::Index. Codes making use of SparseMatrix::Index
, might thus likely have to be changed to use SparseMatrix::StorageIndex
instead.This class can be extended with the help of the plugin mechanism described on the page Extending MatrixBase (and other classes) by defining the preprocessor symbol EIGEN_SPARSEMATRIX_PLUGIN
.
Definition at line 123 of file SparseMatrix.h.
|
private |
Definition at line 126 of file SparseMatrix.h.
typedef Diagonal<const SparseMatrix> Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::ConstDiagonalReturnType |
Definition at line 140 of file SparseMatrix.h.
typedef Diagonal<SparseMatrix> Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::DiagonalReturnType |
Definition at line 139 of file SparseMatrix.h.
typedef Base::IndexVector Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::IndexVector |
Definition at line 151 of file SparseMatrix.h.
typedef Eigen::Map<SparseMatrix<Scalar,Options_,StorageIndex> > Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::Map |
Definition at line 138 of file SparseMatrix.h.
typedef Base::ScalarVector Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::ScalarVector |
Definition at line 152 of file SparseMatrix.h.
typedef internal::CompressedStorage<Scalar,StorageIndex> Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::Storage |
Definition at line 146 of file SparseMatrix.h.
|
protected |
Definition at line 154 of file SparseMatrix.h.
anonymous enum |
|
inline |
|
inline |
|
inline |
Constructs a sparse matrix from the sparse expression other
Definition at line 788 of file SparseMatrix.h.
|
inline |
Constructs a sparse matrix from the sparse selfadjoint view other
Definition at line 807 of file SparseMatrix.h.
|
inline |
Definition at line 813 of file SparseMatrix.h.
|
inline |
|
inline |
Copy constructor with in-place evaluation.
Definition at line 827 of file SparseMatrix.h.
|
inlineexplicit |
|
inline |
|
inlineprotected |
Definition at line 1037 of file SparseMatrix.h.
|
inline |
Definition at line 217 of file SparseMatrix.h.
|
inline |
If the element does not exist then it is inserted via the insert(Index,Index) function which itself turns the matrix into a non compressed form if that was not the case.
This is a O(log(nnz_j)) operation (binary search) plus the cost of insert(Index,Index) function if the element does not already exist.
Definition at line 235 of file SparseMatrix.h.
void Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::collapseDuplicates | ( | DenseBase< Derived > & | wi, |
DupFunctor | dup_func = DupFunctor() |
||
) |
Definition at line 1506 of file SparseMatrix.h.
|
inline |
|
inline |
Resizes the matrix to a rows x cols matrix leaving old values untouched.
If the sizes of the matrix are decreased, then the matrix is turned to uncompressed-mode and the storage of the out of bounds coefficients is kept and reserved. Call makeCompressed() to pack the entries and squeeze extra memory.
Definition at line 686 of file SparseMatrix.h.
|
inline |
Definition at line 211 of file SparseMatrix.h.
|
inline |
Definition at line 213 of file SparseMatrix.h.
|
inline |
Definition at line 770 of file SparseMatrix.h.
|
inline |
Definition at line 764 of file SparseMatrix.h.
|
inlineprivate |
Definition at line 1148 of file SparseMatrix.h.
|
inline |
Definition at line 457 of file SparseMatrix.h.
|
inlineprotected |
Definition at line 974 of file SparseMatrix.h.
|
inline |
Definition at line 190 of file SparseMatrix.h.
|
inline |
Definition at line 186 of file SparseMatrix.h.
|
inline |
Definition at line 208 of file SparseMatrix.h.
|
inline |
Definition at line 204 of file SparseMatrix.h.
|
inline |
Definition at line 170 of file SparseMatrix.h.
|
inline |
If the matrix *this
is in compressed mode, then *this
is turned into uncompressed mode while reserving room for 2 x this->innerSize() non zeros if reserve(Index) has not been called earlier. In this case, the insertion procedure is optimized for a sequential insertion mode where elements are assumed to be inserted by increasing outer-indices.
If that's not the case, then it is strongly recommended to either use a triplet-list to assemble the matrix, or to first call reserve(const SizesType &) to reserve the appropriate number of non-zero elements per inner vector.
Assuming memory has been appropriately reserved, this function performs a sorted insertion in O(1) if the elements of each inner vector are inserted in increasing inner index order, and in O(nnz_j) for a random insertion.
Definition at line 1620 of file SparseMatrix.h.
|
inlineprotected |
Definition at line 1626 of file SparseMatrix.h.
|
inline |
Definition at line 418 of file SparseMatrix.h.
|
inline |
Definition at line 425 of file SparseMatrix.h.
|
inline |
Definition at line 437 of file SparseMatrix.h.
|
inline |
Definition at line 1007 of file SparseMatrix.h.
|
inline |
Definition at line 566 of file SparseMatrix.h.
|
protected |
Definition at line 1658 of file SparseMatrix.h.
|
protected |
Definition at line 1672 of file SparseMatrix.h.
|
inline |
Definition at line 509 of file SparseMatrix.h.
void Eigen::SparseMatrix< Scalar, Options_, StorageIndex_ >::insertFromSortedTriplets | ( | const InputIterators & | begin, |
const InputIterators & | end | ||
) |
The same as insertFromTriplets but triplets are assumed to be pre-sorted. This is faster and requires less temporary storage. Two triplets a
and b
are appropriately ordered if:
Definition at line 1482 of file SparseMatrix.h.
void Eigen::SparseMatrix< Scalar, Options_, StorageIndex_ >::insertFromSortedTriplets | ( | const InputIterators & | begin, |
const InputIterators & | end, | ||
DupFunctor | dup_func | ||
) |
The same as insertFromSortedTriplets but when duplicates are met the functor dup_func is applied:
Here is a C++11 example keeping the latest entry only:
Definition at line 1498 of file SparseMatrix.h.
void Eigen::SparseMatrix< Scalar, Options_, StorageIndex_ >::insertFromTriplets | ( | const InputIterators & | begin, |
const InputIterators & | end | ||
) |
Insert a batch of elements into the matrix *this
with the list of triplets defined in the half-open range from begin to end.
A triplet is a tuple (i,j,value) defining a non-zero element. The input list of triplets does not have to be sorted, and may contain duplicated elements. In any case, the result is a sorted and compressed sparse matrix where the duplicates have been summed up. This is a O(n) operation, with n the number of triplet elements. The initial contents of *this
are preserved (except for the summation of duplicate elements). The matrix *this
must be properly sized beforehand. The sizes are not extracted from the triplet list.
The InputIterators value_type must provide the following interface:
See for instance the Eigen::Triplet template class.
Here is a typical usage example:
Definition at line 1452 of file SparseMatrix.h.
void Eigen::SparseMatrix< Scalar, Options_, StorageIndex_ >::insertFromTriplets | ( | const InputIterators & | begin, |
const InputIterators & | end, | ||
DupFunctor | dup_func | ||
) |
The same as insertFromTriplets but when duplicates are met the functor dup_func is applied:
Here is a C++11 example keeping the latest entry only:
Definition at line 1468 of file SparseMatrix.h.
|
protected |
Definition at line 1634 of file SparseMatrix.h.
|
protected |
Definition at line 1699 of file SparseMatrix.h.
|
inline |
*this
is in compressed form. Definition at line 112 of file SparseCompressedBase.h.
|
inline |
|
inline |
Definition at line 61 of file SparseCompressedBase.h.
|
inline |
Definition at line 869 of file SparseMatrix.h.
EIGEN_DONT_INLINE SparseMatrix& Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::operator= | ( | const SparseMatrixBase< OtherDerived > & | other | ) |
EIGEN_DONT_INLINE SparseMatrix<Scalar,Options_,StorageIndex_>& Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::operator= | ( | const SparseMatrixBase< OtherDerived > & | other | ) |
Definition at line 1547 of file SparseMatrix.h.
|
inline |
Definition at line 894 of file SparseMatrix.h.
|
inline |
Definition at line 199 of file SparseMatrix.h.
|
inline |
Definition at line 195 of file SparseMatrix.h.
|
inline |
Definition at line 172 of file SparseMatrix.h.
|
inline |
Turns the matrix into compressed format, and suppresses all nonzeros which do not satisfy the predicate keep. The functor type KeepFunc must implement the following function:
Definition at line 648 of file SparseMatrix.h.
|
inline |
Suppresses all nonzeros which are much smaller than reference under the tolerance epsilon
Definition at line 635 of file SparseMatrix.h.
|
inline |
Definition at line 476 of file SparseMatrix.h.
|
inline |
Preallocates reserveSize[j
] non zeros for each column (resp. row) j
.
This function turns the matrix in non-compressed mode.
The type SizesType
must expose the following interface:
for i
in the [0,this->outerSize()[ range. Typical choices include std::vector<int>, Eigen::VectorXi, Eigen::VectorXi::Constant, etc.
|
inline |
Preallocates reserveSize non zeros.
Precondition: the matrix must be in compressed mode.
Definition at line 300 of file SparseMatrix.h.
|
inlineprotected |
Definition at line 332 of file SparseMatrix.h.
|
inline |
Resizes the matrix to a rows x cols matrix and initializes it to zero.
This function does not free the currently allocated memory. To release as much as memory as possible, call
after resizing it.
Definition at line 739 of file SparseMatrix.h.
|
inline |
Definition at line 758 of file SparseMatrix.h.
|
inline |
void Eigen::SparseMatrix< Scalar, Options_, StorageIndex_ >::setFromSortedTriplets | ( | const InputIterators & | begin, |
const InputIterators & | end | ||
) |
The same as setFromTriplets but triplets are assumed to be pre-sorted. This is faster and requires less temporary storage. Two triplets a
and b
are appropriately ordered if:
Definition at line 1392 of file SparseMatrix.h.
void Eigen::SparseMatrix< Scalar, Options_, StorageIndex_ >::setFromSortedTriplets | ( | const InputIterators & | begin, |
const InputIterators & | end, | ||
DupFunctor | dup_func | ||
) |
The same as setFromSortedTriplets but when duplicates are met the functor dup_func is applied:
Here is a C++11 example keeping the latest entry only:
Definition at line 1408 of file SparseMatrix.h.
void Eigen::SparseMatrix< Scalar, Options_, StorageIndex_ >::setFromTriplets | ( | const InputIterators & | begin, |
const InputIterators & | end | ||
) |
Fill the matrix *this
with the list of triplets defined in the half-open range from begin to end.
A triplet is a tuple (i,j,value) defining a non-zero element. The input list of triplets does not have to be sorted, and may contain duplicated elements. In any case, the result is a sorted and compressed sparse matrix where the duplicates have been summed up. This is a O(n) operation, with n the number of triplet elements. The initial contents of *this
are destroyed. The matrix *this
must be properly resized beforehand using the SparseMatrix(Index,Index) constructor, or the resize(Index,Index) method. The sizes are not extracted from the triplet list.
The InputIterators value_type must provide the following interface:
See for instance the Eigen::Triplet template class.
Here is a typical usage example:
Definition at line 1362 of file SparseMatrix.h.
void Eigen::SparseMatrix< Scalar, Options_, StorageIndex_ >::setFromTriplets | ( | const InputIterators & | begin, |
const InputIterators & | end, | ||
DupFunctor | dup_func | ||
) |
The same as setFromTriplets but when duplicates are met the functor dup_func is applied:
Here is a C++11 example keeping the latest entry only:
Definition at line 1378 of file SparseMatrix.h.
|
inline |
Sets *this to the identity matrix. This function also turns the matrix into compressed mode, and drop any reserved memory.
Definition at line 856 of file SparseMatrix.h.
|
inline |
Removes all non zeros but keep allocated memory
This function does not free the currently allocated memory. To release as much as memory as possible, call
after resizing it.
Definition at line 288 of file SparseMatrix.h.
|
inline |
Definition at line 447 of file SparseMatrix.h.
internal::traits< SparseMatrix< Scalar_, Options_, Index_ > >::Scalar Eigen::SparseMatrix< Scalar_, Options_, Index_ >::sum |
Overloaded for performance
Definition at line 32 of file SparseRedux.h.
|
inline |
Swaps the content of two sparse matrices of the same type. This is a fast operation that simply swaps the underlying pointers and parameters.
Definition at line 844 of file SparseMatrix.h.
|
inline |
Turns the matrix into the uncompressed mode
Definition at line 624 of file SparseMatrix.h.
|
inline |
Definition at line 181 of file SparseMatrix.h.
|
inline |
Definition at line 177 of file SparseMatrix.h.
|
protected |
Definition at line 160 of file SparseMatrix.h.
|
protected |
Definition at line 159 of file SparseMatrix.h.
|
protected |
Definition at line 157 of file SparseMatrix.h.
|
protected |
Definition at line 158 of file SparseMatrix.h.
|
protected |
Definition at line 156 of file SparseMatrix.h.