10#ifndef EIGEN_SPARSE_REF_H
11#define EIGEN_SPARSE_REF_H
21template<
typename Derived>
class SparseRefBase;
23template<
typename MatScalar,
int MatOptions,
typename MatIndex,
int _Options,
typename _Str
ideType>
25 :
public traits<SparseMatrix<MatScalar,MatOptions,MatIndex> >
33 template<
typename Derived>
struct match {
35 StorageOrderMatch = PlainObjectType::IsVectorAtCompileTime || Derived::IsVectorAtCompileTime || ((PlainObjectType::Flags&
RowMajorBit)==(Derived::Flags&
RowMajorBit)),
43template<
typename MatScalar,
int MatOptions,
typename MatIndex,
int _Options,
typename _Str
ideType>
45 :
public traits<Ref<SparseMatrix<MatScalar,MatOptions,MatIndex>, _Options, _StrideType> >
52template<
typename MatScalar,
int MatOptions,
typename MatIndex,
int _Options,
typename _Str
ideType>
54 :
public traits<SparseVector<MatScalar,MatOptions,MatIndex> >
62 template<
typename Derived>
struct match {
71template<
typename MatScalar,
int MatOptions,
typename MatIndex,
int _Options,
typename _Str
ideType>
73 :
public traits<Ref<SparseVector<MatScalar,MatOptions,MatIndex>, _Options, _StrideType> >
80template<
typename Derived>
92 :
Base(RowsAtCompileTime==
Dynamic?0:RowsAtCompileTime,ColsAtCompileTime==
Dynamic?0:ColsAtCompileTime, 0, 0, 0, 0, 0)
97 template<
typename Expression>
98 void construct(Expression& expr)
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
122template<
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options,
typename Str
ideType>
126template<typename SparseMatrixType, int Options>
127class
Ref<SparseMatrixType, Options>
133 template<
int OtherOptions>
135 template<
int OtherOptions>
140 EIGEN_SPARSE_PUBLIC_INTERFACE(
Ref)
143 #ifndef EIGEN_PARSED_BY_DOXYGEN
144 template<
int OtherOptions>
149 Base::construct(expr.derived());
152 template<
int OtherOptions>
157 Base::construct(expr.derived());
160 template<
typename Derived>
164 template<
typename Derived>
169 EIGEN_STATIC_ASSERT(
bool(Traits::template match<Derived>::MatchAtCompileTime), STORAGE_LAYOUT_DOES_NOT_MATCH);
171 Base::construct(expr.const_cast_derived());
176template<
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options,
typename Str
ideType>
185 EIGEN_SPARSE_PUBLIC_INTERFACE(
Ref)
187 template<
typename Derived>
190 construct(expr.derived(),
typename Traits::template match<Derived>::type());
193 inline Ref(
const Ref& other) :
Base(other), m_hasCopy(
false) {
197 template<
typename OtherRef>
199 construct(other.derived(),
typename Traits::template match<OtherRef>::type());
205 obj->~TPlainObjectType();
211 template<
typename Expression>
219 Base::construct(*obj);
223 Base::construct(expr);
227 template<
typename Expression>
233 Base::construct(*obj);
252#ifndef EIGEN_PARSED_BY_DOXYGEN
253template<
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options,
typename Str
ideType>
257template<typename SparseVectorType>
258class
Ref<SparseVectorType>
264 template<
int OtherOptions>
269 EIGEN_SPARSE_PUBLIC_INTERFACE(
Ref)
271 #ifndef EIGEN_PARSED_BY_DOXYGEN
272 template<
int OtherOptions>
276 Base::construct(expr.derived());
279 template<
typename Derived>
283 template<
typename Derived>
288 EIGEN_STATIC_ASSERT(
bool(Traits::template match<Derived>::MatchAtCompileTime), STORAGE_LAYOUT_DOES_NOT_MATCH);
289 Base::construct(expr.const_cast_derived());
294template<
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options,
typename Str
ideType>
303 EIGEN_SPARSE_PUBLIC_INTERFACE(
Ref)
305 template<
typename Derived>
308 construct(expr.derived(),
typename Traits::template match<Derived>::type());
311 inline Ref(
const Ref& other) :
Base(other), m_hasCopy(
false) {
315 template<
typename OtherRef>
317 construct(other.derived(),
typename Traits::template match<OtherRef>::type());
323 obj->~TPlainObjectType();
329 template<
typename Expression>
332 Base::construct(expr);
335 template<
typename Expression>
341 Base::construct(*obj);
353template<
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options,
typename Str
ideType>
355 :
evaluator<SparseCompressedBase<Ref<SparseMatrix<MatScalar,MatOptions,MatIndex>, Options, StrideType> > >
363template<
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options,
typename Str
ideType>
365 :
evaluator<SparseCompressedBase<Ref<const SparseMatrix<MatScalar,MatOptions,MatIndex>, Options, StrideType> > >
373template<
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options,
typename Str
ideType>
375 :
evaluator<SparseCompressedBase<Ref<SparseVector<MatScalar,MatOptions,MatIndex>, Options, StrideType> > >
383template<
typename MatScalar,
int MatOptions,
typename MatIndex,
int Options,
typename Str
ideType>
385 :
evaluator<SparseCompressedBase<Ref<const SparseVector<MatScalar,MatOptions,MatIndex>, Options, StrideType> > >
Sparse matrix.
Definition MappedSparseMatrix.h:34
A sparse matrix expression referencing an existing sparse expression.
Definition SparseRef.h:130
A sparse vector expression referencing an existing sparse vector expression.
Definition SparseRef.h:261
Definition SparseRef.h:179
Definition SparseRef.h:297
A matrix or vector expression mapping an existing expression.
Definition Ref.h:283
Common base class for sparse [compressed]-{row|column}-storage format.
Definition SparseCompressedBase.h:38
Definition SparseMap.h:43
Base class of any sparse matrices or sparse expressions.
Definition SparseMatrixBase.h:28
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
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 common.h:81
@ StandardCompressedFormat
Definition SparseRef.h:16
const int Dynamic
Definition Constants.h:22
Definition CoreEvaluators.h:91
Definition XprHelper.h:660
Definition ForwardDeclarations.h:17