10#ifndef EIGEN_DYNAMIC_SPARSEMATRIX_H
11#define EIGEN_DYNAMIC_SPARSEMATRIX_H
36template<
typename _Scalar,
int _Options,
typename _StorageIndex>
55template<
typename _Scalar,
int _Options,
typename _StorageIndex>
57 :
public SparseMatrixBase<DynamicSparseMatrix<_Scalar, _Options, _StorageIndex> >
68 using
Base::operator=;
78 std::vector<internal::CompressedStorage<Scalar,StorageIndex> >
m_data;
88 std::vector<internal::CompressedStorage<Scalar,StorageIndex> >&
_data() {
return m_data; }
89 const std::vector<internal::CompressedStorage<Scalar,StorageIndex> >&
_data()
const {
return m_data; }
98 return m_data[outer].at(inner);
109 return m_data[outer].atWithInsertion(inner);
113 class ReverseInnerIterator;
139 m_data[
j].reserve(reserveSizePerVector);
162 &&
"wrong sorted insertion");
163 m_data[outer].append(0, inner);
174 m_data[outer].resize(
id+2,1);
176 while ( (
id >= startId) && (
m_data[outer].index(
id) > inner) )
182 m_data[outer].index(
id+1) = inner;
183 m_data[outer].value(
id+1) = 0;
184 return m_data[outer].value(
id+1);
231 #ifdef EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN
241 #ifdef EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN
248 template<
typename OtherDerived>
252 #ifdef EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN
261 #ifdef EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN
332# ifdef EIGEN_DYNAMICSPARSEMATRIX_PLUGIN
333# include EIGEN_DYNAMICSPARSEMATRIX_PLUGIN
337template<
typename Scalar,
int _Options,
typename _StorageIndex>
354template<
typename Scalar,
int _Options,
typename _StorageIndex>
373template<
typename _Scalar,
int _Options,
typename _StorageIndex>
375 :
evaluator_base<DynamicSparseMatrix<_Scalar,_Options,_StorageIndex> >
384 Flags = SparseMatrixType::Flags
#define EIGEN_DEPRECATED
Definition Macros.h:1058
#define eigen_assert(x)
Definition Macros.h:1037
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition PartialRedux_count.cpp:3
#define EIGEN_SPARSE_PUBLIC_INTERFACE(Derived)
Definition SparseUtil.h:43
MatrixXf mat
Definition Tutorial_AdvancedInitialization_CommaTemporary.cpp:1
Definition DynamicSparseMatrix.h:339
Index col() const
Definition DynamicSparseMatrix.h:347
Index outer() const
Definition DynamicSparseMatrix.h:348
Index row() const
Definition DynamicSparseMatrix.h:346
const Index m_outer
Definition DynamicSparseMatrix.h:351
InnerIterator(const DynamicSparseMatrix &mat, Index outer)
Definition DynamicSparseMatrix.h:342
Definition DynamicSparseMatrix.h:356
Index row() const
Definition DynamicSparseMatrix.h:363
const Index m_outer
Definition DynamicSparseMatrix.h:368
ReverseInnerIterator(const DynamicSparseMatrix &mat, Index outer)
Definition DynamicSparseMatrix.h:359
Index outer() const
Definition DynamicSparseMatrix.h:365
Index col() const
Definition DynamicSparseMatrix.h:364
A sparse matrix class designed for matrix assembly purpose.
Definition DynamicSparseMatrix.h:58
Index innerSize() const
Definition DynamicSparseMatrix.h:84
Index rows() const
Definition DynamicSparseMatrix.h:82
Scalar & coeffRef(Index row, Index col)
Definition DynamicSparseMatrix.h:105
void reserve(Index reserveSize=1000)
Definition DynamicSparseMatrix.h:132
void startVec(Index)
Definition DynamicSparseMatrix.h:145
void resize(Index rows, Index cols)
Definition DynamicSparseMatrix.h:199
Scalar & insertBackByOuterInner(Index outer, Index inner)
Definition DynamicSparseMatrix.h:158
void setZero()
Definition DynamicSparseMatrix.h:115
Index m_innerSize
Definition DynamicSparseMatrix.h:77
std::vector< internal::CompressedStorage< Scalar, StorageIndex > > & _data()
Definition DynamicSparseMatrix.h:88
DynamicSparseMatrix & operator=(const DynamicSparseMatrix &other)
Definition DynamicSparseMatrix.h:275
EIGEN_DEPRECATED DynamicSparseMatrix()
Definition DynamicSparseMatrix.h:228
void swap(DynamicSparseMatrix &other)
Definition DynamicSparseMatrix.h:267
Index nonZeros() const
Definition DynamicSparseMatrix.h:122
std::vector< internal::CompressedStorage< Scalar, StorageIndex > > m_data
Definition DynamicSparseMatrix.h:78
const std::vector< internal::CompressedStorage< Scalar, StorageIndex > > & _data() const
Definition DynamicSparseMatrix.h:89
DynamicSparseMatrix(const DynamicSparseMatrix &other)
Definition DynamicSparseMatrix.h:258
Scalar coeff(Index row, Index col) const
Definition DynamicSparseMatrix.h:94
@ Options
Definition DynamicSparseMatrix.h:70
void resizeAndKeepData(Index rows, Index cols)
Definition DynamicSparseMatrix.h:210
EIGEN_DEPRECATED Scalar & fillrand(Index row, Index col)
Definition DynamicSparseMatrix.h:323
void finalize()
Definition DynamicSparseMatrix.h:188
EIGEN_DEPRECATED void endFill()
Definition DynamicSparseMatrix.h:330
Index outerSize() const
Definition DynamicSparseMatrix.h:85
EIGEN_DEPRECATED DynamicSparseMatrix(const SparseMatrixBase< OtherDerived > &other)
Definition DynamicSparseMatrix.h:249
EIGEN_DEPRECATED void startFill(Index reserveSize=1000)
Definition DynamicSparseMatrix.h:296
Index cols() const
Definition DynamicSparseMatrix.h:83
EIGEN_DEPRECATED DynamicSparseMatrix(Index rows, Index cols)
Definition DynamicSparseMatrix.h:238
@ IsRowMajor
Definition SparseMatrixBase.h:100
Index innerNonZeros(Index j) const
Definition DynamicSparseMatrix.h:86
Scalar & insert(Index row, Index col)
Definition DynamicSparseMatrix.h:167
~DynamicSparseMatrix()
Definition DynamicSparseMatrix.h:290
Scalar & insertBack(Index row, Index col)
Definition DynamicSparseMatrix.h:152
void prune(Scalar reference, RealScalar epsilon=NumTraits< RealScalar >::dummy_precision())
Definition DynamicSparseMatrix.h:191
EIGEN_DEPRECATED Scalar & fill(Index row, Index col)
Definition DynamicSparseMatrix.h:311
An InnerIterator allows to loop over the element of any matrix expression.
Definition CoreIterators.h:34
Sparse matrix.
Definition MappedSparseMatrix.h:34
Definition SparseCompressedBase.h:159
Definition SparseCompressedBase.h:245
Base class of any sparse matrices or sparse expressions.
Definition SparseMatrixBase.h:28
internal::traits< DynamicSparseMatrix< _Scalar, _Options, _StorageIndex > >::StorageIndex StorageIndex
Definition SparseMatrixBase.h:43
const Derived & derived() const
Definition SparseMatrixBase.h:143
Index size() const
Definition SparseMatrixBase.h:181
@ Flags
Definition SparseMatrixBase.h:95
bool isRValue() const
Definition SparseMatrixBase.h:194
Derived & operator=(const EigenBase< OtherDerived > &other)
Definition SparseAssign.h:17
internal::traits< DynamicSparseMatrix< _Scalar, _Options, _StorageIndex > >::Scalar Scalar
Definition SparseMatrixBase.h:31
Derived & const_cast_derived() const
Definition SparseMatrixBase.h:145
NumTraits< Scalar >::Real RealScalar
Definition SparseMatrixBase.h:128
static StorageIndex convert_index(const Index idx)
Definition SparseMatrixBase.h:389
a sparse vector class
Definition SparseVector.h:66
const unsigned int LvalueBit
Definition Constants.h:144
const unsigned int RowMajorBit
Definition Constants.h:66
Namespace containing all symbols from the Eigen library.
Definition bench_norm.cpp:85
const unsigned int NestByRefBit
Definition Constants.h:169
const int OuterRandomAccessPattern
Definition SparseUtil.h:49
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
const int Dynamic
Definition Constants.h:22
Definition BandTriangularSolver.h:13
Eigen::Index Index
The interface type of indices.
Definition EigenBase.h:39
Definition Constants.h:522
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition NumTraits.h:233
Definition Constants.h:510
evaluator(const SparseMatrixType &mat)
Definition DynamicSparseMatrix.h:388
SparseMatrixType::ReverseInnerIterator ReverseInnerIterator
Definition DynamicSparseMatrix.h:380
Scalar coeff(Index row, Index col) const
Definition DynamicSparseMatrix.h:393
Index nonZerosEstimate() const
Definition DynamicSparseMatrix.h:395
const SparseMatrixType * m_matrix
Definition DynamicSparseMatrix.h:397
DynamicSparseMatrix< _Scalar, _Options, _StorageIndex > SparseMatrixType
Definition DynamicSparseMatrix.h:378
SparseMatrixType::InnerIterator InnerIterator
Definition DynamicSparseMatrix.h:379
_Scalar Scalar
Definition DynamicSparseMatrix.h:377
evaluator()
Definition DynamicSparseMatrix.h:387
Definition CoreEvaluators.h:111
Definition CoreEvaluators.h:91
_StorageIndex StorageIndex
Definition DynamicSparseMatrix.h:40
Sparse StorageKind
Definition DynamicSparseMatrix.h:41
_Scalar Scalar
Definition DynamicSparseMatrix.h:39
MatrixXpr XprKind
Definition DynamicSparseMatrix.h:42
Definition ForwardDeclarations.h:17
#define EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN
Definition sparse_product.cpp:23
std::ptrdiff_t j
Definition tut_arithmetic_redux_minmax.cpp:2