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 // IWYU pragma: private
15 #include "./InternalHeaderCheck.h"
16 
17 namespace Eigen {
18 
19 // The index type defined by EIGEN_DEFAULT_DENSE_INDEX_TYPE must be a signed type.
20 EIGEN_STATIC_ASSERT(NumTraits<DenseIndex>::IsSigned, THE_INDEX_TYPE_MUST_BE_A_SIGNED_TYPE)
21 
22 
37 template <typename Derived>
38 class DenseBase
39 #ifndef EIGEN_PARSED_BY_DOXYGEN
40  : public DenseCoeffsBase<Derived, internal::accessors_level<Derived>::value>
41 #else
42  : public DenseCoeffsBase<Derived, DirectWriteAccessors>
43 #endif // not EIGEN_PARSED_BY_DOXYGEN
44 {
45  public:
50 
52 
60 
63 
67  typedef Scalar value_type;
68 
71 
72  using Base::coeff;
73  using Base::coeffByOuterInner;
74  using Base::colIndexByOuterInner;
75  using Base::cols;
76  using Base::const_cast_derived;
77  using Base::derived;
78  using Base::rowIndexByOuterInner;
79  using Base::rows;
80  using Base::size;
81  using Base::operator();
82  using Base::operator[];
83  using Base::colStride;
84  using Base::innerStride;
85  using Base::outerStride;
86  using Base::rowStride;
87  using Base::stride;
88  using Base::w;
89  using Base::x;
90  using Base::y;
91  using Base::z;
92  typedef typename Base::CoeffReturnType CoeffReturnType;
93 
94  enum {
95 
156  : 2,
171 
172  InnerStrideAtCompileTime = internal::inner_stride_at_compile_time<Derived>::ret,
173  OuterStrideAtCompileTime = internal::outer_stride_at_compile_time<Derived>::ret
174  };
175 
177 
178  enum { IsPlainObjectBase = 0 };
179 
187 
195 
202  typedef std::conditional_t<internal::is_same<typename internal::traits<Derived>::XprKind, MatrixXpr>::value,
205 
212  return IsVectorAtCompileTime ? 1 : int(IsRowMajor) ? this->rows() : this->cols();
213  }
214 
221  return IsVectorAtCompileTime ? this->size() : int(IsRowMajor) ? this->cols() : this->rows();
222  }
223 
229  EIGEN_ONLY_USED_FOR_DEBUG(newSize);
230  eigen_assert(newSize == this->size() && "DenseBase::resize() does not actually allow to resize.");
231  }
239  eigen_assert(rows == this->rows() && cols == this->cols() &&
240  "DenseBase::resize() does not actually allow to resize.");
241  }
242 
243 #ifndef EIGEN_PARSED_BY_DOXYGEN
258 
259 #endif // not EIGEN_PARSED_BY_DOXYGEN
260 
262  template <typename OtherDerived>
264 
269 
270  template <typename OtherDerived>
271  EIGEN_DEVICE_FUNC Derived& operator=(const EigenBase<OtherDerived>& other);
272 
273  template <typename OtherDerived>
275 
276  template <typename OtherDerived>
278 
279  template <typename OtherDerived>
281 
284  template <typename OtherDerived>
287 
289 
290  template <unsigned int Added, unsigned int Removed>
292  EIGEN_DEPRECATED const Derived& flagged() const {
293  return derived();
294  }
295 
296  template <typename OtherDerived>
298 
304 
308 
310  const Scalar& low,
311  const Scalar& high);
313  const Scalar& low,
314  const Scalar& high);
315 
317  const Scalar& high);
318  EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType LinSpaced(const Scalar& low, const Scalar& high);
319 
321  const Scalar& step);
322  EIGEN_DEVICE_FUNC static const RandomAccessEqualSpacedReturnType EqualSpaced(const Scalar& low, const Scalar& step);
323 
324  template <typename CustomNullaryOp>
326  const CustomNullaryOp& func);
327  template <typename CustomNullaryOp>
329  const CustomNullaryOp& func);
330  template <typename CustomNullaryOp>
332 
335  EIGEN_DEVICE_FUNC static const ZeroReturnType Zero();
339 
340  EIGEN_DEVICE_FUNC void fill(const Scalar& value);
341  EIGEN_DEVICE_FUNC Derived& setConstant(const Scalar& value);
342  EIGEN_DEVICE_FUNC Derived& setLinSpaced(Index size, const Scalar& low, const Scalar& high);
343  EIGEN_DEVICE_FUNC Derived& setLinSpaced(const Scalar& low, const Scalar& high);
344  EIGEN_DEVICE_FUNC Derived& setEqualSpaced(Index size, const Scalar& low, const Scalar& step);
345  EIGEN_DEVICE_FUNC Derived& setEqualSpaced(const Scalar& low, const Scalar& step);
346  EIGEN_DEVICE_FUNC Derived& setZero();
347  EIGEN_DEVICE_FUNC Derived& setOnes();
348  EIGEN_DEVICE_FUNC Derived& setRandom();
349 
350  template <typename OtherDerived>
352  const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
354  const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
355  template <typename OtherDerived>
357  const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
358 
360  const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
362  const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
365 
366  EIGEN_DEVICE_FUNC inline bool hasNaN() const;
367  EIGEN_DEVICE_FUNC inline bool allFinite() const;
368 
371 
382  // Even though MSVC does not honor strong inlining when the return type
383  // is a dynamic matrix, we desperately need strong inlining for fixed
384  // size types on MSVC.
385  return typename internal::eval<Derived>::type(derived());
386  }
387 
391  template <typename OtherDerived>
393  EIGEN_STATIC_ASSERT(!OtherDerived::IsPlainObjectBase, THIS_EXPRESSION_IS_NOT_A_LVALUE__IT_IS_READ_ONLY);
394  eigen_assert(rows() == other.rows() && cols() == other.cols());
395  call_assignment(derived(), other.const_cast_derived(), internal::swap_assign_op<Scalar>());
396  }
397 
401  template <typename OtherDerived>
403  eigen_assert(rows() == other.rows() && cols() == other.cols());
404  call_assignment(derived(), other.derived(), internal::swap_assign_op<Scalar>());
405  }
406 
410  template <bool Enable>
411  EIGEN_DEVICE_FUNC inline const std::conditional_t<Enable, ForceAlignedAccess<Derived>, Derived&>
413  template <bool Enable>
414  EIGEN_DEVICE_FUNC inline std::conditional_t<Enable, ForceAlignedAccess<Derived>, Derived&> forceAlignedAccessIf();
415 
416  EIGEN_DEVICE_FUNC Scalar sum() const;
417  EIGEN_DEVICE_FUNC Scalar mean() const;
419 
420  EIGEN_DEVICE_FUNC Scalar prod() const;
421 
422  template <int NaNPropagation>
424  template <int NaNPropagation>
426 
427  // By default, the fastest version with undefined NaN propagation semantics is
428  // used.
429  // TODO(rmlarsen): Replace with default template argument when we move to
430  // c++11 or beyond.
432  return minCoeff<PropagateFast>();
433  }
435  return maxCoeff<PropagateFast>();
436  }
437 
438  template <int NaNPropagation, typename IndexType>
439  EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar minCoeff(IndexType* row, IndexType* col) const;
440  template <int NaNPropagation, typename IndexType>
441  EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar maxCoeff(IndexType* row, IndexType* col) const;
442  template <int NaNPropagation, typename IndexType>
443  EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar minCoeff(IndexType* index) const;
444  template <int NaNPropagation, typename IndexType>
445  EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar maxCoeff(IndexType* index) const;
446 
447  // TODO(rmlarsen): Replace these methods with a default template argument.
448  template <typename IndexType>
449  EIGEN_DEVICE_FUNC inline typename internal::traits<Derived>::Scalar minCoeff(IndexType* row, IndexType* col) const {
450  return minCoeff<PropagateFast>(row, col);
451  }
452  template <typename IndexType>
453  EIGEN_DEVICE_FUNC inline typename internal::traits<Derived>::Scalar maxCoeff(IndexType* row, IndexType* col) const {
454  return maxCoeff<PropagateFast>(row, col);
455  }
456  template <typename IndexType>
457  EIGEN_DEVICE_FUNC inline typename internal::traits<Derived>::Scalar minCoeff(IndexType* index) const {
458  return minCoeff<PropagateFast>(index);
459  }
460  template <typename IndexType>
461  EIGEN_DEVICE_FUNC inline typename internal::traits<Derived>::Scalar maxCoeff(IndexType* index) const {
462  return maxCoeff<PropagateFast>(index);
463  }
464 
465  template <typename BinaryOp>
466  EIGEN_DEVICE_FUNC Scalar redux(const BinaryOp& func) const;
467 
468  template <typename Visitor>
469  EIGEN_DEVICE_FUNC void visit(Visitor& func) const;
470 
478  inline const WithFormat<Derived> format(const IOFormat& fmt) const { return WithFormat<Derived>(derived(), fmt); }
479 
482  EIGEN_STATIC_ASSERT_SIZE_1x1(Derived) eigen_assert(this->rows() == 1 && this->cols() == 1);
483  return derived().coeff(0, 0);
484  }
485 
486  EIGEN_DEVICE_FUNC bool all() const;
487  EIGEN_DEVICE_FUNC bool any() const;
488  EIGEN_DEVICE_FUNC Index count() const;
489 
494 
502  // Code moved here due to a CUDA compiler bug
505 
515 
517  static const RandomReturnType Random(Index rows, Index cols);
518  static const RandomReturnType Random(Index size);
519  static const RandomReturnType Random();
520 
521  template <typename ThenDerived, typename ElseDerived>
522  inline EIGEN_DEVICE_FUNC
525  ThenDerived, ElseDerived, Derived>
526  select(const DenseBase<ThenDerived>& thenMatrix, const DenseBase<ElseDerived>& elseMatrix) const;
527 
528  template <typename ThenDerived>
529  inline EIGEN_DEVICE_FUNC
532  ThenDerived, typename DenseBase<ThenDerived>::ConstantReturnType, Derived>
533  select(const DenseBase<ThenDerived>& thenMatrix, const typename DenseBase<ThenDerived>::Scalar& elseScalar) const;
534 
535  template <typename ElseDerived>
536  inline EIGEN_DEVICE_FUNC
539  typename DenseBase<ElseDerived>::ConstantReturnType, ElseDerived, Derived>
540  select(const typename DenseBase<ElseDerived>::Scalar& thenScalar, const DenseBase<ElseDerived>& elseMatrix) const;
541 
542  template <int p>
544 
545  template <int RowFactor, int ColFactor>
555  // Code moved here due to a CUDA compiler bug
557  return Replicate<Derived, Dynamic, Dynamic>(derived(), rowFactor, colFactor);
558  }
559 
564  // Code moved here due to a CUDA compiler bug
567 
568 #ifdef EIGEN_PARSED_BY_DOXYGEN
572  typedef random_access_iterator_type iterator;
574  typedef random_access_iterator_type const_iterator;
575 #else
576  typedef std::conditional_t<(Flags & DirectAccessBit) == DirectAccessBit,
580 
581  typedef std::conditional_t<(Flags & DirectAccessBit) == DirectAccessBit,
585 
586  // Stl-style iterators are supported only for vectors.
587 
588  typedef std::conditional_t<IsVectorAtCompileTime, iterator_type, void> iterator;
589 
590  typedef std::conditional_t<IsVectorAtCompileTime, const_iterator_type, void> const_iterator;
591 #endif
592 
593  inline iterator begin();
594  inline const_iterator begin() const;
595  inline const_iterator cbegin() const;
596  inline iterator end();
597  inline const_iterator end() const;
598  inline const_iterator cend() const;
599 
600 #define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::DenseBase
601 #define EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
602 #define EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(COND)
603 #define EIGEN_DOC_UNARY_ADDONS(X, Y)
604 #include "../plugins/CommonCwiseUnaryOps.inc"
605 #include "../plugins/BlockMethods.inc"
606 #include "../plugins/IndexedViewMethods.inc"
607 #include "../plugins/ReshapedMethods.inc"
608 #ifdef EIGEN_DENSEBASE_PLUGIN
609 #include EIGEN_DENSEBASE_PLUGIN
610 #endif
611 #undef EIGEN_CURRENT_STORAGE_BASE_CLASS
612 #undef EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
613 #undef EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF
614 #undef EIGEN_DOC_UNARY_ADDONS
615 
616  // disable the use of evalTo for dense objects with a nice compilation error
617  template <typename Dest>
618  EIGEN_DEVICE_FUNC inline void evalTo(Dest&) const {
620  THE_EVAL_EVALTO_FUNCTION_SHOULD_NEVER_BE_CALLED_FOR_DENSE_OBJECTS);
621  }
622 
623  protected:
626 #ifdef EIGEN_INTERNAL_DEBUGGING
627  EIGEN_DEVICE_FUNC constexpr DenseBase() {
628  /* Just checks for self-consistency of the flags.
629  * Only do it when debugging Eigen, as this borders on paranoia and could slow compilation down
630  */
634  INVALID_STORAGE_ORDER_FOR_THIS_VECTOR_EXPRESSION)
635  }
636 #else
637  EIGEN_DEVICE_FUNC constexpr DenseBase() = default;
638 #endif
639 
640  private:
643  template <typename OtherDerived>
645 };
646 
649 template <typename DerivedA, typename DerivedB>
651  // Use forwarding references to capture all combinations of cv-qualified l+r-value cases.
652  std::enable_if_t<std::is_base_of<DenseBase<std::decay_t<DerivedA>>, std::decay_t<DerivedA>>::value &&
653  std::is_base_of<DenseBase<std::decay_t<DerivedB>>, std::decay_t<DerivedB>>::value,
654  void>
655  swap(DerivedA&& a, DerivedB&& b) {
656  a.swap(b);
657 }
658 
659 } // end namespace Eigen
660 
661 #endif // EIGEN_DENSEBASE_H
#define EIGEN_DEFAULT_COPY_CONSTRUCTOR(CLASS)
Macro to explicitly define the default copy constructor. This is necessary, because the implicit defi...
Definition: Macros.h:1119
#define EIGEN_DEPRECATED
Definition: Macros.h:931
#define EIGEN_CONSTEXPR
Definition: Macros.h:758
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:892
#define EIGEN_ONLY_USED_FOR_DEBUG(x)
Definition: Macros.h:922
#define eigen_assert(x)
Definition: Macros.h:910
#define EIGEN_STRONG_INLINE
Definition: Macros.h:834
m col(1)
m row(1)
RowVector3d w
Definition: Matrix_resize_int.cpp:3
#define EIGEN_STATIC_ASSERT(X, MSG)
Definition: StaticAssert.h:26
#define EIGEN_STATIC_ASSERT_SIZE_1x1(TYPE)
Definition: StaticAssert.h:82
int rows
Definition: Tutorial_commainit_02.cpp:1
int cols
Definition: Tutorial_commainit_02.cpp:1
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
Scalar * b
Definition: benchVecAdd.cpp:17
boost::multiprecision::number< boost::multiprecision::cpp_dec_float< 100 >, boost::multiprecision::et_on > Real
Definition: boostmultiprec.cpp:77
General-purpose arrays with easy API for coefficient-wise operations.
Definition: Array.h:48
Generic expression of a matrix where all coefficients are defined by a functor.
Definition: CwiseNullaryOp.h:64
Generic expression where a coefficient-wise ternary operator is applied to two expressions.
Definition: CwiseTernaryOp.h:86
Base class for all dense matrices, vectors, and arrays.
Definition: DenseBase.h:44
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar minCoeff(IndexType *index) const
Definition: DenseBase.h:457
EIGEN_DEVICE_FUNC 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
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar minCoeff(IndexType *row, IndexType *col) const
Definition: DenseBase.h:449
static EIGEN_DEVICE_FUNC const CwiseNullaryOp< CustomNullaryOp, PlainObject > NullaryExpr(Index size, const CustomNullaryOp &func)
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index innerSize() const
Definition: DenseBase.h:220
static EIGEN_DEVICE_FUNC const ConstantReturnType Constant(Index rows, Index cols, const Scalar &value)
Definition: CwiseNullaryOp.h:186
EIGEN_DEVICE_FUNC DenseBase(int, int)
EIGEN_DEVICE_FUNC void reverseInPlace()
Definition: Reverse.h:129
static EIGEN_DEVICE_FUNC const ConstantReturnType Ones()
Definition: CwiseNullaryOp.h:669
EIGEN_DEVICE_FUNC void resize(Index newSize)
Definition: DenseBase.h:228
EIGEN_DEVICE_FUNC Derived & setLinSpaced(Index size, const Scalar &low, const Scalar &high)
Sets a linearly spaced vector.
Definition: CwiseNullaryOp.h:432
DenseCoeffsBase< Derived, internal::accessors_level< Derived >::value > Base
Definition: DenseBase.h:70
EIGEN_DEVICE_FUNC Derived & setConstant(const Scalar &value)
Definition: CwiseNullaryOp.h:349
EIGEN_DEVICE_FUNC bool all() const
Definition: Visitor.h:739
@ IsVectorAtCompileTime
Definition: DenseBase.h:147
@ SizeAtCompileTime
Definition: DenseBase.h:108
@ MaxSizeAtCompileTime
Definition: DenseBase.h:135
@ IsRowMajor
Definition: DenseBase.h:166
@ NumDimensions
Definition: DenseBase.h:154
@ OuterStrideAtCompileTime
Definition: DenseBase.h:173
@ ColsAtCompileTime
Definition: DenseBase.h:102
@ InnerSizeAtCompileTime
Definition: DenseBase.h:168
@ InnerStrideAtCompileTime
Definition: DenseBase.h:172
@ MaxColsAtCompileTime
Definition: DenseBase.h:124
@ MaxRowsAtCompileTime
Definition: DenseBase.h:113
@ RowsAtCompileTime
Definition: DenseBase.h:96
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index outerSize() const
Definition: DenseBase.h:211
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void swap(PlainObjectBase< OtherDerived > &other)
Definition: DenseBase.h:402
NumTraits< Scalar >::Real RealScalar
Definition: DenseBase.h:69
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
EIGEN_DEVICE_FUNC void transposeInPlace()
Definition: Transpose.h:320
internal::traits< Derived >::StorageIndex StorageIndex
The type used to store indices.
Definition: DenseBase.h:59
EIGEN_DEVICE_FUNC Derived & setRandom()
Definition: Random.h:129
EIGEN_DEVICE_FUNC bool allFinite() const
Definition: Visitor.h:783
Transpose< const Derived > ConstTransposeReturnType
Definition: DenseBase.h:301
internal::traits< Derived >::StorageKind StorageKind
Definition: DenseBase.h:51
internal::add_const_on_value_type_t< typename internal::eval< Derived >::type > EvalReturnType
Definition: DenseBase.h:372
EIGEN_DEVICE_FUNC bool hasNaN() const
Definition: Visitor.h:774
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void swap(const DenseBase< OtherDerived > &other)
Definition: DenseBase.h:392
Matrix< typename internal::traits< Derived >::Scalar, internal::traits< Derived >::RowsAtCompileTime, internal::traits< Derived >::ColsAtCompileTime, AutoAlign|(internal::traits< Derived >::Flags &RowMajorBit ? RowMajor :ColMajor), internal::traits< Derived >::MaxRowsAtCompileTime, internal::traits< Derived >::MaxColsAtCompileTime > PlainMatrix
Definition: DenseBase.h:186
internal::find_best_packet< Scalar, SizeAtCompileTime >::type PacketScalar
Definition: DenseBase.h:176
EIGEN_DEVICE_FUNC const Replicate< Derived, Dynamic, Dynamic > replicate(Index rowFactor, Index colFactor) const
Definition: DenseBase.h:556
EIGEN_DEPRECATED typedef CwiseNullaryOp< internal::linspaced_op< Scalar >, PlainObject > SequentialLinSpacedReturnType
Definition: DenseBase.h:249
CwiseNullaryOp< internal::scalar_constant_op< Scalar >, PlainObject > ConstantReturnType
Definition: DenseBase.h:245
VectorwiseOp< Derived, Horizontal > RowwiseReturnType
Definition: DenseBase.h:490
static EIGEN_DEVICE_FUNC const RandomAccessEqualSpacedReturnType EqualSpaced(Index size, const Scalar &low, const Scalar &step)
Definition: CwiseNullaryOp.h:304
std::conditional_t<(Flags &DirectAccessBit)==DirectAccessBit, internal::pointer_based_stl_iterator< const Derived >, internal::generic_randaccess_stl_iterator< const Derived > > const_iterator_type
Definition: DenseBase.h:584
Base::CoeffReturnType CoeffReturnType
Definition: DenseBase.h:92
CwiseNullaryOp< internal::linspaced_op< Scalar >, PlainObject > RandomAccessLinSpacedReturnType
Definition: DenseBase.h:251
Eigen::InnerIterator< Derived > InnerIterator
Definition: DenseBase.h:49
EIGEN_DEVICE_FUNC void fill(const Scalar &value)
Definition: CwiseNullaryOp.h:339
EIGEN_DEVICE_FUNC DenseBase(int)
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar maxCoeff(IndexType *row, IndexType *col) const
Definition: DenseBase.h:453
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar maxCoeff() const
Definition: DenseBase.h:434
iterator begin()
Definition: StlIterators.h:571
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator=(const DenseBase< OtherDerived > &other)
Definition: Assign.h:39
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar maxCoeff() const
EIGEN_DEVICE_FUNC Derived & operator-=(const EigenBase< OtherDerived > &other)
Definition: EigenBase.h:142
VectorwiseOp< Derived, Vertical > ColwiseReturnType
Definition: DenseBase.h:492
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EvalReturnType eval() const
Definition: DenseBase.h:381
internal::traits< Derived >::Scalar Scalar
Definition: DenseBase.h:62
CwiseNullaryOp< internal::equalspaced_op< Scalar >, PlainObject > RandomAccessEqualSpacedReturnType
Definition: DenseBase.h:253
EIGEN_DEPRECATED static EIGEN_DEVICE_FUNC const RandomAccessLinSpacedReturnType LinSpaced(Sequential_t, Index size, const Scalar &low, const Scalar &high)
Definition: CwiseNullaryOp.h:240
CwiseNullaryOp< internal::scalar_random_op< Scalar >, PlainObject > RandomReturnType
Definition: DenseBase.h:516
EIGEN_DEVICE_FUNC Derived & setEqualSpaced(Index size, const Scalar &low, const Scalar &step)
Definition: CwiseNullaryOp.h:458
std::conditional_t< IsVectorAtCompileTime, const_iterator_type, void > const_iterator
Definition: DenseBase.h:590
Reverse< Derived, BothDirections > ReverseReturnType
Definition: DenseBase.h:560
static EIGEN_DEVICE_FUNC const ZeroReturnType Zero()
Definition: CwiseNullaryOp.h:525
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator*=(const Scalar &other)
Definition: SelfCwiseBinaryOp.h:21
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar minCoeff() const
Definition: DenseBase.h:431
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator/=(const Scalar &other)
Definition: SelfCwiseBinaryOp.h:42
RealScalar lpNorm() const
EIGEN_DEVICE_FUNC void visit(Visitor &func) const
Definition: Visitor.h:382
static EIGEN_DEVICE_FUNC const CwiseNullaryOp< CustomNullaryOp, PlainObject > NullaryExpr(const CustomNullaryOp &func)
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar minCoeff() const
const VectorwiseOp< const Derived, Vertical > ConstColwiseReturnType
Definition: DenseBase.h:493
EIGEN_DEVICE_FUNC CoeffReturnType value() const
Definition: DenseBase.h:481
@ IsPlainObjectBase
Definition: DenseBase.h:178
EIGEN_DEVICE_FUNC Derived & operator+=(const EigenBase< OtherDerived > &other)
Definition: EigenBase.h:135
EIGEN_DEVICE_FUNC bool isOnes(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: CwiseNullaryOp.h:682
Scalar value_type
Definition: DenseBase.h:67
Transpose< Derived > TransposeReturnType
Definition: DenseBase.h:299
EIGEN_DEVICE_FUNC ConstColwiseReturnType colwise() const
Definition: DenseBase.h:513
EIGEN_DEPRECATED const Derived & flagged() const
Definition: DenseBase.h:292
static EIGEN_DEVICE_FUNC const CwiseNullaryOp< CustomNullaryOp, PlainObject > NullaryExpr(Index rows, Index cols, const CustomNullaryOp &func)
std::conditional_t<(Flags &DirectAccessBit)==DirectAccessBit, internal::pointer_based_stl_iterator< Derived >, internal::generic_randaccess_stl_iterator< Derived > > iterator_type
Definition: DenseBase.h:579
EIGEN_DEVICE_FUNC const NestByValue< Derived > nestByValue() const
Definition: NestByValue.h:74
EIGEN_DEVICE_FUNC 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
EIGEN_DEVICE_FUNC const ForceAlignedAccess< Derived > forceAlignedAccess() const
EIGEN_DEVICE_FUNC bool isZero(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: CwiseNullaryOp.h:538
EIGEN_DEVICE_FUNC bool isApproxToConstant(const Scalar &value, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: CwiseNullaryOp.h:318
const WithFormat< Derived > format(const IOFormat &fmt) const
Definition: DenseBase.h:478
EIGEN_DEVICE_FUNC bool isConstant(const Scalar &value, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: CwiseNullaryOp.h:330
EIGEN_DEVICE_FUNC Scalar prod() const
Definition: Redux.h:510
EIGEN_DEVICE_FUNC 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
constexpr EIGEN_DEVICE_FUNC DenseBase()=default
EIGEN_DEVICE_FUNC Scalar redux(const BinaryOp &func) const
Matrix< typename NumTraits< typename internal::traits< Derived >::Scalar >::Real, internal::traits< Derived >::ColsAtCompileTime, 1 > EigenvaluesReturnType
Definition: DenseBase.h:257
EIGEN_DEVICE_FUNC DenseBase(const DenseBase< OtherDerived > &)
EIGEN_DEVICE_FUNC Derived & setZero()
Definition: CwiseNullaryOp.h:554
EIGEN_DEVICE_FUNC Scalar sum() const
Definition: Redux.h:481
EIGEN_DEVICE_FUNC bool isMuchSmallerThan(const RealScalar &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
EIGEN_DEVICE_FUNC Scalar mean() const
Definition: Redux.h:491
EIGEN_DEVICE_FUNC TransposeReturnType transpose()
Definition: Transpose.h:162
EIGEN_DEVICE_FUNC std::conditional_t< Enable, ForceAlignedAccess< Derived >, Derived & > forceAlignedAccessIf()
EIGEN_DEVICE_FUNC ReverseReturnType reverse()
Definition: Reverse.h:110
EIGEN_DEVICE_FUNC Derived & setOnes()
Definition: CwiseNullaryOp.h:694
EIGEN_DEVICE_FUNC void evalTo(Dest &) const
Definition: DenseBase.h:618
EIGEN_DEVICE_FUNC ConstReverseReturnType reverse() const
Definition: DenseBase.h:565
EIGEN_DEVICE_FUNC ForceAlignedAccess< Derived > forceAlignedAccess()
EIGEN_DEPRECATED EIGEN_DEVICE_FUNC Derived & lazyAssign(const DenseBase< OtherDerived > &other)
EIGEN_DEVICE_FUNC bool any() const
Definition: Visitor.h:752
EIGEN_DEVICE_FUNC const Replicate< Derived, RowFactor, ColFactor > replicate() const
Definition: Replicate.h:109
EIGEN_DEVICE_FUNC CommaInitializer< Derived > operator<<(const Scalar &s)
Definition: CommaInitializer.h:135
iterator end()
Definition: StlIterators.h:597
static const RandomReturnType Random()
Definition: Random.h:112
const_iterator cbegin() const
Definition: StlIterators.h:587
const_iterator cend() const
Definition: StlIterators.h:613
EIGEN_DEVICE_FUNC Scalar trace() const
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar maxCoeff(IndexType *index) const
Definition: DenseBase.h:461
EIGEN_DEVICE_FUNC void resize(Index rows, Index cols)
Definition: DenseBase.h:236
std::conditional_t< IsVectorAtCompileTime, iterator_type, void > iterator
Definition: DenseBase.h:588
EIGEN_DEVICE_FUNC bool isApprox(const DenseBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: Fuzzy.h:89
const VectorwiseOp< const Derived, Horizontal > ConstRowwiseReturnType
Definition: DenseBase.h:491
const Reverse< const Derived, BothDirections > ConstReverseReturnType
Definition: DenseBase.h:561
EIGEN_DEVICE_FUNC ConstRowwiseReturnType rowwise() const
Definition: DenseBase.h:503
EIGEN_DEVICE_FUNC const std::conditional_t< Enable, ForceAlignedAccess< Derived >, Derived & > forceAlignedAccessIf() const
CwiseNullaryOp< internal::scalar_zero_op< Scalar >, PlainObject > ZeroReturnType
Definition: DenseBase.h:247
EIGEN_DEVICE_FUNC Index count() const
Definition: Visitor.h:765
Definition: ForwardDeclarations.h:63
Enforce aligned packet loads and stores regardless of what is requested.
Definition: ForceAlignedAccess.h:37
An InnerIterator allows to loop over the element of any matrix expression.
Definition: CoreIterators.h:37
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186
Expression which must be nested by value.
Definition: NestByValue.h:39
Definition: PlainObjectBase.h:121
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: PlainObjectBase.h:192
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: PlainObjectBase.h:191
Expression of the multiple replication of a matrix or vector.
Definition: Replicate.h:64
Definition: ReturnByValue.h:50
Expression of the reverse of a vector or matrix.
Definition: Reverse.h:65
Expression of the transpose of a matrix.
Definition: Transpose.h:56
Pseudo expression providing broadcasting and partial reduction operations.
Definition: VectorwiseOp.h:192
Pseudo expression providing matrix output with given format.
Definition: IO.h:101
Definition: StlIterators.h:316
@ ColMajor
Definition: Constants.h:318
@ RowMajor
Definition: Constants.h:320
@ AutoAlign
Definition: Constants.h:322
const unsigned int DirectAccessBit
Definition: Constants.h:159
const unsigned int RowMajorBit
Definition: Constants.h:70
Scalar * y
Definition: level1_cplx_impl.h:128
RealScalar s
Definition: level1_cplx_impl.h:130
return int(ret)+1
Eigen::DenseIndex ret
Definition: level1_cplx_impl.h:43
const Scalar * a
Definition: level2_cplx_impl.h:32
constexpr int size_at_compile_time(int rows, int cols)
Definition: XprHelper.h:373
constexpr bool check_implication(bool a, bool b)
Definition: Meta.h:740
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_assignment(Dst &dst, const Src &src)
Definition: AssignEvaluator.h:781
typename add_const_on_value_type< T >::type add_const_on_value_type_t
Definition: Meta.h:274
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
Sequential_t
Definition: Constants.h:360
Extend namespace for flags.
Definition: fsi_chan_precond_driver.cc:56
type
Definition: compute_granudrum_aor.py:141
Definition: Eigen_Colamd.h:49
list x
Definition: plotDoE.py:28
Helper class used by the comma initializer operator.
Definition: CommaInitializer.h:31
Definition: EigenBase.h:33
@ IsSigned
Definition: NumTraits.h:175
Stores a set of parameters controlling the way matrices are printed.
Definition: IO.h:52
Definition: Constants.h:534
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:217
find_best_packet_helper< Size, typename packet_traits< T >::type >::type type
Definition: XprHelper.h:290
Definition: Meta.h:205
Template functor for scalar/packet assignment with swapping.
Definition: AssignmentFunctors.h:147
Definition: ForwardDeclarations.h:21
Definition: benchGeometry.cpp:21