#include <Eigen/src/SparseCore/SparseVector.h>
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.
Inheritance diagram for Eigen::SparseVector< Scalar_, Options_, StorageIndex_ >:Public Member Functions | |
| Scalar & | coeffRef (Index i) |
| void | conservativeResize (Index newSize) |
| Index | nonZeros () 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 | |
| void | resize (Index newSize) |
| void | resize (Index rows, Index cols) |
| Scalar | sum () const |
| void | swap (SparseVector &other) |
| ~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 |
| 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< 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 > | |
| constexpr Index | cols () const noexcept |
| constexpr Derived & | derived () |
| constexpr const Derived & | derived () const |
| constexpr Index | rows () const noexcept |
| constexpr Index | size () const noexcept |
Additional Inherited Members | |
Public Types inherited from Eigen::SparseMatrixBase< Derived > | |
| enum | { RowsAtCompileTime , ColsAtCompileTime , SizeAtCompileTime , MaxRowsAtCompileTime , MaxColsAtCompileTime , MaxSizeAtCompileTime , IsVectorAtCompileTime , NumDimensions , Flags , IsRowMajor , InnerSizeAtCompileTime } |
| typedef NumTraits< Scalar >::Real | RealScalar |
| 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. | |
Protected Member Functions inherited from Eigen::SparseCompressedBase< SparseVector< Scalar_, Options_, StorageIndex_ > > | |
| SparseCompressedBase () | |
|
inline |
Destructor
|
inline |
This insertion might be very costly if the number of nonzeros above i is large.
|
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.
|
inline |
|
inline |
Suppresses all nonzeros which are much smaller than reference under the tolerance epsilon
|
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. |
|
inline |
Resizes the sparse vector to newSize This method deletes all entries, thus leaving an empty sparse vector
|
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.
| internal::traits< SparseVector< Scalar_, Options_, Index_ > >::Scalar Eigen::SparseVector< Scalar_, Options_, Index_ >::sum | ( | ) | const |
Overloaded for performance
|
inline |
Swaps the values of *this and other. Overloaded for performance: this version performs a shallow swap by swapping pointers and attributes only.