11 #ifndef EIGEN_DENSEBASE_H 12 #define EIGEN_DENSEBASE_H 42 #ifndef EIGEN_PARSED_BY_DOXYGEN
44 typename NumTraits<typename internal::traits<Derived>::Scalar>::Real>
47 #endif // not EIGEN_PARSED_BY_DOXYGEN 69 using Base::const_cast_derived;
73 using Base::rowIndexByOuterInner;
74 using Base::colIndexByOuterInner;
76 using Base::coeffByOuterInner;
78 using Base::packetByOuterInner;
79 using Base::writePacket;
80 using Base::writePacketByOuterInner;
82 using Base::coeffRefByOuterInner;
83 using Base::copyCoeff;
84 using Base::copyCoeffByOuterInner;
85 using Base::copyPacket;
86 using Base::copyPacketByOuterInner;
87 using Base::operator();
88 using Base::operator[];
94 using Base::innerStride;
95 using Base::outerStride;
96 using Base::rowStride;
97 using Base::colStride;
169 InnerSizeAtCompileTime = int(IsVectorAtCompileTime) ? int(SizeAtCompileTime)
170 : int(IsRowMajor) ? int(ColsAtCompileTime) : int(RowsAtCompileTime),
172 CoeffReadCost =
internal::traits<Derived>::CoeffReadCost,
177 InnerStrideAtCompileTime =
internal::inner_stride_at_compile_time<Derived>::ret,
178 OuterStrideAtCompileTime =
internal::outer_stride_at_compile_time<Derived>::ret
181 enum { ThisConstantIsPrivateInPlainObjectBase };
185 inline Index nonZeros()
const {
return size(); }
198 return IsVectorAtCompileTime ? 1
199 : int(IsRowMajor) ? this->rows() : this->cols();
209 return IsVectorAtCompileTime ? this->size()
210 : int(IsRowMajor) ? this->cols() : this->rows();
221 &&
"DenseBase::resize() does not actually allow to resize.");
231 eigen_assert(nbRows == this->rows() && nbCols == this->cols()
232 &&
"DenseBase::resize() does not actually allow to resize.");
235 #ifndef EIGEN_PARSED_BY_DOXYGEN 246 #endif // not EIGEN_PARSED_BY_DOXYGEN 249 template<
typename OtherDerived>
255 Derived& operator=(
const DenseBase& other);
257 template<
typename OtherDerived>
260 template<
typename OtherDerived>
263 template<
typename OtherDerived>
266 template<
typename OtherDerived>
269 #ifndef EIGEN_PARSED_BY_DOXYGEN 271 template<
typename OtherDerived>
273 #endif // not EIGEN_PARSED_BY_DOXYGEN 277 template<
unsigned int Added,
unsigned int Removed>
280 template<
typename OtherDerived>
285 ConstTransposeReturnType transpose()
const;
286 void transposeInPlace();
287 #ifndef EIGEN_NO_DEBUG 289 template<
typename OtherDerived>
290 void checkTransposeAliasing(
const OtherDerived& other)
const;
295 static const ConstantReturnType
296 Constant(Index rows, Index cols,
const Scalar& value);
297 static const ConstantReturnType
298 Constant(Index size,
const Scalar& value);
299 static const ConstantReturnType
300 Constant(
const Scalar& value);
302 static const SequentialLinSpacedReturnType
303 LinSpaced(
Sequential_t, Index size,
const Scalar& low,
const Scalar& high);
304 static const RandomAccessLinSpacedReturnType
305 LinSpaced(Index size,
const Scalar& low,
const Scalar& high);
306 static const SequentialLinSpacedReturnType
308 static const RandomAccessLinSpacedReturnType
309 LinSpaced(
const Scalar& low,
const Scalar& high);
311 template<
typename CustomNullaryOp>
313 NullaryExpr(Index rows, Index cols,
const CustomNullaryOp& func);
314 template<
typename CustomNullaryOp>
316 NullaryExpr(Index size,
const CustomNullaryOp& func);
317 template<
typename CustomNullaryOp>
319 NullaryExpr(
const CustomNullaryOp& func);
321 static const ConstantReturnType Zero(Index rows, Index cols);
322 static const ConstantReturnType Zero(Index size);
323 static const ConstantReturnType Zero();
324 static const ConstantReturnType Ones(Index rows, Index cols);
325 static const ConstantReturnType Ones(Index size);
326 static const ConstantReturnType Ones();
328 void fill(
const Scalar& value);
329 Derived& setConstant(
const Scalar& value);
330 Derived& setLinSpaced(Index size,
const Scalar& low,
const Scalar& high);
331 Derived& setLinSpaced(
const Scalar& low,
const Scalar& high);
334 Derived& setRandom();
336 template<
typename OtherDerived>
341 template<
typename OtherDerived>
350 inline bool hasNaN()
const;
351 inline bool allFinite()
const;
353 inline Derived& operator*=(
const Scalar& other);
354 inline Derived& operator/=(
const Scalar& other);
373 template<
typename OtherDerived>
375 int = OtherDerived::ThisConstantIsPrivateInPlainObjectBase)
383 template<
typename OtherDerived>
394 template<
bool Enable>
inline typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type forceAlignedAccessIf();
398 Scalar trace()
const;
405 template<
typename IndexType>
407 template<
typename IndexType>
409 template<
typename IndexType>
411 template<
typename IndexType>
414 template<
typename BinaryOp>
416 redux(
const BinaryOp& func)
const;
418 template<
typename Visitor>
419 void visit(Visitor& func)
const;
428 return derived().coeff(0,0);
431 bool all(
void)
const;
432 bool any(
void)
const;
440 ConstRowwiseReturnType rowwise()
const;
441 RowwiseReturnType rowwise();
442 ConstColwiseReturnType colwise()
const;
443 ColwiseReturnType colwise();
449 template<
typename ThenDerived,
typename ElseDerived>
454 template<
typename ThenDerived>
458 template<
typename ElseDerived>
462 template<
int p> RealScalar lpNorm()
const;
464 template<
int RowFactor,
int ColFactor>
470 ReverseReturnType reverse();
471 ConstReverseReturnType reverse()
const;
472 void reverseInPlace();
474 #define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::DenseBase 475 # include "../plugins/BlockMethods.h" 476 # ifdef EIGEN_DENSEBASE_PLUGIN 477 # include EIGEN_DENSEBASE_PLUGIN 479 #undef EIGEN_CURRENT_STORAGE_BASE_CLASS 481 #ifdef EIGEN2_SUPPORT 485 template<
int CRows,
int CCols>
487 template<
int CRows,
int CCols>
490 #endif // EIGEN2_SUPPORT 494 template<
typename Dest>
inline void evalTo(Dest& )
const 506 #ifdef EIGEN_INTERNAL_DEBUGGING 508 &&
EIGEN_IMPLIES(MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1,
int(!IsRowMajor))),
509 INVALID_STORAGE_ORDER_FOR_THIS_VECTOR_EXPRESSION)
521 #endif // EIGEN_DENSEBASE_H Generic expression of a matrix where all coefficients are defined by a functor.
#define EIGEN_STATIC_ASSERT_SIZE_1x1(TYPE)
CwiseNullaryOp< internal::linspaced_op< Scalar, true >, Derived > RandomAccessLinSpacedReturnType
Enforce aligned packet loads and stores regardless of what is requested.
internal::packet_traits< Scalar >::type PacketScalar
#define EIGEN_STRONG_INLINE
internal::traits< Derived >::Scalar Scalar
#define EIGEN_ONLY_USED_FOR_DEBUG(x)
Base::CoeffReturnType CoeffReturnType
Expression with modified flags.
BooleanType isZero(real_t x, real_t TOL=ZERO)
internal::traits< Derived >::Index Index
The type of indices.
internal::traits< Derived >::StorageKind StorageKind
Expression of the transpose of a matrix.
static void check_DenseIndex_is_signed()
internal::add_const< Transpose< const Derived > >::type ConstTransposeReturnType
DenseCoeffsBase< Derived > Base
const VectorwiseOp< const Derived, Horizontal > ConstRowwiseReturnType
iterative scaling algorithm to equilibrate rows and column norms in matrices
CwiseNullaryOp< internal::linspaced_op< Scalar, false >, Derived > SequentialLinSpacedReturnType
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
Pseudo expression providing partial reduction operations.
VectorwiseOp< Derived, Horizontal > RowwiseReturnType
bool isMuchSmallerThan(const Scalar &x, const OtherScalar &y, typename NumTraits< Scalar >::Real precision=NumTraits< Scalar >::dummy_precision())
const unsigned int RowMajorBit
Base class for all dense matrices, vectors, and arrays.
const Reverse< const Derived, BothDirections > ConstReverseReturnType
void resize(Index newSize)
Helper class used by the comma initializer operator.
internal::add_const_on_value_type< typename internal::eval< Derived >::type >::type EvalReturnType
ExportArithmeticStatement operator-=(const ExportVariable &arg1, const ExportVariable &arg2)
Reverse< Derived, BothDirections > ReverseReturnType
CoeffReturnType value() const
bool isApprox(const Scalar &x, const Scalar &y, typename NumTraits< Scalar >::Real precision=NumTraits< Scalar >::dummy_precision())
Dense storage base class for matrices and arrays.
Expression of the multiple replication of a matrix or vector.
void resize(Index nbRows, Index nbCols)
ExportArithmeticStatement operator+=(const ExportVariable &arg1, const ExportVariable &arg2)
Expression which must be nested by value.
ExportStatementBlock & operator<<(ExportStatementBlock &_block, const ExportStatement &_statement)
NumTraits< Scalar >::Real RealScalar
Expression of a fixed-size or dynamic-size block.
CwiseNullaryOp< internal::scalar_constant_op< Scalar >, Derived > ConstantReturnType
Matrix< typename NumTraits< typename internal::traits< Derived >::Scalar >::Real, internal::traits< Derived >::ColsAtCompileTime, 1 > EigenvaluesReturnType
VectorwiseOp< Derived, Vertical > ColwiseReturnType
EIGEN_STRONG_INLINE EvalReturnType eval() const
void swap(const DenseBase< OtherDerived > &other, int=OtherDerived::ThisConstantIsPrivateInPlainObjectBase)
const VectorwiseOp< const Derived, Vertical > ConstColwiseReturnType
#define EIGEN_IMPLIES(a, b)
The matrix class, also used for vectors and row-vectors.
Expression of the reverse of a vector or matrix.
void evalTo(Dest &) const
void swap(PlainObjectBase< OtherDerived > &other)
Expression of a coefficient wise version of the C++ ternary operator ?: