131 EIGEN_DENSE_PUBLIC_INTERFACE(
RefBase)
135 return StrideType::InnerStrideAtCompileTime != 0 ? m_stride.
inner() : 1;
140 return StrideType::OuterStrideAtCompileTime != 0 ? m_stride.
outer()
141 : IsVectorAtCompileTime ? this->size()
147 :
Base(0,RowsAtCompileTime==Dynamic?0:RowsAtCompileTime,ColsAtCompileTime==Dynamic?0:ColsAtCompileTime),
149 m_stride(StrideType::OuterStrideAtCompileTime==Dynamic?0:StrideType::OuterStrideAtCompileTime,
150 StrideType::InnerStrideAtCompileTime==Dynamic?0:StrideType::InnerStrideAtCompileTime)
153 EIGEN_INHERIT_ASSIGNMENT_OPERATORS(
RefBase)
159 template<
typename Expression>
162 if(PlainObjectType::RowsAtCompileTime==1)
164 eigen_assert(expr.rows()==1 || expr.cols()==1);
165 ::new (
static_cast<Base*
>(
this))
Base(expr.data(), 1, expr.size());
167 else if(PlainObjectType::ColsAtCompileTime==1)
169 eigen_assert(expr.rows()==1 || expr.cols()==1);
170 ::new (
static_cast<Base*
>(
this))
Base(expr.data(), expr.size(), 1);
173 ::new (
static_cast<Base*
>(
this))
Base(expr.data(), expr.rows(), expr.cols());
175 if(Expression::IsVectorAtCompileTime && (!PlainObjectType::IsVectorAtCompileTime) && ((Expression::Flags&
RowMajorBit)!=(PlainObjectType::Flags&
RowMajorBit)))
176 ::new (&m_stride)
StrideBase(expr.innerStride(), StrideType::InnerStrideAtCompileTime==0?0:1);
178 ::new (&m_stride)
StrideBase(StrideType::OuterStrideAtCompileTime==0?0:expr.outerStride(),
179 StrideType::InnerStrideAtCompileTime==0?0:expr.innerStride());
186template<
typename PlainObjectType,
int Options,
typename Str
ideType>
class Ref
187 :
public RefBase<Ref<PlainObjectType, Options, StrideType> >
191 template<
typename Derived>
197 EIGEN_DENSE_PUBLIC_INTERFACE(
Ref)
200 #ifndef EIGEN_PARSED_BY_DOXYGEN
201 template<
typename Derived>
206 Base::construct(expr.derived());
208 template<
typename Derived>
212 template<
typename Derived>
218 EIGEN_STATIC_ASSERT(!Derived::IsPlainObjectBase,THIS_EXPRESSION_IS_NOT_A_LVALUE__IT_IS_READ_ONLY);
219 Base::construct(expr.const_cast_derived());
222 EIGEN_INHERIT_ASSIGNMENT_OPERATORS(
Ref)
227template<
typename TPlainObjectType,
int Options,
typename Str
ideType>
class Ref<
const TPlainObjectType, Options, StrideType>
228 :
public RefBase<Ref<const TPlainObjectType, Options, StrideType> >
234 EIGEN_DENSE_PUBLIC_INTERFACE(
Ref)
236 template<
typename Derived>
250 template<
typename OtherRef>
257 template<
typename Expression>
260 Base::construct(expr);
263 template<
typename Expression>
267 Base::construct(m_object);
271 TPlainObjectType m_object;
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition Constants.h:61