11 #ifndef EIGEN_DENSEBASE_H
12 #define EIGEN_DENSEBASE_H
37 #ifndef EIGEN_PARSED_BY_DOXYGEN
48 typedef Eigen::InnerIterator<Derived> InnerIterator;
50 typedef typename internal::traits<Derived>::StorageKind
StorageKind;
58 typedef typename internal::traits<Derived>::StorageIndex
StorageIndex;
61 typedef typename internal::traits<Derived>::Scalar
Scalar;
72 using Base::const_cast_derived;
76 using Base::rowIndexByOuterInner;
77 using Base::colIndexByOuterInner;
79 using Base::coeffByOuterInner;
80 using Base::operator();
81 using Base::operator[];
87 using Base::innerStride;
88 using Base::outerStride;
89 using Base::rowStride;
90 using Base::colStride;
95 RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime,
101 ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime,
108 SizeAtCompileTime = (internal::size_of_xpr_at_compile_time<Derived>::ret),
113 MaxRowsAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime,
124 MaxColsAtCompileTime = internal::traits<Derived>::MaxColsAtCompileTime,
136 internal::traits<Derived>::MaxColsAtCompileTime),
147 IsVectorAtCompileTime = internal::traits<Derived>::RowsAtCompileTime == 1
148 || internal::traits<Derived>::ColsAtCompileTime == 1,
154 NumDimensions = int(MaxSizeAtCompileTime) == 1 ? 0 :
bool(IsVectorAtCompileTime) ? 1 : 2,
159 Flags = internal::traits<Derived>::Flags,
166 InnerSizeAtCompileTime = int(IsVectorAtCompileTime) ? int(SizeAtCompileTime)
167 : int(IsRowMajor) ? int(ColsAtCompileTime) : int(RowsAtCompileTime),
169 InnerStrideAtCompileTime =
internal::inner_stride_at_compile_time<Derived>::ret,
170 OuterStrideAtCompileTime =
internal::outer_stride_at_compile_time<Derived>::ret
173 typedef typename internal::find_best_packet<Scalar,SizeAtCompileTime>::type
PacketScalar;
175 enum { IsPlainObjectBase = 0 };
180 internal::traits<Derived>::RowsAtCompileTime,
181 internal::traits<Derived>::ColsAtCompileTime,
183 internal::traits<Derived>::MaxRowsAtCompileTime,
184 internal::traits<Derived>::MaxColsAtCompileTime
190 internal::traits<Derived>::RowsAtCompileTime,
191 internal::traits<Derived>::ColsAtCompileTime,
193 internal::traits<Derived>::MaxRowsAtCompileTime,
194 internal::traits<Derived>::MaxColsAtCompileTime
203 typedef std::conditional_t<internal::is_same<typename internal::traits<Derived>::XprKind,
MatrixXpr >::value,
214 return IsVectorAtCompileTime ? 1
215 : int(IsRowMajor) ? this->
rows() : this->
cols();
226 return IsVectorAtCompileTime ? this->
size()
227 : int(IsRowMajor) ? this->
cols() : this->
rows();
239 &&
"DenseBase::resize() does not actually allow to resize.");
251 &&
"DenseBase::resize() does not actually allow to resize.");
254 #ifndef EIGEN_PARSED_BY_DOXYGEN
269 template<
typename OtherDerived>
277 Derived& operator=(
const DenseBase& other);
279 template<
typename OtherDerived>
283 template<
typename OtherDerived>
287 template<
typename OtherDerived>
291 template<
typename OtherDerived>
297 template<
typename OtherDerived>
305 template<
unsigned int Added,
unsigned int Removed>
309 {
return derived(); }
311 template<
typename OtherDerived>
322 void transposeInPlace();
329 Constant(
const Scalar& value);
351 NullaryExpr(
Index size,
const CustomNullaryOp& func);
354 NullaryExpr(
const CustomNullaryOp& func);
410 return typename internal::eval<Derived>::type(derived());
416 template<
typename OtherDerived>
420 EIGEN_STATIC_ASSERT(!OtherDerived::IsPlainObjectBase,THIS_EXPRESSION_IS_NOT_A_LVALUE__IT_IS_READ_ONLY);
428 template<
typename OtherDerived>
433 call_assignment(derived(), other.derived(), internal::swap_assign_op<Scalar>());
450 template<
int NaNPropagation>
452 template<
int NaNPropagation>
461 return minCoeff<PropagateFast>();
464 return maxCoeff<PropagateFast>();
467 template<
int NaNPropagation,
typename IndexType>
469 typename internal::traits<Derived>::Scalar minCoeff(IndexType*
row, IndexType*
col)
const;
470 template<
int NaNPropagation,
typename IndexType>
472 typename internal::traits<Derived>::Scalar maxCoeff(IndexType*
row, IndexType*
col)
const;
473 template<
int NaNPropagation,
typename IndexType>
475 typename internal::traits<Derived>::Scalar minCoeff(IndexType* index)
const;
476 template<
int NaNPropagation,
typename IndexType>
478 typename internal::traits<Derived>::Scalar maxCoeff(IndexType* index)
const;
481 template<
typename IndexType>
483 typename internal::traits<Derived>::Scalar
minCoeff(IndexType*
row, IndexType*
col)
const {
484 return minCoeff<PropagateFast>(
row,
col);
486 template<
typename IndexType>
488 typename internal::traits<Derived>::Scalar
maxCoeff(IndexType*
row, IndexType*
col)
const {
489 return maxCoeff<PropagateFast>(
row,
col);
491 template<
typename IndexType>
493 typename internal::traits<Derived>::Scalar
minCoeff(IndexType* index)
const {
494 return minCoeff<PropagateFast>(index);
496 template<
typename IndexType>
498 typename internal::traits<Derived>::Scalar
maxCoeff(IndexType* index)
const {
499 return maxCoeff<PropagateFast>(index);
502 template<
typename BinaryOp>
506 template<
typename Visitor>
508 void visit(Visitor& func)
const;
528 return derived().coeff(0,0);
570 template <
typename ThenDerived,
typename ElseDerived>
574 ThenDerived, ElseDerived, Derived>
577 template <
typename ThenDerived>
585 template <
typename ElseDerived>
595 template<
int RowFactor,
int ColFactor>
624 #ifdef EIGEN_PARSED_BY_DOXYGEN
633 internal::pointer_based_stl_iterator<Derived>,
634 internal::generic_randaccess_stl_iterator<Derived>
638 internal::pointer_based_stl_iterator<const Derived>,
639 internal::generic_randaccess_stl_iterator<const Derived>
640 > const_iterator_type;
644 typedef std::conditional_t<IsVectorAtCompileTime, iterator_type, void>
iterator;
646 typedef std::conditional_t<IsVectorAtCompileTime, const_iterator_type, void>
const_iterator;
656 #define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::DenseBase
657 #define EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
658 #define EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(COND)
659 #define EIGEN_DOC_UNARY_ADDONS(X,Y)
660 # include "../plugins/CommonCwiseUnaryOps.h"
661 # include "../plugins/BlockMethods.h"
662 # include "../plugins/IndexedViewMethods.h"
663 # include "../plugins/ReshapedMethods.h"
664 # ifdef EIGEN_DENSEBASE_PLUGIN
665 # include EIGEN_DENSEBASE_PLUGIN
667 #undef EIGEN_CURRENT_STORAGE_BASE_CLASS
668 #undef EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
669 #undef EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF
670 #undef EIGEN_DOC_UNARY_ADDONS
673 template<
typename Dest>
677 EIGEN_STATIC_ASSERT((internal::is_same<Dest,void>::value),THE_EVAL_EVALTO_FUNCTION_SHOULD_NEVER_BE_CALLED_FOR_DENSE_OBJECTS);
687 #ifdef EIGEN_INTERNAL_DEBUGGING
690 INVALID_STORAGE_ORDER_FOR_THIS_VECTOR_EXPRESSION)
RowXpr row(Index i)
This is the const version of row(). */.
ColXpr col(Index i)
This is the const version of col().
v setLinSpaced(5, 0.5f, 1.5f)
#define EIGEN_DEFAULT_COPY_CONSTRUCTOR(CLASS)
#define EIGEN_DEVICE_FUNC
#define EIGEN_ONLY_USED_FOR_DEBUG(x)
#define EIGEN_STATIC_ASSERT(X, MSG)
#define EIGEN_STATIC_ASSERT_SIZE_1x1(TYPE)
General-purpose arrays with easy API for coefficient-wise operations.
Generic expression of a matrix where all coefficients are defined by a functor.
Generic expression where a coefficient-wise ternary operator is applied to two expressions.
Base class for all dense matrices, vectors, and arrays.
EIGEN_CONSTEXPR Index outerSize() const
CwiseNullaryOp< internal::scalar_random_op< Scalar >, PlainObject > RandomReturnType
internal::traits< Derived >::Scalar maxCoeff(IndexType *index) const
DenseCoeffsBase< Derived, internal::accessors_level< Derived >::value > Base
NumTraits< Scalar >::Real RealScalar
void resize(Index rows, Index cols)
const ForceAlignedAccess< Derived > forceAlignedAccess() const
internal::traits< Derived >::StorageIndex StorageIndex
The type used to store indices.
void resize(Index newSize)
random_access_iterator_type const_iterator
std::conditional_t< internal::is_same< typename internal::traits< Derived >::XprKind, MatrixXpr >::value, PlainMatrix, PlainArray > PlainObject
The plain matrix or array type corresponding to this expression.
Transpose< const Derived > ConstTransposeReturnType
internal::traits< Derived >::StorageKind StorageKind
internal::add_const_on_value_type_t< typename internal::eval< Derived >::type > EvalReturnType
ForceAlignedAccess< Derived > forceAlignedAccess()
void swap(PlainObjectBase< OtherDerived > &other)
VectorwiseOp< Derived, Horizontal > RowwiseReturnType
Base::CoeffReturnType CoeffReturnType
internal::traits< Derived >::Scalar minCoeff(IndexType *row, IndexType *col) const
ConstColwiseReturnType colwise() const
EIGEN_CONSTEXPR Index innerSize() const
VectorwiseOp< Derived, Vertical > ColwiseReturnType
internal::traits< Derived >::Scalar Scalar
EIGEN_DEPRECATED Derived & lazyAssign(const DenseBase< OtherDerived > &other)
Reverse< Derived, BothDirections > ReverseReturnType
DenseBase(const DenseBase< OtherDerived > &)
RealScalar lpNorm() const
CoeffReturnType value() const
const VectorwiseOp< const Derived, Vertical > ConstColwiseReturnType
internal::traits< Derived >::Scalar maxCoeff() const
Transpose< Derived > TransposeReturnType
EIGEN_DEPRECATED const Derived & flagged() const
void evalTo(Dest &) const
ConstReverseReturnType reverse() const
Scalar redux(const BinaryOp &func) const
ConstRowwiseReturnType rowwise() const
EvalReturnType eval() const
internal::traits< Derived >::Scalar maxCoeff(IndexType *row, IndexType *col) const
internal::traits< Derived >::Scalar minCoeff() const
const std::conditional_t< Enable, ForceAlignedAccess< Derived >, Derived & > forceAlignedAccessIf() const
const WithFormat< Derived > format(const IOFormat &fmt) const
std::conditional_t< Enable, ForceAlignedAccess< Derived >, Derived & > forceAlignedAccessIf()
bool isMuchSmallerThan(const RealScalar &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
internal::find_best_packet< Scalar, SizeAtCompileTime >::type PacketScalar
internal::traits< Derived >::Scalar minCoeff(IndexType *index) const
CwiseTernaryOp< internal::scalar_boolean_select_op< typename DenseBase< ThenDerived >::Scalar, typename DenseBase< ThenDerived >::Scalar, Scalar >, ThenDerived, typename DenseBase< ThenDerived >::ConstantReturnType, Derived > select(const DenseBase< ThenDerived > &thenMatrix, const typename DenseBase< ThenDerived >::Scalar &elseScalar) const
CwiseTernaryOp< internal::scalar_boolean_select_op< typename DenseBase< ElseDerived >::Scalar, typename DenseBase< ElseDerived >::Scalar, Scalar >, typename DenseBase< ElseDerived >::ConstantReturnType, ElseDerived, Derived > select(const typename DenseBase< ElseDerived >::Scalar &thenScalar, const DenseBase< ElseDerived > &elseMatrix) const
CwiseTernaryOp< internal::scalar_boolean_select_op< typename DenseBase< ThenDerived >::Scalar, typename DenseBase< ElseDerived >::Scalar, Scalar >, ThenDerived, ElseDerived, Derived > select(const DenseBase< ThenDerived > &thenMatrix, const DenseBase< ElseDerived > &elseMatrix) const
const VectorwiseOp< const Derived, Horizontal > ConstRowwiseReturnType
const Reverse< const Derived, BothDirections > ConstReverseReturnType
random_access_iterator_type iterator
void swap(const DenseBase< OtherDerived > &other)
const Replicate< Derived, Dynamic, Dynamic > replicate(Index rowFactor, Index colFactor) const
Base class providing direct read/write coefficient access to matrices and arrays.
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Enforce aligned packet loads and stores regardless of what is requested.
The matrix class, also used for vectors and row-vectors.
Expression which must be nested by value.
Dense storage base class for matrices and arrays.
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Expression of the multiple replication of a matrix or vector.
Expression of the reverse of a vector or matrix.
Expression of the transpose of a matrix.
Pseudo expression providing broadcasting and partial reduction operations.
static const lastp1_t end
static const Eigen::internal::all_t all
const unsigned int DirectAccessBit
const unsigned int RowMajorBit
bfloat16 & operator/=(bfloat16 &a, const bfloat16 &b)
bfloat16 & operator*=(bfloat16 &a, const bfloat16 &b)
bfloat16 & operator+=(bfloat16 &a, const bfloat16 &b)
bfloat16 & operator-=(bfloat16 &a, const bfloat16 &b)
constexpr int size_at_compile_time(int rows, int cols)
constexpr bool check_implication(bool a, bool b)
void call_assignment(Dst &dst, const Src &src)
bool isApprox(const Scalar &x, const Scalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
bool isMuchSmallerThan(const Scalar &x, const OtherScalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
typename add_const_on_value_type< T >::type add_const_on_value_type_t
std::ostream & operator<<(std::ostream &s, const DiagonalBase< Derived > &m)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Helper class used by the comma initializer operator.
Eigen::Index Index
The interface type of indices.
Derived & const_cast_derived() const
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.