10 #ifndef EIGEN_SPARSE_REF_H
11 #define EIGEN_SPARSE_REF_H
21 template<
typename Derived>
class SparseRefBase;
23 template<
typename MatScalar,
int MatOptions,
typename MatIndex,
int _Options,
typename _Str
ideType>
25 :
public traits<SparseMatrix<MatScalar,MatOptions,MatIndex> >
33 template<
typename Derived>
struct match {
43 template<
typename MatScalar,
int MatOptions,
typename MatIndex,
int _Options,
typename _Str
ideType>
45 :
public traits<Ref<SparseMatrix<MatScalar,MatOptions,MatIndex>, _Options, _StrideType> >
52 template<
typename MatScalar,
int MatOptions,
typename MatIndex,
int _Options,
typename _Str
ideType>
54 :
public traits<SparseVector<MatScalar,MatOptions,MatIndex> >
62 template<
typename Derived>
struct match {
71 template<
typename MatScalar,
int MatOptions,
typename MatIndex,
int _Options,
typename _Str
ideType>
73 :
public traits<Ref<SparseVector<MatScalar,MatOptions,MatIndex>, _Options, _StrideType> >
80 template<
typename Derived>
92 :
Base(RowsAtCompileTime==
Dynamic?0:RowsAtCompileTime,ColsAtCompileTime==
Dynamic?0:ColsAtCompileTime, 0, 0, 0, 0, 0)
97 template<
typename Expression>
100 if(expr.outerIndexPtr()==0)
101 ::new (
static_cast<Base*
>(
this))
Base(expr.size(), expr.nonZeros(), expr.innerIndexPtr(), expr.valuePtr());
103 ::new (
static_cast<Base*
>(
this))
Base(expr.rows(), expr.cols(), expr.nonZeros(), expr.outerIndexPtr(), expr.innerIndexPtr(), expr.valuePtr(), expr.innerNonZeroPtr());
121 #ifndef EIGEN_PARSED_BY_DOXYGEN
122 template<
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options,
typename Str
ideType>
126 template<typename SparseMatrixType, int Options>
127 class
Ref<SparseMatrixType, Options>
133 template<
int OtherOptions>
135 template<
int OtherOptions>
143 #ifndef EIGEN_PARSED_BY_DOXYGEN
144 template<
int OtherOptions>
152 template<
int OtherOptions>
160 template<
typename Derived>
164 template<
typename Derived>
169 EIGEN_STATIC_ASSERT(
bool(Traits::template match<Derived>::MatchAtCompileTime), STORAGE_LAYOUT_DOES_NOT_MATCH);
176 template<
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options,
typename Str
ideType>
187 template<
typename Derived>
193 inline Ref(
const Ref& other) :
Base(other), m_hasCopy(false) {
197 template<
typename OtherRef>
205 obj->~TPlainObjectType();
211 template<
typename Expression>
227 template<
typename Expression>
252 #ifndef EIGEN_PARSED_BY_DOXYGEN
253 template<
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options,
typename Str
ideType>
257 template<typename SparseVectorType>
258 class
Ref<SparseVectorType>
264 template<
int OtherOptions>
271 #ifndef EIGEN_PARSED_BY_DOXYGEN
272 template<
int OtherOptions>
279 template<
typename Derived>
283 template<
typename Derived>
288 EIGEN_STATIC_ASSERT(
bool(Traits::template match<Derived>::MatchAtCompileTime), STORAGE_LAYOUT_DOES_NOT_MATCH);
294 template<
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options,
typename Str
ideType>
305 template<
typename Derived>
311 inline Ref(
const Ref& other) :
Base(other), m_hasCopy(false) {
315 template<
typename OtherRef>
323 obj->~TPlainObjectType();
329 template<
typename Expression>
335 template<
typename Expression>
353 template<
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options,
typename Str
ideType>
355 :
evaluator<SparseCompressedBase<Ref<SparseMatrix<MatScalar,MatOptions,MatIndex>, Options, StrideType> > >
363 template<
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options,
typename Str
ideType>
365 :
evaluator<SparseCompressedBase<Ref<const SparseMatrix<MatScalar,MatOptions,MatIndex>, Options, StrideType> > >
373 template<
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options,
typename Str
ideType>
375 :
evaluator<SparseCompressedBase<Ref<SparseVector<MatScalar,MatOptions,MatIndex>, Options, StrideType> > >
383 template<
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options,
typename Str
ideType>
385 :
evaluator<SparseCompressedBase<Ref<const SparseVector<MatScalar,MatOptions,MatIndex>, Options, StrideType> > >
#define eigen_assert(x)
Definition: Macros.h:1037
#define EIGEN_SPARSE_PUBLIC_INTERFACE(Derived)
Definition: SparseUtil.h:43
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
Definition: StaticAssert.h:127
Sparse matrix.
Definition: MappedSparseMatrix.h:34
EIGEN_DEVICE_FUNC bool construct(Expression &expr)
Definition: Ref.h:109
A sparse matrix expression referencing an existing sparse expression.
Definition: SparseRef.h:130
Ref(const SparseCompressedBase< Derived > &expr)
Definition: SparseRef.h:161
SparseMatrix< MatScalar, MatOptions, MatIndex > PlainObjectType
Definition: SparseRef.h:131
Ref(const SparseMatrix< MatScalar, OtherOptions, MatIndex > &expr)
Ref(SparseMatrix< MatScalar, OtherOptions, MatIndex > &expr)
Definition: SparseRef.h:145
Ref(const MappedSparseMatrix< MatScalar, OtherOptions, MatIndex > &expr)
internal::SparseRefBase< Ref > Base
Definition: SparseRef.h:139
internal::traits< Ref > Traits
Definition: SparseRef.h:132
Ref(MappedSparseMatrix< MatScalar, OtherOptions, MatIndex > &expr)
Definition: SparseRef.h:153
A sparse vector expression referencing an existing sparse vector expression.
Definition: SparseRef.h:261
Ref(const SparseVector< MatScalar, OtherOptions, MatIndex > &expr)
internal::SparseRefBase< Ref > Base
Definition: SparseRef.h:268
internal::traits< Ref > Traits
Definition: SparseRef.h:263
Ref(const SparseCompressedBase< Derived > &expr)
Definition: SparseRef.h:280
Ref(SparseVector< MatScalar, OtherOptions, MatIndex > &expr)
Definition: SparseRef.h:273
SparseVector< MatScalar, MatOptions, MatIndex > PlainObjectType
Definition: SparseRef.h:262
Definition: SparseRef.h:179
Ref(const SparseMatrixBase< Derived > &expr)
Definition: SparseRef.h:188
void construct(const Expression &expr, internal::true_type)
Definition: SparseRef.h:212
internal::traits< Ref > Traits
Definition: SparseRef.h:181
Ref(const Ref &other)
Definition: SparseRef.h:193
~Ref()
Definition: SparseRef.h:202
internal::SparseRefBase< Ref > Base
Definition: SparseRef.h:184
bool m_hasCopy
Definition: SparseRef.h:238
Ref(const RefBase< OtherRef > &other)
Definition: SparseRef.h:198
void construct(const Expression &expr, internal::false_type)
Definition: SparseRef.h:228
SparseMatrix< MatScalar, MatOptions, MatIndex > TPlainObjectType
Definition: SparseRef.h:180
internal::aligned_storage< sizeof(TPlainObjectType), EIGEN_ALIGNOF(TPlainObjectType)>::type m_storage
Definition: SparseRef.h:237
Definition: SparseRef.h:297
bool m_hasCopy
Definition: SparseRef.h:346
~Ref()
Definition: SparseRef.h:320
internal::SparseRefBase< Ref > Base
Definition: SparseRef.h:302
Ref(const SparseMatrixBase< Derived > &expr)
Definition: SparseRef.h:306
Ref(const Ref &other)
Definition: SparseRef.h:311
Ref(const RefBase< OtherRef > &other)
Definition: SparseRef.h:316
internal::traits< Ref > Traits
Definition: SparseRef.h:299
void construct(const Expression &expr, internal::false_type)
Definition: SparseRef.h:336
SparseVector< MatScalar, MatOptions, MatIndex > TPlainObjectType
Definition: SparseRef.h:298
void construct(const Expression &expr, internal::true_type)
Definition: SparseRef.h:330
internal::aligned_storage< sizeof(TPlainObjectType), EIGEN_ALIGNOF(TPlainObjectType)>::type m_storage
Definition: SparseRef.h:345
A matrix or vector expression mapping an existing expression.
Definition: Ref.h:283
EIGEN_DEVICE_FUNC Ref(const PlainObjectBase< Derived > &expr, typename internal::enable_if< bool(Traits::template match< Derived >::MatchAtCompileTime), Derived >::type *=0)
Common base class for sparse [compressed]-{row|column}-storage format.
Definition: SparseCompressedBase.h:38
bool isCompressed() const
Definition: SparseCompressedBase.h:107
Definition: SparseMap.h:43
Base class of any sparse matrices or sparse expressions.
Definition: SparseMatrixBase.h:28
Derived & const_cast_derived() const
Definition: SparseMatrixBase.h:145
const Derived & derived() const
Definition: SparseMatrixBase.h:143
A versatible sparse matrix representation.
Definition: SparseMatrix.h:98
bool isCompressed() const
Definition: SparseCompressedBase.h:107
a sparse vector class
Definition: SparseVector.h:66
Definition: SparseRef.h:85
SparseMapBase< Derived > Base
Definition: SparseRef.h:88
void construct(Expression &expr)
Definition: SparseRef.h:98
const unsigned int LvalueBit
Definition: Constants.h:144
const unsigned int RowMajorBit
Definition: Constants.h:66
const unsigned int CompressedAccessBit
Definition: Constants.h:191
Namespace containing all symbols from the Eigen library.
Definition: LDLT.h:16
const unsigned int NestByRefBit
Definition: Constants.h:169
@ StandardCompressedFormat
Definition: SparseRef.h:16
const int Dynamic
Definition: Constants.h:22
type
The type the bitset is encoded with.
Definition: bitset.hpp:44
Flags
Special flags for archives.
Definition: cereal.hpp:185
Definition: document.h:416
evaluator(const XprType &mat)
Definition: SparseRef.h:360
evaluator()
Definition: SparseRef.h:359
evaluator< SparseCompressedBase< Ref< SparseMatrix< MatScalar, MatOptions, MatIndex >, Options, StrideType > > > Base
Definition: SparseRef.h:357
Ref< SparseMatrix< MatScalar, MatOptions, MatIndex >, Options, StrideType > XprType
Definition: SparseRef.h:358
Ref< SparseVector< MatScalar, MatOptions, MatIndex >, Options, StrideType > XprType
Definition: SparseRef.h:378
evaluator< SparseCompressedBase< Ref< SparseVector< MatScalar, MatOptions, MatIndex >, Options, StrideType > > > Base
Definition: SparseRef.h:377
evaluator(const XprType &mat)
Definition: SparseRef.h:380
evaluator()
Definition: SparseRef.h:379
Ref< const SparseMatrix< MatScalar, MatOptions, MatIndex >, Options, StrideType > XprType
Definition: SparseRef.h:368
evaluator(const XprType &mat)
Definition: SparseRef.h:370
evaluator()
Definition: SparseRef.h:369
evaluator< SparseCompressedBase< Ref< const SparseMatrix< MatScalar, MatOptions, MatIndex >, Options, StrideType > > > Base
Definition: SparseRef.h:367
evaluator< SparseCompressedBase< Ref< const SparseVector< MatScalar, MatOptions, MatIndex >, Options, StrideType > > > Base
Definition: SparseRef.h:387
evaluator(const XprType &mat)
Definition: SparseRef.h:390
Ref< const SparseVector< MatScalar, MatOptions, MatIndex >, Options, StrideType > XprType
Definition: SparseRef.h:388
evaluator()
Definition: SparseRef.h:389
Definition: CoreEvaluators.h:91
Definition: XprHelper.h:660
SparseMatrix< MatScalar, MatOptions, MatIndex > PlainObjectType
Definition: SparseRef.h:27
internal::conditional< MatchAtCompileTime, internal::true_type, internal::false_type >::type type
Definition: SparseRef.h:38
SparseVector< MatScalar, MatOptions, MatIndex > PlainObjectType
Definition: SparseRef.h:56
internal::conditional< MatchAtCompileTime, internal::true_type, internal::false_type >::type type
Definition: SparseRef.h:66
Definition: ForwardDeclarations.h:17
#define const
Definition: zconf.h:233