a sparse vector class More...
Public Types | |
enum | { IsColVector } |
typedef SparseMatrixBase < SparseVector > | SparseBase |
![]() | |
enum | { RowsAtCompileTime, ColsAtCompileTime, SizeAtCompileTime, MaxRowsAtCompileTime, MaxColsAtCompileTime, MaxSizeAtCompileTime, IsVectorAtCompileTime, Flags, CoeffReadCost, IsRowMajor } |
typedef SparseTranspose < typename ei_cleantype < ConjugateReturnType >::type > | AdjointReturnType |
typedef ei_meta_if< NumTraits < Scalar >::IsComplex, const SparseCwiseUnaryOp < ei_scalar_conjugate_op < Scalar >, Derived >, const Derived & >::ret | ConjugateReturnType |
typedef CwiseUnaryOp < ei_scalar_imag_op< Scalar > , Derived > | ImagReturnType |
typedef CwiseUnaryOp < ei_scalar_real_op< Scalar > , Derived > | RealReturnType |
typedef ei_traits< Derived > ::Scalar | Scalar |
Public Member Functions | |
CompressedStorage< Scalar > & | _data () |
CompressedStorage< Scalar > & | _data () const |
const int * | _innerIndexPtr () const |
int * | _innerIndexPtr () |
const Scalar * | _valuePtr () const |
Scalar * | _valuePtr () |
Scalar | coeff (int row, int col) const |
Scalar | coeff (int i) const |
Scalar & | coeffRef (int row, int col) |
Scalar & | coeffRef (int i) |
int | cols () const |
void | endFill () |
Scalar & | fill (int r, int c) |
Scalar & | fill (int i) |
Scalar & | fillrand (int r, int c) |
Scalar & | fillrand (int i) |
int | innerNonZeros (int j) const |
int | innerSize () const |
int | nonZeros () const |
SparseVector & | operator= (const SparseVector &other) |
template<typename OtherDerived > | |
SparseVector & | operator= (const SparseMatrixBase< OtherDerived > &other) |
int | outerSize () const |
void | prune (Scalar reference, RealScalar epsilon=precision< RealScalar >()) |
void | reserve (int reserveSize) |
void | resize (int rows, int cols) |
void | resize (int newSize) |
void | resizeNonZeros (int size) |
int | rows () const |
void | setZero () |
SparseVector (int size) | |
SparseVector (int rows, int cols) | |
template<typename OtherDerived > | |
SparseVector (const MatrixBase< OtherDerived > &other) | |
template<typename OtherDerived > | |
SparseVector (const SparseMatrixBase< OtherDerived > &other) | |
SparseVector (const SparseVector &other) | |
void | startFill (int reserve) |
void | swap (SparseVector &other) |
~SparseVector () | |
![]() | |
const AdjointReturnType | adjoint () const |
template<typename OtherDerived > | |
void | assignGeneric (const OtherDerived &other) |
template<typename NewType > | |
const SparseCwiseUnaryOp < ei_scalar_cast_op< typename ei_traits< Derived >::Scalar, NewType >, Derived > | cast () const |
SparseInnerVectorSet< Derived, 1 > | col (int j) |
const SparseInnerVectorSet < Derived, 1 > | col (int j) const |
int | cols () const |
ConjugateReturnType | conjugate () const |
const SparseCwise< Derived > | cwise () const |
SparseCwise< Derived > | cwise () |
template<typename OtherDerived > | |
ei_traits< Derived >::Scalar | dot (const MatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
ei_traits< Derived >::Scalar | dot (const SparseMatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
Scalar | dot (const MatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
Scalar | dot (const SparseMatrixBase< OtherDerived > &other) const |
const ei_eval< Derived >::type | eval () const |
const ImagReturnType | imag () const |
int | innerSize () const |
SparseInnerVectorSet< Derived, 1 > | innerVector (int outer) |
const SparseInnerVectorSet < Derived, 1 > | innerVector (int outer) const |
SparseInnerVectorSet< Derived, Dynamic > | innerVectors (int outerStart, int outerSize) |
const SparseInnerVectorSet < Derived, Dynamic > | innerVectors (int outerStart, int outerSize) const |
template<typename OtherDerived > | |
bool | isApprox (const SparseMatrixBase< OtherDerived > &other, RealScalar prec=precision< Scalar >()) const |
template<typename OtherDerived > | |
bool | isApprox (const MatrixBase< OtherDerived > &other, RealScalar prec=precision< Scalar >()) const |
bool | isRValue () const |
bool | isVector () const |
Derived & | markAsRValue () |
template<unsigned int Added> | |
const SparseFlagged< Derived, Added, 0 > | marked () const |
int | nonZeros () const |
RealScalar | norm () const |
const SparseCwiseUnaryOp < ei_scalar_multiple_op < typename ei_traits< Derived > ::Scalar >, Derived > | operator* (const Scalar &scalar) const |
template<typename OtherDerived > | |
const SparseProductReturnType < Derived, OtherDerived > ::Type | operator* (const SparseMatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
const SparseProductReturnType < Derived, OtherDerived > ::Type | operator* (const MatrixBase< OtherDerived > &other) const |
Derived & | operator*= (const Scalar &other) |
template<typename OtherDerived > | |
Derived & | operator*= (const SparseMatrixBase< OtherDerived > &other) |
template<typename OtherDerived > | |
const SparseCwiseBinaryOp < ei_scalar_sum_op< typename ei_traits< Derived >::Scalar > , Derived, OtherDerived > | operator+ (const SparseMatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
Derived & | operator+= (const SparseMatrixBase< OtherDerived > &other) |
const SparseCwiseUnaryOp < ei_scalar_opposite_op < typename ei_traits< Derived > ::Scalar >, Derived > | operator- () const |
template<typename OtherDerived > | |
const SparseCwiseBinaryOp < ei_scalar_difference_op < typename ei_traits< Derived > ::Scalar >, Derived, OtherDerived > | operator- (const SparseMatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
Derived & | operator-= (const SparseMatrixBase< OtherDerived > &other) |
const SparseCwiseUnaryOp < ei_scalar_quotient1_op < typename ei_traits< Derived > ::Scalar >, Derived > | operator/ (const Scalar &scalar) const |
Derived & | operator/= (const Scalar &other) |
Derived & | operator= (const Derived &other) |
template<typename OtherDerived > | |
Derived & | operator= (const SparseMatrixBase< OtherDerived > &other) |
template<typename Lhs , typename Rhs > | |
Derived & | operator= (const SparseProduct< Lhs, Rhs, SparseTimeSparseProduct > &product) |
int | outerSize () const |
const RealReturnType | real () const |
SparseInnerVectorSet< Derived, 1 > | row (int i) |
const SparseInnerVectorSet < Derived, 1 > | row (int i) const |
int | rows () const |
int | size () const |
template<typename OtherDerived > | |
ei_plain_matrix_type_column_major < OtherDerived >::type | solveTriangular (const MatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
void | solveTriangularInPlace (MatrixBase< OtherDerived > &other) const |
RealScalar | squaredNorm () const |
SparseInnerVectorSet< Derived, Dynamic > | subcols (int start, int size) |
const SparseInnerVectorSet < Derived, Dynamic > | subcols (int start, int size) const |
SparseInnerVectorSet< Derived, Dynamic > | subrows (int start, int size) |
const SparseInnerVectorSet < Derived, Dynamic > | subrows (int start, int size) const |
Scalar | sum () const |
Matrix< Scalar, RowsAtCompileTime, ColsAtCompileTime > | toDense () const |
SparseTranspose< Derived > | transpose () |
const SparseTranspose< Derived > | transpose () const |
template<typename CustomUnaryOp > | |
const SparseCwiseUnaryOp < CustomUnaryOp, Derived > | unaryExpr (const CustomUnaryOp &func=CustomUnaryOp()) const |
Public Attributes | |
CompressedStorage< Scalar > | m_data |
int | m_size |
Friends | |
std::ostream & | operator<< (std::ostream &s, const SparseVector &m) |
Additional Inherited Members | |
![]() | |
bool | m_isRValue |
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.
|
inline |
Destructor
|
inline |
This insertion might be very costly if the number of nonzeros above i is large.
|
inline |
Like fill() but with random coordinates.
|
inline |