11 #ifndef EIGEN_DENSEBASE_H 12 #define EIGEN_DENSEBASE_H 42 #ifndef EIGEN_PARSED_BY_DOXYGEN
46 #endif // not EIGEN_PARSED_BY_DOXYGEN 77 using Base::const_cast_derived;
81 using Base::rowIndexByOuterInner;
82 using Base::colIndexByOuterInner;
84 using Base::coeffByOuterInner;
85 using Base::operator();
86 using Base::operator[];
92 using Base::innerStride;
93 using Base::outerStride;
94 using Base::rowStride;
95 using Base::colStride;
167 InnerSizeAtCompileTime = int(IsVectorAtCompileTime) ? int(SizeAtCompileTime)
168 : int(IsRowMajor) ? int(ColsAtCompileTime) : int(RowsAtCompileTime),
170 InnerStrideAtCompileTime =
internal::inner_stride_at_compile_time<Derived>::ret,
171 OuterStrideAtCompileTime =
internal::outer_stride_at_compile_time<Derived>::ret
176 enum { IsPlainObjectBase = 0 };
191 internal::traits<Derived>::RowsAtCompileTime,
192 internal::traits<Derived>::ColsAtCompileTime,
220 return IsVectorAtCompileTime ? 1
221 : int(IsRowMajor) ? this->rows() : this->cols();
232 return IsVectorAtCompileTime ? this->
size()
233 : int(IsRowMajor) ? this->cols() : this->rows();
245 &&
"DenseBase::resize() does not actually allow to resize.");
256 eigen_assert(rows == this->rows() && cols == this->cols()
257 &&
"DenseBase::resize() does not actually allow to resize.");
260 #ifndef EIGEN_PARSED_BY_DOXYGEN 270 #endif // not EIGEN_PARSED_BY_DOXYGEN 273 template<
typename OtherDerived>
281 Derived& operator=(
const DenseBase& other);
283 template<
typename OtherDerived>
287 template<
typename OtherDerived>
291 template<
typename OtherDerived>
295 template<
typename OtherDerived>
302 template<
typename OtherDerived>
310 template<
unsigned int Added,
unsigned int Removed>
313 {
return derived(); }
315 template<
typename OtherDerived>
321 TransposeReturnType transpose();
324 ConstTransposeReturnType transpose()
const;
326 void transposeInPlace();
328 EIGEN_DEVICE_FUNC
static const ConstantReturnType
330 EIGEN_DEVICE_FUNC
static const ConstantReturnType
331 Constant(
Index size,
const Scalar& value);
332 EIGEN_DEVICE_FUNC
static const ConstantReturnType
333 Constant(
const Scalar& value);
335 EIGEN_DEVICE_FUNC
static const SequentialLinSpacedReturnType
337 EIGEN_DEVICE_FUNC
static const RandomAccessLinSpacedReturnType
338 LinSpaced(
Index size,
const Scalar& low,
const Scalar& high);
339 EIGEN_DEVICE_FUNC
static const SequentialLinSpacedReturnType
340 LinSpaced(
Sequential_t,
const Scalar& low,
const Scalar& high);
341 EIGEN_DEVICE_FUNC
static const RandomAccessLinSpacedReturnType
342 LinSpaced(
const Scalar& low,
const Scalar& high);
344 template<
typename CustomNullaryOp> EIGEN_DEVICE_FUNC
346 NullaryExpr(
Index rows,
Index cols,
const CustomNullaryOp& func);
347 template<
typename CustomNullaryOp> EIGEN_DEVICE_FUNC
350 template<
typename CustomNullaryOp> EIGEN_DEVICE_FUNC
352 NullaryExpr(
const CustomNullaryOp& func);
354 EIGEN_DEVICE_FUNC
static const ConstantReturnType Zero(
Index rows,
Index cols);
355 EIGEN_DEVICE_FUNC
static const ConstantReturnType Zero(
Index size);
356 EIGEN_DEVICE_FUNC
static const ConstantReturnType Zero();
357 EIGEN_DEVICE_FUNC
static const ConstantReturnType Ones(
Index rows,
Index cols);
358 EIGEN_DEVICE_FUNC
static const ConstantReturnType Ones(
Index size);
359 EIGEN_DEVICE_FUNC
static const ConstantReturnType Ones();
361 EIGEN_DEVICE_FUNC
void fill(
const Scalar& value);
362 EIGEN_DEVICE_FUNC Derived& setConstant(
const Scalar& value);
363 EIGEN_DEVICE_FUNC Derived& setLinSpaced(
Index size,
const Scalar& low,
const Scalar& high);
364 EIGEN_DEVICE_FUNC Derived& setLinSpaced(
const Scalar& low,
const Scalar& high);
365 EIGEN_DEVICE_FUNC Derived&
setZero();
366 EIGEN_DEVICE_FUNC Derived& setOnes();
367 EIGEN_DEVICE_FUNC Derived& setRandom();
369 template<
typename OtherDerived> EIGEN_DEVICE_FUNC
373 bool isMuchSmallerThan(
const RealScalar& other,
375 template<
typename OtherDerived> EIGEN_DEVICE_FUNC
384 inline bool hasNaN()
const;
385 inline bool allFinite()
const;
412 template<
typename OtherDerived>
416 EIGEN_STATIC_ASSERT(!OtherDerived::IsPlainObjectBase,THIS_EXPRESSION_IS_NOT_A_LVALUE__IT_IS_READ_ONLY);
417 eigen_assert(rows()==other.rows() && cols()==other.cols());
424 template<
typename OtherDerived>
435 template<
bool Enable> EIGEN_DEVICE_FUNC
437 template<
bool Enable> EIGEN_DEVICE_FUNC
438 inline typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type forceAlignedAccessIf();
440 EIGEN_DEVICE_FUNC Scalar
sum()
const;
441 EIGEN_DEVICE_FUNC Scalar mean()
const;
442 EIGEN_DEVICE_FUNC Scalar trace()
const;
444 EIGEN_DEVICE_FUNC Scalar prod()
const;
449 template<
typename IndexType> EIGEN_DEVICE_FUNC
451 template<
typename IndexType> EIGEN_DEVICE_FUNC
453 template<
typename IndexType> EIGEN_DEVICE_FUNC
455 template<
typename IndexType> EIGEN_DEVICE_FUNC
458 template<
typename BinaryOp>
460 Scalar redux(
const BinaryOp& func)
const;
462 template<
typename Visitor>
464 void visit(Visitor& func)
const;
484 return derived().coeff(0,0);
487 EIGEN_DEVICE_FUNC
bool all()
const;
488 EIGEN_DEVICE_FUNC
bool any()
const;
489 EIGEN_DEVICE_FUNC
Index count()
const;
504 EIGEN_DEVICE_FUNC
inline ConstRowwiseReturnType
rowwise()
const {
505 return ConstRowwiseReturnType(derived());
507 EIGEN_DEVICE_FUNC RowwiseReturnType rowwise();
516 EIGEN_DEVICE_FUNC
inline ConstColwiseReturnType
colwise()
const {
517 return ConstColwiseReturnType(derived());
519 EIGEN_DEVICE_FUNC ColwiseReturnType colwise();
522 static const RandomReturnType Random(
Index rows,
Index cols);
523 static const RandomReturnType Random(
Index size);
524 static const RandomReturnType Random();
526 template<
typename ThenDerived,
typename ElseDerived>
531 template<
typename ThenDerived>
535 template<
typename ElseDerived>
539 template<
int p> RealScalar lpNorm()
const;
541 template<
int RowFactor,
int ColFactor>
561 EIGEN_DEVICE_FUNC ReverseReturnType reverse();
564 EIGEN_DEVICE_FUNC ConstReverseReturnType
reverse()
const 566 return ConstReverseReturnType(derived());
568 EIGEN_DEVICE_FUNC
void reverseInPlace();
570 #define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::DenseBase 571 #define EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL 572 #define EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(COND) 573 # include "../plugins/BlockMethods.h" 574 # ifdef EIGEN_DENSEBASE_PLUGIN 575 # include EIGEN_DENSEBASE_PLUGIN 577 #undef EIGEN_CURRENT_STORAGE_BASE_CLASS 578 #undef EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL 579 #undef EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF 582 template<
typename Dest>
584 inline void evalTo(Dest& )
const 596 #ifdef EIGEN_INTERNAL_DEBUGGING 598 &&
EIGEN_IMPLIES(MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1,
int(!IsRowMajor))),
599 INVALID_STORAGE_ORDER_FOR_THIS_VECTOR_EXPRESSION)
604 EIGEN_DEVICE_FUNC
explicit DenseBase(
int);
611 #endif // EIGEN_DENSEBASE_H EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index cols() const
find_best_packet_helper< Size, typename packet_traits< T >::type >::type type
Generic expression of a matrix where all coefficients are defined by a functor.
#define EIGEN_STATIC_ASSERT_SIZE_1x1(TYPE)
#define EIGEN_STRONG_INLINE
Enforce aligned packet loads and stores regardless of what is requested.
internal::traits< Derived >::Scalar Scalar
EIGEN_DEVICE_FUNC Index innerSize() const
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC half & operator*=(half &a, const half &b)
Base::CoeffReturnType CoeffReturnType
EIGEN_DEVICE_FUNC DenseBase()
std::ostream & operator<<(std::ostream &s, const Packet16uc &v)
EIGEN_DEVICE_FUNC CoeffReturnType value() const
internal::traits< Derived >::StorageKind StorageKind
Expression of the transpose of a matrix.
static void check_DenseIndex_is_signed()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rows() const
internal::add_const< Transpose< const Derived > >::type ConstTransposeReturnType
DenseCoeffsBase< Derived > Base
TFSIMD_FORCE_INLINE bool isZero() const
const VectorwiseOp< const Derived, Horizontal > ConstRowwiseReturnType
EIGEN_DEVICE_FUNC void swap(const DenseBase< OtherDerived > &other)
static constexpr size_t size(Tuple< Args... > &)
Provides access to the number of elements in a tuple as a compile-time constant expression.
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
EIGEN_DEVICE_FUNC void resize(Index newSize)
Pseudo expression providing partial reduction operations.
VectorwiseOp< Derived, Horizontal > RowwiseReturnType
EIGEN_DEVICE_FUNC ConstColwiseReturnType colwise() const
const unsigned int RowMajorBit
Base class for all dense matrices, vectors, and arrays.
#define EIGEN_IMPLIES(a, b)
const Reverse< const Derived, BothDirections > ConstReverseReturnType
Helper class used by the comma initializer operator.
internal::traits< Derived >::StorageIndex StorageIndex
The type used to store indices.
Transpose< Derived > TransposeReturnType
CwiseNullaryOp< internal::linspaced_op< Scalar, PacketScalar >, PlainObject > RandomAccessLinSpacedReturnType
internal::add_const_on_value_type< typename internal::eval< Derived >::type >::type EvalReturnType
EIGEN_DEVICE_FUNC ColXpr col(Index i)
This is the const version of col().
Reverse< Derived, BothDirections > ReverseReturnType
internal::find_best_packet< Scalar, SizeAtCompileTime >::type PacketScalar
const WithFormat< Derived > format(const IOFormat &fmt) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EvalReturnType eval() const
TFSIMD_FORCE_INLINE Vector3 & operator/=(const tfScalar &s)
EIGEN_DEVICE_FUNC const Replicate< Derived, Dynamic, Dynamic > replicate(Index rowFactor, Index colFactor) const
CwiseNullaryOp< internal::linspaced_op< Scalar, PacketScalar >, PlainObject > SequentialLinSpacedReturnType
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
EIGEN_DEVICE_FUNC RowXpr row(Index i)
This is the const version of row(). */.
Expression of the multiple replication of a matrix or vector.
EIGEN_DEPRECATED const Derived & flagged() const
TFSIMD_FORCE_INLINE Vector3 & operator-=(const Vector3 &v)
const mpreal sum(const mpreal tab[], const unsigned long int n, int &status, mp_rnd_t mode=mpreal::get_default_rnd())
EIGEN_DEVICE_FUNC ConstReverseReturnType reverse() const
TFSIMD_FORCE_INLINE Vector3 & operator+=(const Vector3 &v)
EIGEN_DEVICE_FUNC Index outerSize() const
Expression which must be nested by value.
EIGEN_DEVICE_FUNC void swap(PlainObjectBase< OtherDerived > &other)
EIGEN_DEVICE_FUNC void resize(Index rows, Index cols)
NumTraits< Scalar >::Real RealScalar
internal::conditional< internal::is_same< typename internal::traits< Derived >::XprKind, MatrixXpr >::value, PlainMatrix, PlainArray >::type PlainObject
The plain matrix or array type corresponding to this expression.
EIGEN_DEVICE_FUNC Index nonZeros() const
Matrix< typename NumTraits< typename internal::traits< Derived >::Scalar >::Real, internal::traits< Derived >::ColsAtCompileTime, 1 > EigenvaluesReturnType
VectorwiseOp< Derived, Vertical > ColwiseReturnType
General-purpose arrays with easy API for coefficient-wise operations.
CwiseNullaryOp< internal::scalar_random_op< Scalar >, PlainObject > RandomReturnType
const VectorwiseOp< const Derived, Vertical > ConstColwiseReturnType
CwiseNullaryOp< internal::scalar_constant_op< Scalar >, PlainObject > ConstantReturnType
The matrix class, also used for vectors and row-vectors.
Expression of the reverse of a vector or matrix.
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_assignment(Dst &dst, const Src &src)
EIGEN_DEVICE_FUNC ConstRowwiseReturnType rowwise() const
Eigen::InnerIterator< Derived > InnerIterator
#define EIGEN_ONLY_USED_FOR_DEBUG(x)
Expression of a coefficient wise version of the C++ ternary operator ?:
An InnerIterator allows to loop over the element of any matrix expression.