10 #ifndef EIGEN_SPARSE_REF_H
11 #define EIGEN_SPARSE_REF_H
25 template <
typename Derived>
28 template <
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options_,
typename Str
ideType_>
30 :
public traits<SparseMatrix<MatScalar, MatOptions, MatIndex>> {
34 template <
typename Derived>
37 StorageOrderMatch = PlainObjectType::IsVectorAtCompileTime || Derived::IsVectorAtCompileTime ||
41 typedef std::conditional_t<MatchAtCompileTime, internal::true_type, internal::false_type>
type;
45 template <
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options_,
typename Str
ideType_>
47 :
public traits<Ref<SparseMatrix<MatScalar, MatOptions, MatIndex>, Options_, StrideType_>> {
54 template <
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options_,
typename Str
ideType_>
56 :
public traits<SparseVector<MatScalar, MatOptions, MatIndex>> {
60 template <
typename Derived>
62 enum { MatchAtCompileTime = (Derived::Flags &
CompressedAccessBit) && Derived::IsVectorAtCompileTime };
63 typedef std::conditional_t<MatchAtCompileTime, internal::true_type, internal::false_type>
type;
67 template <
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options_,
typename Str
ideType_>
69 :
public traits<Ref<SparseVector<MatScalar, MatOptions, MatIndex>, Options_, StrideType_>> {
76 template <
typename Derived>
79 template <
typename Derived>
86 :
Base(RowsAtCompileTime ==
Dynamic ? 0 : RowsAtCompileTime, ColsAtCompileTime ==
Dynamic ? 0 : ColsAtCompileTime,
90 template <
typename Expression>
92 if (expr.outerIndexPtr() == 0)
93 internal::construct_at<Base>(
this, expr.size(), expr.nonZeros(), expr.innerIndexPtr(), expr.valuePtr());
95 internal::construct_at<Base>(
this, expr.rows(), expr.cols(), expr.nonZeros(), expr.outerIndexPtr(),
96 expr.innerIndexPtr(), expr.valuePtr(), expr.innerNonZeroPtr());
113 #ifndef EIGEN_PARSED_BY_DOXYGEN
114 template <
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options,
typename Str
ideType>
118 template <typename SparseMatrixType, int Options>
119 class
Ref<SparseMatrixType, Options>
125 template <
int OtherOptions>
127 template <
int OtherOptions>
134 #ifndef EIGEN_PARSED_BY_DOXYGEN
135 template <
int OtherOptions>
139 STORAGE_LAYOUT_DOES_NOT_MATCH);
144 template <
int OtherOptions>
148 STORAGE_LAYOUT_DOES_NOT_MATCH);
153 template <
typename Derived>
157 template <
typename Derived>
162 EIGEN_STATIC_ASSERT(
bool(Traits::template match<Derived>::MatchAtCompileTime), STORAGE_LAYOUT_DOES_NOT_MATCH);
169 template <
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options,
typename Str
ideType>
171 :
public internal::SparseRefBase<Ref<const SparseMatrix<MatScalar, MatOptions, MatIndex>, Options, StrideType>> {
179 template <
typename Derived>
184 inline Ref(
const Ref& other) :
Base(other), m_hasCopy(false) {
188 template <
typename OtherRef>
200 template <
typename Expression>
211 template <
typename Expression>
233 #ifndef EIGEN_PARSED_BY_DOXYGEN
234 template <
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options,
typename Str
ideType>
238 template <typename SparseVectorType>
244 template <
int OtherOptions>
251 #ifndef EIGEN_PARSED_BY_DOXYGEN
252 template <
int OtherOptions>
256 STORAGE_LAYOUT_DOES_NOT_MATCH);
260 template <
typename Derived>
264 template <
typename Derived>
269 EIGEN_STATIC_ASSERT(
bool(Traits::template match<Derived>::MatchAtCompileTime), STORAGE_LAYOUT_DOES_NOT_MATCH);
275 template <
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options,
typename Str
ideType>
277 :
public internal::SparseRefBase<Ref<const SparseVector<MatScalar, MatOptions, MatIndex>, Options, StrideType>> {
285 template <
typename Derived>
290 inline Ref(
const Ref& other) :
Base(other), m_hasCopy(false) {
294 template <
typename OtherRef>
306 template <
typename Expression>
311 template <
typename Expression>
328 template <
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options,
typename Str
ideType>
330 :
evaluator<SparseCompressedBase<Ref<SparseMatrix<MatScalar, MatOptions, MatIndex>, Options, StrideType>>> {
337 template <
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options,
typename Str
ideType>
339 :
evaluator<SparseCompressedBase<Ref<const SparseMatrix<MatScalar, MatOptions, MatIndex>, Options, StrideType>>> {
347 template <
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options,
typename Str
ideType>
349 :
evaluator<SparseCompressedBase<Ref<SparseVector<MatScalar, MatOptions, MatIndex>, Options, StrideType>>> {
356 template <
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options,
typename Str
ideType>
358 :
evaluator<SparseCompressedBase<Ref<const SparseVector<MatScalar, MatOptions, MatIndex>, Options, StrideType>>> {
#define eigen_assert(x)
Definition: Macros.h:910
#define EIGEN_SPARSE_PUBLIC_INTERFACE(Derived)
Definition: SparseUtil.h:39
#define EIGEN_STATIC_ASSERT(X, MSG)
Definition: StaticAssert.h:26
A matrix or vector expression mapping an existing array of data.
Definition: Map.h:96
EIGEN_DEVICE_FUNC bool construct(Expression &expr)
Definition: Ref.h:111
A sparse matrix expression referencing an existing sparse expression.
Definition: SparseRef.h:122
Ref(const SparseCompressedBase< Derived > &expr)
Definition: SparseRef.h:154
Ref(const SparseMatrix< MatScalar, OtherOptions, MatIndex > &expr)
Ref(SparseMatrix< MatScalar, OtherOptions, MatIndex > &expr)
Definition: SparseRef.h:136
internal::SparseRefBase< Ref > Base
Definition: SparseRef.h:131
internal::traits< Ref > Traits
Definition: SparseRef.h:124
Ref(const Map< SparseMatrix< MatScalar, OtherOptions, MatIndex >> &expr)
SparseMatrix< MatScalar, MatOptions, MatIndex > PlainObjectType
Definition: SparseRef.h:123
Ref(Map< SparseMatrix< MatScalar, OtherOptions, MatIndex >> &expr)
Definition: SparseRef.h:145
A sparse vector expression referencing an existing sparse vector expression.
Definition: SparseRef.h:241
Ref(const SparseVector< MatScalar, OtherOptions, MatIndex > &expr)
internal::SparseRefBase< Ref > Base
Definition: SparseRef.h:248
internal::traits< Ref > Traits
Definition: SparseRef.h:243
Ref(const SparseCompressedBase< Derived > &expr)
Definition: SparseRef.h:261
Ref(SparseVector< MatScalar, OtherOptions, MatIndex > &expr)
Definition: SparseRef.h:253
SparseVector< MatScalar, MatOptions, MatIndex > PlainObjectType
Definition: SparseRef.h:242
Definition: SparseRef.h:171
SparseMatrix< MatScalar, MatOptions, MatIndex > TPlainObjectType
Definition: SparseRef.h:172
Ref(const SparseMatrixBase< Derived > &expr)
Definition: SparseRef.h:180
void construct(const Expression &expr, internal::true_type)
Definition: SparseRef.h:201
internal::traits< Ref > Traits
Definition: SparseRef.h:173
Ref(const Ref &other)
Definition: SparseRef.h:184
~Ref()
Definition: SparseRef.h:193
internal::SparseRefBase< Ref > Base
Definition: SparseRef.h:176
bool m_hasCopy
Definition: SparseRef.h:220
Ref(const RefBase< OtherRef > &other)
Definition: SparseRef.h:189
void construct(const Expression &expr, internal::false_type)
Definition: SparseRef.h:212
internal::aligned_storage< sizeof(TPlainObjectType), EIGEN_ALIGNOF(TPlainObjectType)>::type m_storage
Definition: SparseRef.h:219
Definition: SparseRef.h:277
bool m_hasCopy
Definition: SparseRef.h:320
~Ref()
Definition: SparseRef.h:299
internal::SparseRefBase< Ref > Base
Definition: SparseRef.h:282
Ref(const SparseMatrixBase< Derived > &expr)
Definition: SparseRef.h:286
Ref(const Ref &other)
Definition: SparseRef.h:290
Ref(const RefBase< OtherRef > &other)
Definition: SparseRef.h:295
internal::traits< Ref > Traits
Definition: SparseRef.h:279
void construct(const Expression &expr, internal::false_type)
Definition: SparseRef.h:312
void construct(const Expression &expr, internal::true_type)
Definition: SparseRef.h:307
SparseVector< MatScalar, MatOptions, MatIndex > TPlainObjectType
Definition: SparseRef.h:278
internal::aligned_storage< sizeof(TPlainObjectType), EIGEN_ALIGNOF(TPlainObjectType)>::type m_storage
Definition: SparseRef.h:319
A matrix or vector expression mapping an existing expression.
Definition: Ref.h:264
EIGEN_DEVICE_FUNC Ref(const PlainObjectBase< Derived > &expr, std::enable_if_t< bool(Traits::template match< Derived >::MatchAtCompileTime), Derived > *=0)
Common base class for sparse [compressed]-{row|column}-storage format.
Definition: SparseCompressedBase.h:43
bool isCompressed() const
Definition: SparseCompressedBase.h:114
Definition: SparseMap.h:40
Base class of any sparse matrices or sparse expressions.
Definition: SparseMatrixBase.h:30
Derived & const_cast_derived() const
Definition: SparseMatrixBase.h:146
const Derived & derived() const
Definition: SparseMatrixBase.h:144
A versatible sparse matrix representation.
Definition: SparseMatrix.h:121
bool isCompressed() const
Definition: SparseCompressedBase.h:114
a sparse vector class
Definition: SparseVector.h:62
Definition: SparseRef.h:80
SparseMapBase< Derived > Base
Definition: SparseRef.h:82
void construct(Expression &expr)
Definition: SparseRef.h:91
const unsigned int LvalueBit
Definition: Constants.h:148
const unsigned int RowMajorBit
Definition: Constants.h:70
const unsigned int CompressedAccessBit
Definition: Constants.h:195
bool match(const T &xpr, std::string ref, std::string str_xpr="")
Definition: indexed_view.cpp:29
EIGEN_DEVICE_FUNC T * construct_at(T *p, Args &&... args)
Definition: Memory.h:1321
EIGEN_DEVICE_FUNC void destroy_at(T *p)
Definition: Memory.h:1335
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
const unsigned int NestByRefBit
Definition: Constants.h:173
@ StandardCompressedFormat
Definition: SparseRef.h:19
const int Dynamic
Definition: Constants.h:25
Extend namespace for flags.
Definition: fsi_chan_precond_driver.cc:56
type
Definition: compute_granudrum_aor.py:141
Definition: Eigen_Colamd.h:49
evaluator(const XprType &mat)
Definition: SparseRef.h:334
evaluator()
Definition: SparseRef.h:333
Ref< SparseMatrix< MatScalar, MatOptions, MatIndex >, Options, StrideType > XprType
Definition: SparseRef.h:332
evaluator< SparseCompressedBase< Ref< SparseMatrix< MatScalar, MatOptions, MatIndex >, Options, StrideType > > > Base
Definition: SparseRef.h:331
Ref< SparseVector< MatScalar, MatOptions, MatIndex >, Options, StrideType > XprType
Definition: SparseRef.h:351
evaluator< SparseCompressedBase< Ref< SparseVector< MatScalar, MatOptions, MatIndex >, Options, StrideType > > > Base
Definition: SparseRef.h:350
evaluator(const XprType &mat)
Definition: SparseRef.h:353
evaluator()
Definition: SparseRef.h:352
evaluator(const XprType &mat)
Definition: SparseRef.h:344
evaluator()
Definition: SparseRef.h:343
Ref< const SparseMatrix< MatScalar, MatOptions, MatIndex >, Options, StrideType > XprType
Definition: SparseRef.h:342
evaluator< SparseCompressedBase< Ref< const SparseMatrix< MatScalar, MatOptions, MatIndex >, Options, StrideType > > > Base
Definition: SparseRef.h:341
evaluator(const XprType &mat)
Definition: SparseRef.h:363
Ref< const SparseVector< MatScalar, MatOptions, MatIndex >, Options, StrideType > XprType
Definition: SparseRef.h:361
evaluator()
Definition: SparseRef.h:362
evaluator< SparseCompressedBase< Ref< const SparseVector< MatScalar, MatOptions, MatIndex >, Options, StrideType > > > Base
Definition: SparseRef.h:360
Definition: CoreEvaluators.h:104
Definition: XprHelper.h:819
std::conditional_t< MatchAtCompileTime, internal::true_type, internal::false_type > type
Definition: SparseRef.h:41
SparseMatrix< MatScalar, MatOptions, MatIndex > PlainObjectType
Definition: SparseRef.h:31
SparseVector< MatScalar, MatOptions, MatIndex > PlainObjectType
Definition: SparseRef.h:57
std::conditional_t< MatchAtCompileTime, internal::true_type, internal::false_type > type
Definition: SparseRef.h:63
Definition: ForwardDeclarations.h:21