Eigen::Map< SparseMatrixType > Class Template Reference

Specialization of class Map for SparseMatrix-like storage. More...

+ Inheritance diagram for Eigen::Map< SparseMatrixType >:

Public Types

enum  { IsRowMajor }
 
typedef SparseMapBase< MapBase
 
- Public Types inherited from Eigen::SparseMapBase< Derived, WriteAccessors >
enum  { IsRowMajor }
 
typedef SparseMapBase< Derived, ReadOnlyAccessorsBase
 
typedef Base::Scalar Scalar
 
typedef Base::StorageIndex StorageIndex
 
- Public Types inherited from Eigen::SparseMapBase< Derived, ReadOnlyAccessors >
enum  { IsRowMajor }
 
typedef SparseCompressedBase< Derived > Base
 
typedef Base::Scalar Scalar
 
typedef Base::StorageIndex StorageIndex
 
- Public Types inherited from Eigen::SparseCompressedBase< Derived >
typedef SparseMatrixBase< Derived > Base
 
- Public Types inherited from Eigen::SparseMatrixBase< Derived >
enum  {
  RowsAtCompileTime ,
  ColsAtCompileTime ,
  SizeAtCompileTime ,
  MaxRowsAtCompileTime ,
  MaxColsAtCompileTime ,
  MaxSizeAtCompileTime ,
  IsVectorAtCompileTime ,
  NumDimensions ,
  Flags ,
  IsRowMajor ,
  InnerSizeAtCompileTime
}
 
typedef std::conditional_t< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, Eigen::Transpose< const Derived > >, Transpose< const Derived > > AdjointReturnType
 
typedef Transpose< const Derived > 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, StorageIndexPlainObject
 
typedef internal::traits< Derived >::Scalar Scalar
 
typedef Matrix< Scalar, Dynamic, 1 > ScalarVector
 
typedef SparseMatrixBase StorageBaseType
 
typedef internal::traits< Derived >::StorageIndex StorageIndex
 
typedef internal::traits< Derived >::StorageKind StorageKind
 
typedef Transpose< Derived > TransposeReturnType
 
typedef Scalar value_type
 
- Public Types inherited from Eigen::EigenBase< Derived >
typedef Eigen::Index Index
 The interface type of indices. More...
 
typedef internal::traits< Derived >::StorageKind StorageKind
 

Public Member Functions

 Map (Index rows, Index cols, Index nnz, const StorageIndex *outerIndexPtr, const StorageIndex *innerIndexPtr, const Scalar *valuePtr, const StorageIndex *innerNonZerosPtr=0)
 
 Map (Index rows, Index cols, Index nnz, StorageIndex *outerIndexPtr, StorageIndex *innerIndexPtr, Scalar *valuePtr, StorageIndex *innerNonZerosPtr=0)
 
 ~Map ()
 
- Public Member Functions inherited from Eigen::SparseMapBase< Derived, WriteAccessors >
ScalarcoeffRef (Index row, Index col)
 
StorageIndexinnerIndexPtr ()
 
StorageIndexinnerNonZeroPtr ()
 
Derived & operator= (const Derived &other)
 
template<typename OtherDerived >
Derived & operator= (const EigenBase< OtherDerived > &other)
 
template<typename OtherDerived >
Derived & operator= (const ReturnByValue< OtherDerived > &other)
 
template<typename OtherDerived >
Derived & operator= (const SparseMatrixBase< OtherDerived > &other)
 
StorageIndexouterIndexPtr ()
 
 SparseMapBase (Index rows, Index cols, Index nnz, StorageIndex *outerIndexPtr, StorageIndex *innerIndexPtr, Scalar *valuePtr, StorageIndex *innerNonZerosPtr=0)
 
 SparseMapBase (Index size, Index nnz, StorageIndex *innerIndexPtr, Scalar *valuePtr)
 
ScalarvaluePtr ()
 
 ~SparseMapBase ()
 
- Public Member Functions inherited from Eigen::SparseMapBase< Derived, ReadOnlyAccessors >
Scalar coeff (Index row, Index col) const
 
