a sparse vector class More...
Public Types | |
enum | { IsColVector } |
enum | { Options } |
typedef internal::CompressedStorage< Scalar, StorageIndex > | Storage |
Public Types inherited from Eigen::SparseCompressedBase< SparseVector< Scalar_, Options_, StorageIndex_ > > | |
typedef SparseMatrixBase< SparseVector< Scalar_, Options_, StorageIndex_ > > | Base |
Public Types inherited from Eigen::SparseMatrixBase< SparseVector< Scalar_, Options_, StorageIndex_ > > | |
enum | |
typedef std::conditional_t< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, Eigen::Transpose< const SparseVector< Scalar_, Options_, StorageIndex_ > > >, Transpose< const SparseVector< Scalar_, Options_, StorageIndex_ > > > | AdjointReturnType |
typedef Transpose< const SparseVector< 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< SparseVector< Scalar_, Options_, StorageIndex_ > >::Scalar | Scalar |
typedef Matrix< Scalar, Dynamic, 1 > | ScalarVector |
typedef SparseMatrixBase | StorageBaseType |
typedef internal::traits< SparseVector< Scalar_, Options_, StorageIndex_ > >::StorageIndex | StorageIndex |
typedef internal::traits< SparseVector< Scalar_, Options_, StorageIndex_ > >::StorageKind | StorageKind |
typedef Transpose< SparseVector< Scalar_, Options_, StorageIndex_ > > | TransposeReturnType |
typedef Scalar | value_type |
Public Types inherited from Eigen::EigenBase< SparseVector< Scalar_, Options_, StorageIndex_ > > | |
typedef Eigen::Index | Index |
The interface type of indices. More... | |
typedef internal::traits< SparseVector< Scalar_, Options_, StorageIndex_ > >::StorageKind | StorageKind |
Public Member Functions | |
EIGEN_DEPRECATED Storage & | _data () |
EIGEN_DEPRECATED const Storage & | _data () const |
Scalar | coeff (Index i) const |
Scalar | coeff (Index row, Index col) const |
Scalar & | coeffRef (Index i) |
Scalar & | coeffRef (Index row, Index col) |
Index | cols () const |
void | conservativeResize (Index newSize) |
Storage & | data () |
const Storage & | data () const |
EIGEN_DEPRECATED void | endFill () |
EIGEN_DEPRECATED Scalar & | fill (Index i) |
EIGEN_DEPRECATED Scalar & | fill (Index r, Index c) |
EIGEN_DEPRECATED Scalar & | fillrand (Index i) |
EIGEN_DEPRECATED Scalar & | fillrand (Index r, Index c) |
void | finalize () |
StorageIndex * | innerIndexPtr () |
const StorageIndex * | innerIndexPtr () const |
StorageIndex * | innerNonZeroPtr () |
const StorageIndex * | innerNonZeroPtr () const |
Index | innerSize () const |
Scalar & | insert (Index i) |
Scalar & | insert (Index row, Index col) |
Scalar & | insertBack (Index i) |
Scalar & | insertBackByOuterInner (Index outer, Index inner) |
Scalar & | insertBackByOuterInnerUnordered (Index outer, Index inner) |
Scalar & | insertBackUnordered (Index i) |
Index | nonZeros () const |
template<typename OtherDerived > | |
SparseVector & | operator= (const SparseMatrixBase< OtherDerived > &other) |
SparseVector & | operator= (const SparseVector &other) |
StorageIndex * | outerIndexPtr () |
const StorageIndex * | outerIndexPtr () const |
Index | outerSize () const |
Index | prune (const Scalar &reference, const RealScalar &epsilon=NumTraits< RealScalar >::dummy_precision()) |
template<class F > | |
Index | prune (F &&keep_predicate) |
Prunes the entries of the vector based on a predicate More... | |
void | reserve (Index reserveSize) |
void | resize (Index newSize) |
void | resize (Index rows, Index cols) |
void | resizeNonZeros (Index size) |
Index | rows () const |
void | setZero () |
SparseVector () | |
template<typename OtherDerived > | |
SparseVector (const SparseMatrixBase< OtherDerived > &other) | |
SparseVector (const SparseVector &other) | |
SparseVector (Index rows, Index cols) | |
SparseVector (Index size) | |
EIGEN_DEPRECATED void | startFill (Index reserve) |
void | startVec (Index outer) |
Scalar | sum () const |
template<int OtherOptions> | |
void | swap (SparseMatrix< Scalar, OtherOptions, StorageIndex > &other) |
void | swap (SparseVector &other) |
Scalar * | valuePtr () |
const Scalar * | valuePtr () const |
~SparseVector () | |
Public Member Functions inherited from Eigen::SparseCompressedBase< SparseVector< 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 |
SparseVector< Scalar_, Options_, StorageIndex_ > & | operator= (const EigenBase< OtherDerived > &other) |
SparseVector< Scalar_, Options_, StorageIndex_ > & | operator= (const ReturnByValue< OtherDerived > &other) |
SparseVector< Scalar_, Options_, StorageIndex_ > & | operator= (const SparseMatrixBase< OtherDerived > &other) |
SparseVector< Scalar_, Options_, StorageIndex_ > & | operator= (const SparseVector< Scalar_, Options_, StorageIndex_ > &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< SparseVector< Scalar_, Options_, StorageIndex_ > > | |
const AdjointReturnType | adjoint () const |
RealScalar | blueNorm () const |
Index | cols () const |
const SparseMatrixBase< SparseVector< 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< SparseVector< Scalar_, Options_, StorageIndex_ > >::Scalar | dot (const MatrixBase< OtherDerived > &other) const |
Scalar | dot (const MatrixBase< OtherDerived > &other) const |
internal::traits< SparseVector< Scalar_, Options_, StorageIndex_ > >::Scalar | dot (const SparseMatrixBase< OtherDerived > &other) const |
Scalar | dot (const SparseMatrixBase< OtherDerived > &other) const |
const internal::eval< SparseVector< 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 |
SparseVector< Scalar_, Options_, StorageIndex_ > & | markAsRValue () |
RealScalar | norm () const |
const Product< SparseVector< Scalar_, Options_, StorageIndex_ >, OtherDerived > | operator* (const DiagonalBase< OtherDerived > &other) const |
const Product< SparseVector< Scalar_, Options_, StorageIndex_ >, OtherDerived > | operator* (const MatrixBase< OtherDerived > &other) const |
const Product< SparseVector< Scalar_, Options_, StorageIndex_ >, OtherDerived, AliasFreeProduct > | operator* (const SparseMatrixBase< OtherDerived > &other) const |
SparseVector< Scalar_, Options_, StorageIndex_ > & | operator*= (const Scalar &other) |
SparseVector< Scalar_, Options_, StorageIndex_ > & | operator*= (const SparseMatrixBase< OtherDerived > &other) |
SparseVector< Scalar_, Options_, StorageIndex_ > & | operator+= (const DiagonalBase< OtherDerived > &other) |
SparseVector< Scalar_, Options_, StorageIndex_ > & | operator+= (const EigenBase< OtherDerived > &other) |
SparseVector< Scalar_, Options_, StorageIndex_ > & | operator+= (const SparseMatrixBase< OtherDerived > &other) |
SparseVector< Scalar_, Options_, StorageIndex_ > & | operator-= (const DiagonalBase< OtherDerived > &other) |
SparseVector< Scalar_, Options_, StorageIndex_ > & | operator-= (const EigenBase< OtherDerived > &other) |
SparseVector< Scalar_, Options_, StorageIndex_ > & | operator-= (const SparseMatrixBase< OtherDerived > &other) |
SparseVector< Scalar_, Options_, StorageIndex_ > & | operator/= (const Scalar &other) |
SparseVector< Scalar_, Options_, StorageIndex_ > & | operator= (const EigenBase< OtherDerived > &other) |
SparseVector< Scalar_, Options_, StorageIndex_ > & | operator= (const ReturnByValue< OtherDerived > &other) |
SparseVector< Scalar_, Options_, StorageIndex_ > & | operator= (const SparseMatrixBase< OtherDerived > &other) |
SparseVector< Scalar_, Options_, StorageIndex_ > & | operator= (const SparseVector< Scalar_, Options_, StorageIndex_ > &other) |
Index | outerSize () const |
const SparseView< SparseVector< 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< SparseVector< Scalar_, Options_, StorageIndex_ > >::template SelfAdjointViewReturnType< UpLo >::Type | selfadjointView () |
ConstSelfAdjointViewReturnType< UpLo >::Type | selfadjointView () const |
SparseMatrixBase< SparseVector< 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 SparseVector< Scalar_, Options_, StorageIndex_ >, Mode > | triangularView () const |
SparseSymmetricPermutationProduct< SparseVector< Scalar_, Options_, StorageIndex_ >, Upper|Lower > | twistedBy (const PermutationMatrix< Dynamic, Dynamic, StorageIndex > &perm) const |
Public Member Functions inherited from Eigen::EigenBase< SparseVector< 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 |
SparseVector< Scalar_, Options_, StorageIndex_ > & | const_cast_derived () const |
const SparseVector< Scalar_, Options_, StorageIndex_ > & | const_derived () const |
SparseVector< Scalar_, Options_, StorageIndex_ > & | derived () |
const SparseVector< 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 Member Functions | |
EIGEN_STATIC_ASSERT ((Options_ &(ColMajor|RowMajor))==Options, INVALID_MATRIX_TEMPLATE_PARAMETERS) Storage m_data | |
Protected Member Functions inherited from Eigen::SparseCompressedBase< SparseVector< Scalar_, Options_, StorageIndex_ > > | |
Eigen::Map< IndexVector > | innerNonZeros () |
const Eigen::Map< const IndexVector > | innerNonZeros () const |
internal::LowerBoundIndex | lower_bound (Index row, Index col) const |
SparseCompressedBase () | |
Protected Member Functions inherited from Eigen::SparseMatrixBase< SparseVector< Scalar_, Options_, StorageIndex_ > > | |
SparseVector< Scalar_, Options_, StorageIndex_ > & | assign (const OtherDerived &other) |
void | assignGeneric (const OtherDerived &other) |
Protected Attributes | |
Index | m_size |
Protected Attributes inherited from Eigen::SparseMatrixBase< SparseVector< Scalar_, Options_, StorageIndex_ > > | |
bool | m_isRValue |
Private Types | |
typedef SparseCompressedBase< SparseVector > | Base |
Additional Inherited Members | |
Protected Types inherited from Eigen::SparseCompressedBase< SparseVector< Scalar_, Options_, StorageIndex_ > > | |
typedef Base::IndexVector | IndexVector |
Static Protected Member Functions inherited from Eigen::SparseMatrixBase< SparseVector< Scalar_, Options_, StorageIndex_ > > | |
static StorageIndex | convert_index (const Index idx) |
a sparse vector class
Scalar_ | the scalar type, i.e. the type of the coefficients |
See http://www.netlib.org/linalg/html_templates/node91.html for details on the storage scheme.
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_SPARSEVECTOR_PLUGIN
.
Definition at line 66 of file SparseVector.h.
|
private |
Definition at line 69 of file SparseVector.h.
typedef internal::CompressedStorage<Scalar,StorageIndex> Eigen::SparseVector< Scalar_, Options_, StorageIndex_ >::Storage |
Definition at line 76 of file SparseVector.h.
anonymous enum |
anonymous enum |
Enumerator | |
---|---|
Options |
Definition at line 79 of file SparseVector.h.
|
inline |
Definition at line 285 of file SparseVector.h.
|
inlineexplicit |
Definition at line 287 of file SparseVector.h.
|
inline |
Definition at line 289 of file SparseVector.h.
|
inline |
Definition at line 292 of file SparseVector.h.
|
inline |
Definition at line 301 of file SparseVector.h.
|
inline |
|
inline |
Definition at line 413 of file SparseVector.h.
|
inline |
Definition at line 415 of file SparseVector.h.
|
inline |
Definition at line 109 of file SparseVector.h.
|
inline |
Definition at line 104 of file SparseVector.h.
|
inline |
This insertion might be very costly if the number of nonzeros above i is large.
Definition at line 127 of file SparseVector.h.
|
inline |
Definition at line 115 of file SparseVector.h.
|
inline |
Definition at line 84 of file SparseVector.h.
|
inline |
Resizes the sparse vector to newSize, while leaving old values untouched.
If the size of the vector is decreased, then the storage of the out-of bounds coefficients is kept and reserved. Call .data().squeeze() to free extra memory.
Definition at line 272 of file SparseVector.h.
|
inline |
Definition at line 100 of file SparseVector.h.
|
inline |
Definition at line 102 of file SparseVector.h.
|
protected |
|
inline |
Definition at line 409 of file SparseVector.h.
|
inline |
Definition at line 389 of file SparseVector.h.
|
inline |
Definition at line 382 of file SparseVector.h.
|
inline |
Definition at line 403 of file SparseVector.h.
|
inline |
Definition at line 396 of file SparseVector.h.
|
inline |
Definition at line 209 of file SparseVector.h.
|
inline |
Definition at line 92 of file SparseVector.h.
|
inline |
Definition at line 91 of file SparseVector.h.
|
inline |
Definition at line 97 of file SparseVector.h.
|
inline |
Definition at line 96 of file SparseVector.h.
|
inline |
Definition at line 85 of file SparseVector.h.
|
inline |
Definition at line 184 of file SparseVector.h.
|
inline |
Definition at line 174 of file SparseVector.h.
|
inline |
Definition at line 156 of file SparseVector.h.
|
inline |
Definition at line 150 of file SparseVector.h.
|
inline |
Definition at line 162 of file SparseVector.h.
|
inline |
Definition at line 168 of file SparseVector.h.
|
inline |
Definition at line 142 of file SparseVector.h.
|
inline |
Definition at line 340 of file SparseVector.h.
|
inline |
Definition at line 325 of file SparseVector.h.
|
inline |
Definition at line 95 of file SparseVector.h.
|
inline |
Definition at line 94 of file SparseVector.h.
|
inline |
Definition at line 86 of file SparseVector.h.
|
inline |
Suppresses all nonzeros which are much smaller than reference under the tolerance epsilon
Definition at line 212 of file SparseVector.h.
|
inline |
Prunes the entries of the vector based on a predicate
F | Type of the predicate. |
keep_predicate | The predicate that is used to test whether a value should be kept. A callable that gets passed om a Scalar value and returns a boolean. If the predicate returns true, the value is kept. |
Definition at line 224 of file SparseVector.h.
|
inline |
Definition at line 206 of file SparseVector.h.
|
inline |
Resizes the sparse vector to newSize This method deletes all entries, thus leaving an empty sparse vector
Definition at line 259 of file SparseVector.h.
|
inline |
Resizes the sparse vector to rows x cols
This method is provided for compatibility with matrices. For a column vector, cols must be equal to 1. For a row vector, rows must be equal to 1.
Definition at line 249 of file SparseVector.h.
|
inline |
Definition at line 283 of file SparseVector.h.
|
inline |
Definition at line 83 of file SparseVector.h.
|
inline |
Definition at line 139 of file SparseVector.h.
|
inline |
Definition at line 375 of file SparseVector.h.
|
inline |
Definition at line 144 of file SparseVector.h.
internal::traits< SparseVector< Scalar_, Options_, Index_ > >::Scalar Eigen::SparseVector< Scalar_, Options_, Index_ >::sum |
Overloaded for performance
Definition at line 43 of file SparseRedux.h.
|
inline |
Definition at line 318 of file SparseVector.h.
|
inline |
Swaps the values of *this
and other. Overloaded for performance: this version performs a shallow swap by swapping pointers and attributes only.
Definition at line 311 of file SparseVector.h.
|
inline |
Definition at line 89 of file SparseVector.h.
|
inline |
Definition at line 88 of file SparseVector.h.
|
protected |
Definition at line 426 of file SparseVector.h.