DenseBase.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2007-2010 Benoit Jacob <jacob.benoit.1@gmail.com>
5 // Copyright (C) 2008-2010 Gael Guennebaud <gael.guennebaud@inria.fr>
6 //
7 // This Source Code Form is subject to the terms of the Mozilla
8 // Public License v. 2.0. If a copy of the MPL was not distributed
9 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 
11 #ifndef EIGEN_DENSEBASE_H
12 #define EIGEN_DENSEBASE_H
13 
14 #include "./InternalHeaderCheck.h"
15 
16 namespace Eigen {
17 
18 // The index type defined by EIGEN_DEFAULT_DENSE_INDEX_TYPE must be a signed type.
19 EIGEN_STATIC_ASSERT(NumTraits<DenseIndex>::IsSigned,THE_INDEX_TYPE_MUST_BE_A_SIGNED_TYPE)
20 
21 
36 template<typename Derived> class DenseBase
37 #ifndef EIGEN_PARSED_BY_DOXYGEN
39 #else
41 #endif // not EIGEN_PARSED_BY_DOXYGEN
42 {
43  public:
44 
48  typedef Eigen::InnerIterator<Derived> InnerIterator;
49 
50  typedef typename internal::traits<Derived>::StorageKind StorageKind;
51 
58  typedef typename internal::traits<Derived>::StorageIndex StorageIndex;
59 
61  typedef typename internal::traits<Derived>::Scalar Scalar;
62 
66  typedef Scalar value_type;
67 
70 
71  using Base::derived;
72  using Base::const_cast_derived;
73  using Base::rows;
74  using Base::cols;
75  using Base::size;
76  using Base::rowIndexByOuterInner;
77  using Base::colIndexByOuterInner;
78  using Base::coeff;
79  using Base::coeffByOuterInner;
80  using Base::operator();
81  using Base::operator[];
82  using Base::x;
83  using Base::y;
84  using Base::z;
85  using Base::w;
86  using Base::stride;
87  using Base::innerStride;
88  using Base::outerStride;
89  using Base::rowStride;
90  using Base::colStride;
91  typedef typename Base::CoeffReturnType CoeffReturnType;
92 
93  enum {
94 
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,
135  MaxSizeAtCompileTime = internal::size_at_compile_time(internal::traits<Derived>::MaxRowsAtCompileTime,
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,
164  IsRowMajor = int(Flags) & RowMajorBit,
166  InnerSizeAtCompileTime = int(IsVectorAtCompileTime) ? int(SizeAtCompileTime)
167  : int(IsRowMajor) ? int(ColsAtCompileTime) : int(RowsAtCompileTime),
168 
169  InnerStrideAtCompileTime = internal::inner_stride_at_compile_time<Derived>::ret,
170  OuterStrideAtCompileTime = internal::outer_stride_at_compile_time<Derived>::ret
171  };
172 
173  typedef typename internal::find_best_packet<Scalar,SizeAtCompileTime>::type PacketScalar;
174 
175  enum { IsPlainObjectBase = 0 };
176 
180  internal::traits<Derived>::RowsAtCompileTime,
181  internal::traits<Derived>::ColsAtCompileTime,
182  AutoAlign | (internal::traits<Derived>::Flags&RowMajorBit ? RowMajor : ColMajor),
183  internal::traits<Derived>::MaxRowsAtCompileTime,
184  internal::traits<Derived>::MaxColsAtCompileTime
186 
190  internal::traits<Derived>::RowsAtCompileTime,
191  internal::traits<Derived>::ColsAtCompileTime,
192  AutoAlign | (internal::traits<Derived>::Flags&RowMajorBit ? RowMajor : ColMajor),
193  internal::traits<Derived>::MaxRowsAtCompileTime,
194  internal::traits<Derived>::MaxColsAtCompileTime
196 
203  typedef std::conditional_t<internal::is_same<typename internal::traits<Derived>::XprKind,MatrixXpr >::value,
205 
212  Index outerSize() const
213  {
214  return IsVectorAtCompileTime ? 1
215  : int(IsRowMajor) ? this->rows() : this->cols();
216  }
217 
224  Index innerSize() const
225  {
226  return IsVectorAtCompileTime ? this->size()
227  : int(IsRowMajor) ? this->cols() : this->rows();
228  }
229 
235  void resize(Index newSize)
236  {
237  EIGEN_ONLY_USED_FOR_DEBUG(newSize);
238  eigen_assert(newSize == this->size()
239  && "DenseBase::resize() does not actually allow to resize.");
240  }
247  {
250  eigen_assert(rows == this->rows() && cols == this->cols()
251  && "DenseBase::resize() does not actually allow to resize.");
252  }
253 
254 #ifndef EIGEN_PARSED_BY_DOXYGEN
256  typedef CwiseNullaryOp<internal::scalar_constant_op<Scalar>,PlainObject> ConstantReturnType;
258  EIGEN_DEPRECATED typedef CwiseNullaryOp<internal::linspaced_op<Scalar>,PlainObject> SequentialLinSpacedReturnType;
260  typedef CwiseNullaryOp<internal::linspaced_op<Scalar>,PlainObject> RandomAccessLinSpacedReturnType;
262  typedef CwiseNullaryOp<internal::equalspaced_op<Scalar>, PlainObject> RandomAccessEqualSpacedReturnType;
264  typedef Matrix<typename NumTraits<typename internal::traits<Derived>::Scalar>::Real, internal::traits<Derived>::ColsAtCompileTime, 1> EigenvaluesReturnType;
265 
266 #endif // not EIGEN_PARSED_BY_DOXYGEN
267 
269  template<typename OtherDerived>
270  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
271  Derived& operator=(const DenseBase<OtherDerived>& other);
272 
276  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
277  Derived& operator=(const DenseBase& other);
278 
279  template<typename OtherDerived>
281  Derived& operator=(const EigenBase<OtherDerived> &other);
282 
283  template<typename OtherDerived>
285  Derived& operator+=(const EigenBase<OtherDerived> &other);
286 
287  template<typename OtherDerived>
289  Derived& operator-=(const EigenBase<OtherDerived> &other);
290 
291  template<typename OtherDerived>
293  Derived& operator=(const ReturnByValue<OtherDerived>& func);
294 
297  template<typename OtherDerived>
300  Derived& lazyAssign(const DenseBase<OtherDerived>& other);
301 
304 
305  template<unsigned int Added,unsigned int Removed>
308  const Derived& flagged() const
309  { return derived(); }
310 
311  template<typename OtherDerived>
314 
317  TransposeReturnType transpose();
320  const ConstTransposeReturnType transpose() const;
322  void transposeInPlace();
323 
324  EIGEN_DEVICE_FUNC static const ConstantReturnType
325  Constant(Index rows, Index cols, const Scalar& value);
326  EIGEN_DEVICE_FUNC static const ConstantReturnType
327  Constant(Index size, const Scalar& value);
328  EIGEN_DEVICE_FUNC static const ConstantReturnType
329  Constant(const Scalar& value);
330 
331  EIGEN_DEPRECATED EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType
332  LinSpaced(Sequential_t, Index size, const Scalar& low, const Scalar& high);
333  EIGEN_DEPRECATED EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType
334  LinSpaced(Sequential_t, const Scalar& low, const Scalar& high);
335 
336  EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType
337  LinSpaced(Index size, const Scalar& low, const Scalar& high);
338  EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType
339  LinSpaced(const Scalar& low, const Scalar& high);
340 
341  EIGEN_DEVICE_FUNC static const RandomAccessEqualSpacedReturnType
342  EqualSpaced(Index size, const Scalar& low, const Scalar& step);
343  EIGEN_DEVICE_FUNC static const RandomAccessEqualSpacedReturnType
344  EqualSpaced(const Scalar& low, const Scalar& step);
345 
346  template<typename CustomNullaryOp> EIGEN_DEVICE_FUNC
348  NullaryExpr(Index rows, Index cols, const CustomNullaryOp& func);
349  template<typename CustomNullaryOp> EIGEN_DEVICE_FUNC
351  NullaryExpr(Index size, const CustomNullaryOp& func);
352  template<typename CustomNullaryOp> EIGEN_DEVICE_FUNC
354  NullaryExpr(const CustomNullaryOp& func);
355 
356  EIGEN_DEVICE_FUNC static const ConstantReturnType Zero(Index rows, Index cols);
357  EIGEN_DEVICE_FUNC static const ConstantReturnType Zero(Index size);
358  EIGEN_DEVICE_FUNC static const ConstantReturnType Zero();
359  EIGEN_DEVICE_FUNC static const ConstantReturnType Ones(Index rows, Index cols);
360  EIGEN_DEVICE_FUNC static const ConstantReturnType Ones(Index size);
361  EIGEN_DEVICE_FUNC static const ConstantReturnType Ones();
362 
363  EIGEN_DEVICE_FUNC void fill(const Scalar& value);
364  EIGEN_DEVICE_FUNC Derived& setConstant(const Scalar& value);
365  EIGEN_DEVICE_FUNC Derived& setLinSpaced(Index size, const Scalar& low, const Scalar& high);
366  EIGEN_DEVICE_FUNC Derived& setLinSpaced(const Scalar& low, const Scalar& high);
367  EIGEN_DEVICE_FUNC Derived& setEqualSpaced(Index size, const Scalar& low, const Scalar& step);
368  EIGEN_DEVICE_FUNC Derived& setEqualSpaced(const Scalar& low, const Scalar& step);
369  EIGEN_DEVICE_FUNC Derived& setZero();
370  EIGEN_DEVICE_FUNC Derived& setOnes();
371  EIGEN_DEVICE_FUNC Derived& setRandom();
372 
373  template<typename OtherDerived> EIGEN_DEVICE_FUNC
374  bool isApprox(const DenseBase<OtherDerived>& other,
375  const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
377  bool isMuchSmallerThan(const RealScalar& other,
378  const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
379  template<typename OtherDerived> EIGEN_DEVICE_FUNC
380  bool isMuchSmallerThan(const DenseBase<OtherDerived>& other,
381  const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
382 
383  EIGEN_DEVICE_FUNC bool isApproxToConstant(const Scalar& value, const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
384  EIGEN_DEVICE_FUNC bool isConstant(const Scalar& value, const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
385  EIGEN_DEVICE_FUNC bool isZero(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
386  EIGEN_DEVICE_FUNC bool isOnes(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
387 
388  EIGEN_DEVICE_FUNC inline bool hasNaN() const;
389  EIGEN_DEVICE_FUNC inline bool allFinite() const;
390 
391  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
392  Derived& operator*=(const Scalar& other);
393  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
394  Derived& operator/=(const Scalar& other);
395 
405  EIGEN_STRONG_INLINE EvalReturnType eval() const
406  {
407  // Even though MSVC does not honor strong inlining when the return type
408  // is a dynamic matrix, we desperately need strong inlining for fixed
409  // size types on MSVC.
410  return typename internal::eval<Derived>::type(derived());
411  }
412 
416  template<typename OtherDerived>
417  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
418  void swap(const DenseBase<OtherDerived>& other)
419  {
420  EIGEN_STATIC_ASSERT(!OtherDerived::IsPlainObjectBase,THIS_EXPRESSION_IS_NOT_A_LVALUE__IT_IS_READ_ONLY);
421  eigen_assert(rows()==other.rows() && cols()==other.cols());
422  call_assignment(derived(), other.const_cast_derived(), internal::swap_assign_op<Scalar>());
423  }
424 
428  template<typename OtherDerived>
429  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
431  {
432  eigen_assert(rows()==other.rows() && cols()==other.cols());
433  call_assignment(derived(), other.derived(), internal::swap_assign_op<Scalar>());
434  }
435 
436  EIGEN_DEVICE_FUNC inline const NestByValue<Derived> nestByValue() const;
439  template<bool Enable> EIGEN_DEVICE_FUNC
440  inline const std::conditional_t<Enable,ForceAlignedAccess<Derived>,Derived&> forceAlignedAccessIf() const;
441  template<bool Enable> EIGEN_DEVICE_FUNC
442  inline std::conditional_t<Enable,ForceAlignedAccess<Derived>,Derived&> forceAlignedAccessIf();
443 
444  EIGEN_DEVICE_FUNC Scalar sum() const;
445  EIGEN_DEVICE_FUNC Scalar mean() const;
447 
448  EIGEN_DEVICE_FUNC Scalar prod() const;
449 
450  template<int NaNPropagation>
451  EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar minCoeff() const;
452  template<int NaNPropagation>
453  EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar maxCoeff() const;
454 
455 
456  // By default, the fastest version with undefined NaN propagation semantics is
457  // used.
458  // TODO(rmlarsen): Replace with default template argument when we move to
459  // c++11 or beyond.
460  EIGEN_DEVICE_FUNC inline typename internal::traits<Derived>::Scalar minCoeff() const {
461  return minCoeff<PropagateFast>();
462  }
463  EIGEN_DEVICE_FUNC inline typename internal::traits<Derived>::Scalar maxCoeff() const {
464  return maxCoeff<PropagateFast>();
465  }
466 
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;
479 
480  // TODO(rmlarsen): Replace these methods with a default template argument.
481  template<typename IndexType>
482  EIGEN_DEVICE_FUNC inline
483  typename internal::traits<Derived>::Scalar minCoeff(IndexType* row, IndexType* col) const {
484  return minCoeff<PropagateFast>(row, col);
485  }
486  template<typename IndexType>
487  EIGEN_DEVICE_FUNC inline
488  typename internal::traits<Derived>::Scalar maxCoeff(IndexType* row, IndexType* col) const {
489  return maxCoeff<PropagateFast>(row, col);
490  }
491  template<typename IndexType>
492  EIGEN_DEVICE_FUNC inline
493  typename internal::traits<Derived>::Scalar minCoeff(IndexType* index) const {
494  return minCoeff<PropagateFast>(index);
495  }
496  template<typename IndexType>
497  EIGEN_DEVICE_FUNC inline
498  typename internal::traits<Derived>::Scalar maxCoeff(IndexType* index) const {
499  return maxCoeff<PropagateFast>(index);
500  }
501 
502  template<typename BinaryOp>
504  Scalar redux(const BinaryOp& func) const;
505 
506  template<typename Visitor>
508  void visit(Visitor& func) const;
509 
517  inline const WithFormat<Derived> format(const IOFormat& fmt) const
518  {
519  return WithFormat<Derived>(derived(), fmt);
520  }
521 
525  {
527  eigen_assert(this->rows() == 1 && this->cols() == 1);
528  return derived().coeff(0,0);
529  }
530 
531  EIGEN_DEVICE_FUNC bool all() const;
532  EIGEN_DEVICE_FUNC bool any() const;
533  EIGEN_DEVICE_FUNC Index count() const;
534 
539 
547  //Code moved here due to a CUDA compiler bug
549  return ConstRowwiseReturnType(derived());
550  }
551  EIGEN_DEVICE_FUNC RowwiseReturnType rowwise();
552 
561  return ConstColwiseReturnType(derived());
562  }
563  EIGEN_DEVICE_FUNC ColwiseReturnType colwise();
564 
566  static const RandomReturnType Random(Index rows, Index cols);
567  static const RandomReturnType Random(Index size);
568  static const RandomReturnType Random();
569 
570  template <typename ThenDerived, typename ElseDerived>
571  inline EIGEN_DEVICE_FUNC
574  ThenDerived, ElseDerived, Derived>
575  select(const DenseBase<ThenDerived>& thenMatrix, const DenseBase<ElseDerived>& elseMatrix) const;
576 
577  template <typename ThenDerived>
578  inline EIGEN_DEVICE_FUNC
581  ThenDerived, typename DenseBase<ThenDerived>::ConstantReturnType, Derived>
582  select(const DenseBase<ThenDerived>& thenMatrix,
583  const typename DenseBase<ThenDerived>::Scalar& elseScalar) const;
584 
585  template <typename ElseDerived>
586  inline EIGEN_DEVICE_FUNC
589  typename DenseBase<ElseDerived>::ConstantReturnType, ElseDerived, Derived>
590  select(const typename DenseBase<ElseDerived>::Scalar& thenScalar,
591  const DenseBase<ElseDerived>& elseMatrix) const;
592 
593  template<int p> RealScalar lpNorm() const;
594 
595  template<int RowFactor, int ColFactor>
597  const Replicate<Derived,RowFactor,ColFactor> replicate() const;
606  //Code moved here due to a CUDA compiler bug
608  const Replicate<Derived, Dynamic, Dynamic> replicate(Index rowFactor, Index colFactor) const
609  {
610  return Replicate<Derived, Dynamic, Dynamic>(derived(), rowFactor, colFactor);
611  }
612 
617  //Code moved here due to a CUDA compiler bug
619  {
620  return ConstReverseReturnType(derived());
621  }
622  EIGEN_DEVICE_FUNC void reverseInPlace();
623 
624  #ifdef EIGEN_PARSED_BY_DOXYGEN
628  typedef random_access_iterator_type iterator;
630  typedef random_access_iterator_type const_iterator;
631  #else
632  typedef std::conditional_t< (Flags&DirectAccessBit)==DirectAccessBit,
633  internal::pointer_based_stl_iterator<Derived>,
634  internal::generic_randaccess_stl_iterator<Derived>
635  > iterator_type;
636 
637  typedef std::conditional_t< (Flags&DirectAccessBit)==DirectAccessBit,
638  internal::pointer_based_stl_iterator<const Derived>,
639  internal::generic_randaccess_stl_iterator<const Derived>
640  > const_iterator_type;
641 
642  // Stl-style iterators are supported only for vectors.
643 
644  typedef std::conditional_t<IsVectorAtCompileTime, iterator_type, void> iterator;
645 
646  typedef std::conditional_t<IsVectorAtCompileTime, const_iterator_type, void> const_iterator;
647  #endif
648 
649  inline iterator begin();
650  inline const_iterator begin() const;
651  inline const_iterator cbegin() const;
652  inline iterator end();
653  inline const_iterator end() const;
654  inline const_iterator cend() const;
655 
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
666 # endif
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
671 
672  // disable the use of evalTo for dense objects with a nice compilation error
673  template<typename Dest>
675  inline void evalTo(Dest& ) const
676  {
677  EIGEN_STATIC_ASSERT((internal::is_same<Dest,void>::value),THE_EVAL_EVALTO_FUNCTION_SHOULD_NEVER_BE_CALLED_FOR_DENSE_OBJECTS);
678  }
679 
680  protected:
684  /* Just checks for self-consistency of the flags.
685  * Only do it when debugging Eigen, as this borders on paranoia and could slow compilation down
686  */
687 #ifdef EIGEN_INTERNAL_DEBUGGING
688  EIGEN_STATIC_ASSERT((internal::check_implication(MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1, int(IsRowMajor))
689  && internal::check_implication(MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1, int(!IsRowMajor))),
690  INVALID_STORAGE_ORDER_FOR_THIS_VECTOR_EXPRESSION)
691 #endif
692  }
693 
694  private:
697  template<typename OtherDerived> EIGEN_DEVICE_FUNC explicit DenseBase(const DenseBase<OtherDerived>&);
698 };
699 
700 } // end namespace Eigen
701 
702 #endif // EIGEN_DENSEBASE_H
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)
A setRandom()
#define EIGEN_DEFAULT_COPY_CONSTRUCTOR(CLASS)
Definition: Macros.h:1113
#define EIGEN_DEPRECATED
Definition: Macros.h:923
#define EIGEN_CONSTEXPR
Definition: Macros.h:747
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:883
#define EIGEN_ONLY_USED_FOR_DEBUG(x)
Definition: Macros.h:914
#define eigen_assert(x)
Definition: Macros.h:902
RowVector3d w
v setConstant(3, 5)
v setOnes(3)
v setZero(3)
#define EIGEN_STATIC_ASSERT(X, MSG)
Definition: StaticAssert.h:26
#define EIGEN_STATIC_ASSERT_SIZE_1x1(TYPE)
Definition: StaticAssert.h:91
General-purpose arrays with easy API for coefficient-wise operations.
Definition: Array.h:49
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.
Definition: DenseBase.h:42
EIGEN_CONSTEXPR Index outerSize() const
Definition: DenseBase.h:212
CwiseNullaryOp< internal::scalar_random_op< Scalar >, PlainObject > RandomReturnType
Definition: DenseBase.h:565
Scalar trace() const
internal::traits< Derived >::Scalar maxCoeff(IndexType *index) const
Definition: DenseBase.h:498
DenseCoeffsBase< Derived, internal::accessors_level< Derived >::value > Base
Definition: DenseBase.h:69
NumTraits< Scalar >::Real RealScalar
Definition: DenseBase.h:68
void resize(Index rows, Index cols)
Definition: DenseBase.h:246
const ForceAlignedAccess< Derived > forceAlignedAccess() const
internal::traits< Derived >::StorageIndex StorageIndex
The type used to store indices.
Definition: DenseBase.h:58
void resize(Index newSize)
Definition: DenseBase.h:235
random_access_iterator_type const_iterator
Definition: DenseBase.h:630
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.
Definition: DenseBase.h:204
Transpose< const Derived > ConstTransposeReturnType
Definition: DenseBase.h:318
internal::traits< Derived >::StorageKind StorageKind
Definition: DenseBase.h:50
internal::add_const_on_value_type_t< typename internal::eval< Derived >::type > EvalReturnType
Definition: DenseBase.h:396
ForceAlignedAccess< Derived > forceAlignedAccess()
void swap(PlainObjectBase< OtherDerived > &other)
Definition: DenseBase.h:430
VectorwiseOp< Derived, Horizontal > RowwiseReturnType
Definition: DenseBase.h:535
Base::CoeffReturnType CoeffReturnType
Definition: DenseBase.h:91
internal::traits< Derived >::Scalar minCoeff(IndexType *row, IndexType *col) const
Definition: DenseBase.h:483
ConstColwiseReturnType colwise() const
Definition: DenseBase.h:560
EIGEN_CONSTEXPR Index innerSize() const
Definition: DenseBase.h:224
VectorwiseOp< Derived, Vertical > ColwiseReturnType
Definition: DenseBase.h:537
internal::traits< Derived >::Scalar Scalar
Definition: DenseBase.h:61
EIGEN_DEPRECATED Derived & lazyAssign(const DenseBase< OtherDerived > &other)
Reverse< Derived, BothDirections > ReverseReturnType
Definition: DenseBase.h:613
DenseBase(const DenseBase< OtherDerived > &)
RealScalar lpNorm() const
CoeffReturnType value() const
Definition: DenseBase.h:524
const VectorwiseOp< const Derived, Vertical > ConstColwiseReturnType
Definition: DenseBase.h:538
internal::traits< Derived >::Scalar maxCoeff() const
Definition: DenseBase.h:463
Scalar value_type
Definition: DenseBase.h:66
Transpose< Derived > TransposeReturnType
Definition: DenseBase.h:315
EIGEN_DEPRECATED const Derived & flagged() const
Definition: DenseBase.h:308
void evalTo(Dest &) const
Definition: DenseBase.h:675
ConstReverseReturnType reverse() const
Definition: DenseBase.h:618
Scalar redux(const BinaryOp &func) const
ConstRowwiseReturnType rowwise() const
Definition: DenseBase.h:548
EvalReturnType eval() const
Definition: DenseBase.h:405
internal::traits< Derived >::Scalar maxCoeff(IndexType *row, IndexType *col) const
Definition: DenseBase.h:488
internal::traits< Derived >::Scalar minCoeff() const
Definition: DenseBase.h:460
const std::conditional_t< Enable, ForceAlignedAccess< Derived >, Derived & > forceAlignedAccessIf() const
const WithFormat< Derived > format(const IOFormat &fmt) const
Definition: DenseBase.h:517
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
Definition: DenseBase.h:173
internal::traits< Derived >::Scalar minCoeff(IndexType *index) const
Definition: DenseBase.h:493
DenseBase(int, int)
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
Definition: DenseBase.h:536
const Reverse< const Derived, BothDirections > ConstReverseReturnType
Definition: DenseBase.h:614
random_access_iterator_type iterator
Definition: DenseBase.h:628
void swap(const DenseBase< OtherDerived > &other)
Definition: DenseBase.h:418
const Replicate< Derived, Dynamic, Dynamic > replicate(Index rowFactor, Index colFactor) const
Definition: DenseBase.h:608
Base class providing direct read/write coefficient access to matrices and arrays.
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: EigenBase.h:65
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: EigenBase.h:62
Enforce aligned packet loads and stores regardless of what is requested.
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:182
Expression which must be nested by value.
Definition: NestByValue.h:42
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.
Definition: Replicate.h:65
Expression of the reverse of a vector or matrix.
Definition: Reverse.h:67
Expression of the transpose of a matrix.
Definition: Transpose.h:56
Pseudo expression providing broadcasting and partial reduction operations.
Definition: VectorwiseOp.h:188
Pseudo expression providing matrix output with given format.
Definition: IO.h:99
static const lastp1_t end
static const Eigen::internal::all_t all
@ ColMajor
Definition: Constants.h:321
@ RowMajor
Definition: Constants.h:323
@ AutoAlign
Definition: Constants.h:325
const unsigned int DirectAccessBit
Definition: Constants.h:157
const unsigned int RowMajorBit
Definition: Constants.h:68
bfloat16 & operator/=(bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:294
bfloat16 & operator*=(bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:286
bfloat16 & operator+=(bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:282
bfloat16 & operator-=(bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:290
constexpr int size_at_compile_time(int rows, int cols)
Definition: XprHelper.h:313
const Scalar & y
constexpr bool check_implication(bool a, bool b)
Definition: Meta.h:579
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
Definition: Meta.h:176
: InteropHeaders
Definition: Core:139
std::ostream & operator<<(std::ostream &s, const DiagonalBase< Derived > &m)
Definition: IO.h:257
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:82
Sequential_t
Definition: Constants.h:363
Helper class used by the comma initializer operator.
Eigen::Index Index
The interface type of indices.
Definition: EigenBase.h:41
Derived & const_cast_derived() const
Definition: EigenBase.h:54
Stores a set of parameters controlling the way matrices are printed.
Definition: IO.h:54
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:231