Index cols () const
 
const StorageIndexinnerIndexPtr () const
 
const StorageIndexinnerNonZeroPtr () const
 
Index innerSize () const
 
bool isCompressed () const
 
Index nonZeros () const
 
Derived & operator= (const Derived &other)
 
template<typename OtherDerived >
Derived & operator= (const EigenBase< OtherDerived > &other)
 
template<typename OtherDerived >
Derived & operator= (const ReturnByValue< OtherDerived > &other)
 
template<typename OtherDerived >
Derived & operator= (const SparseMatrixBase< OtherDerived > &other)
 
const StorageIndexouterIndexPtr () const
 
Index outerSize () const
 
Index rows () const
 
 SparseMapBase (Index rows, Index cols, Index nnz, IndexPointer outerIndexPtr, IndexPointer innerIndexPtr, ScalarPointer valuePtr, IndexPointer innerNonZerosPtr=0)
 
 SparseMapBase (Index size, Index nnz, IndexPointer innerIndexPtr, ScalarPointer valuePtr)
 
const ScalarvaluePtr () const
 
 ~SparseMapBase ()
 
- Public Member Functions inherited from Eigen::SparseCompressedBase< Derived >
Map< Array< Scalar, Dynamic, 1 > > coeffs ()
 
const Map< const Array< Scalar, Dynamic, 1 > > coeffs () const
 
StorageIndexinnerIndexPtr ()
 
const StorageIndexinnerIndexPtr () const
 
template<class Comp = std::less<>>
Index innerIndicesAreSorted () const
 
template<class Comp = std::less<>>
Index innerIndicesAreSorted (Index begin, Index end) const
 
StorageIndexinnerNonZeroPtr ()
 
const StorageIndexinnerNonZeroPtr () const
 
bool isCompressed () const
 
Index nonZeros () const
 
Derived & operator= (const Derived &other)
 
template<typename OtherDerived >
Derived & operator= (const EigenBase< OtherDerived > &other)
 
template<typename OtherDerived >
Derived & operator= (const ReturnByValue< OtherDerived > &other)
 
template<typename OtherDerived >
Derived & operator= (const SparseMatrixBase< OtherDerived > &other)
 
StorageIndexouterIndexPtr ()
 
const StorageIndexouterIndexPtr () const
 
template<class Comp = std::less<>>
void sortInnerIndices ()
 
template<class Comp = std::less<>>
void sortInnerIndices (Index begin, Index end)
 
ScalarvaluePtr ()
 
const ScalarvaluePtr () const
 
- Public Member Functions inherited from Eigen::SparseMatrixBase< Derived >
const AdjointReturnType adjoint () const
 
RealScalar blueNorm () const
 
Index cols () const
 
template<typename OtherDerived >
const SparseMatrixBase< Derived >::template CwiseProductDenseReturnType< OtherDerived >::Type cwiseProduct (const MatrixBase< OtherDerived > &other) const
 
template<typename OtherDerived >
const CwiseProductDenseReturnType< OtherDerived >::Type cwiseProduct (const MatrixBase< OtherDerived > &other) const
 
template<typename OtherDerived >
internal::traits< Derived >::Scalar dot (const MatrixBase< OtherDerived > &other) const
 
template<typename OtherDerived >
Scalar dot (const MatrixBase< OtherDerived > &other) const
 
template<typename OtherDerived >
internal::traits< Derived >::Scalar dot (const SparseMatrixBase< OtherDerived > &other) const
 
template<typename OtherDerived >
Scalar dot (const SparseMatrixBase< OtherDerived > &other) const
 
const internal::eval< Derived >::type eval () const
 
Index innerSize () const
 
template<typename OtherDerived >
bool isApprox (const MatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
template<typename OtherDerived >
bool isApprox (const SparseMatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
bool isRValue () const
 
bool isVector () const
 
Derived & markAsRValue ()
 
RealScalar norm () const
 
template<typename OtherDerived >
const Product< Derived, OtherDerived > operator* (const DiagonalBase< OtherDerived > &other) const
 
template<typename OtherDerived >
const Product< Derived, OtherDerived > operator* (const MatrixBase< OtherDerived > &other) const
 
template<typename OtherDerived >
const Product< Derived, OtherDerived, AliasFreeProductoperator* (const SparseMatrixBase< OtherDerived > &other) const
 
Derived & operator*= (const Scalar &other)
 
template<typename OtherDerived >
Derived & operator*= (const SparseMatrixBase< OtherDerived > &other)
 
template<typename OtherDerived >
Derived & operator+= (const DiagonalBase< OtherDerived > &other)
 
template<typename OtherDerived >
Derived & operator+= (const EigenBase< OtherDerived > &other)
 
template<typename OtherDerived >
Derived & operator+= (const SparseMatrixBase< OtherDerived > &other)
 
template<typename OtherDerived >
Derived & operator-= (const DiagonalBase< OtherDerived > &other)
 
template<typename OtherDerived >
Derived & operator-= (const EigenBase< OtherDerived > &other)
 
template<typename OtherDerived >
Derived & operator-= (const SparseMatrixBase< OtherDerived > &other)
 
Derived & operator/= (const Scalar &other)
 
Derived & operator= (const Derived &other)
 
template<typename OtherDerived >
Derived & operator= (const EigenBase< OtherDerived > &other)
 
template<typename OtherDerived >
Derived & operator= (const ReturnByValue< OtherDerived > &other)
 
template<typename OtherDerived >
Derived & operator= (const SparseMatrixBase< OtherDerived > &other)
 
Index outerSize () const
 
const SparseView< Derived > pruned (const Scalar &reference=Scalar(0), const RealScalar &epsilon=NumTraits< Scalar >::dummy_precision()) const
 
Index rows () const
 
template<unsigned int UpLo>
SelfAdjointViewReturnType< UpLo >::Type selfadjointView ()
 
template<unsigned int UpLo>
SparseMatrixBase< Derived >::template SelfAdjointViewReturnType< UpLo >::Type selfadjointView ()
 
template<unsigned int UpLo>
ConstSelfAdjointViewReturnType< UpLo >::Type selfadjointView () const
 
template<unsigned int UpLo>
SparseMatrixBase< Derived >::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
 
template<int Mode>
const TriangularView< const Derived, Mode > triangularView () const
 
SparseSymmetricPermutationProduct< Derived, Upper|LowertwistedBy (const PermutationMatrix< Dynamic, Dynamic, StorageIndex > &perm) const
 
- Public Member Functions inherited from Eigen::EigenBase< Derived >
template<typename Dest >
void addTo (Dest &dst) const
 
template<typename Dest >
void applyThisOnTheLeft (Dest &dst) const
 
template<typename Dest >
void applyThisOnTheRight (Dest &dst) const
 
EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 
Derived & const_cast_derived () const
 
const Derived & const_derived () const
 
Derived & derived ()
 
const Derived & derived () const
 
template<typename Dest >
void evalTo (Dest &dst) const
 
EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 
EIGEN_CONSTEXPR Index size () const EIGEN_NOEXCEPT
 
template<typename Dest >
void subTo (Dest &dst) const
 

Additional Inherited Members

- Protected Types inherited from Eigen::SparseMapBase< Derived, ReadOnlyAccessors >
typedef std::conditional_t< bool(internal::is_lvalue< Derived >::value), StorageIndex *, const StorageIndex * > IndexPointer
 
typedef std::conditional_t< bool(internal::is_lvalue< Derived >::value), Scalar *, const Scalar * > ScalarPointer
 
- Protected Types inherited from Eigen::SparseCompressedBase< Derived >
typedef Base::IndexVector IndexVector
 
- Protected Member Functions inherited from Eigen::SparseMapBase< Derived, WriteAccessors >
 SparseMapBase ()
 
- Protected Member Functions inherited from Eigen::SparseMapBase< Derived, ReadOnlyAccessors >
 SparseMapBase ()
 
- Protected Member Functions inherited from Eigen::SparseCompressedBase< Derived >
Eigen::Map< IndexVectorinnerNonZeros ()
 
const Eigen::Map< const IndexVectorinnerNonZeros () const
 
internal::LowerBoundIndex lower_bound (Index row, Index col) const
 
 SparseCompressedBase ()
 
- Protected Member Functions inherited from Eigen::SparseMatrixBase< Derived >
template<typename OtherDerived >
Derived & assign (const OtherDerived &other)
 
template<typename OtherDerived >
void assignGeneric (const OtherDerived &other)
 
- Static Protected Member Functions inherited from Eigen::SparseMatrixBase< Derived >
static StorageIndex convert_index (const Index idx)
 
- Protected Attributes inherited from Eigen::SparseMapBase< Derived, ReadOnlyAccessors >
IndexPointer m_innerIndices
 
IndexPointer m_innerNonZeros
 
Index m_innerSize
 
IndexPointer m_outerIndex
 
Index m_outerSize
 
ScalarPointer m_values
 
Array< StorageIndex, 2, 1 > m_zero_nnz
 
- Protected Attributes inherited from Eigen::SparseMatrixBase< Derived >
bool m_isRValue
 

Detailed Description

template<typename SparseMatrixType>
class Eigen::Map< SparseMatrixType >

Specialization of class Map for SparseMatrix-like storage.

Template Parameters
SparseMatrixTypethe equivalent sparse matrix type of the referenced data, it must be a template instance of class SparseMatrix.
See also
class Map, class SparseMatrix, class Ref<SparseMatrixType,Options>

Definition at line 228 of file SparseMap.h.

Member Typedef Documentation

◆ Base

template<typename SparseMatrixType >
typedef SparseMapBase<Map> Eigen::Map< SparseMatrixType >::Base

Definition at line 233 of file SparseMap.h.

Member Enumeration Documentation

◆ anonymous enum

template<typename SparseMatrixType >
anonymous enum
Enumerator
IsRowMajor 

Definition at line 235 of file SparseMap.h.

235 { IsRowMajor = Base::IsRowMajor };

Constructor & Destructor Documentation

◆ Map() [1/2]

template<typename SparseMatrixType >
Eigen::Map< SparseMatrixType >::Map ( Index  rows,
Index  cols,
Index  nnz,
StorageIndex outerIndexPtr,
StorageIndex innerIndexPtr,
Scalar valuePtr,
StorageIndex innerNonZerosPtr = 0 
)
inline

Constructs a read-write Map to a sparse matrix of size rows x cols, containing nnz non-zero coefficients, stored as a sparse format as defined by the pointers outerIndexPtr, innerIndexPtr, and valuePtr. If the optional parameter innerNonZerosPtr is the null pointer, then a standard compressed format is assumed. The inner indices must be sorted appropriately.

This constructor is available only if SparseMatrixType is non-const.

More details on the expected storage schemes are given in the manual pages.

Definition at line 248 of file SparseMap.h.

◆ Map() [2/2]

template<typename SparseMatrixType >
Eigen::Map< SparseMatrixType >::Map ( Index  rows,
Index  cols,
Index  nnz,
const StorageIndex outerIndexPtr,
const StorageIndex innerIndexPtr,
const Scalar valuePtr,
const StorageIndex innerNonZerosPtr = 0 
)
inline

This is the const version of the above constructor.

This constructor is available only if SparseMatrixType is const, e.g.:

Map<const SparseMatrix<double> >

Definition at line 273 of file SparseMap.h.

275  : Base(rows, cols, nnz, outerIndexPtr, innerIndexPtr, valuePtr, innerNonZerosPtr)
276  {}

◆ ~Map()

template<typename SparseMatrixType >
Eigen::Map< SparseMatrixType >::~Map ( )
inline

Empty destructor

Definition at line 279 of file SparseMap.h.

279 {}

The documentation for this class was generated from the following file: