Eigen  3.4.90 (git rev 67eeba6e720c5745abc77ae6c92ce0a44aa7b7ae)
DenseBase.h
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
38  : public DenseCoeffsBase<Derived, internal::accessors_level<Derived>::value>
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 
68  typedef typename NumTraits<Scalar>::Real RealScalar;
69  typedef DenseCoeffsBase<Derived, internal::accessors_level<Derived>::value> Base;
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 
211  EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
212  Index outerSize() const
213  {
214  return IsVectorAtCompileTime ? 1
215  : int(IsRowMajor) ? this->rows() : this->cols();
216  }
217 
223  EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
224  Index innerSize() const
225  {
226  return IsVectorAtCompileTime ? this->size()
227  : int(IsRowMajor) ? this->cols() : this->rows();
228  }
229 
234  EIGEN_DEVICE_FUNC
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  }
245  EIGEN_DEVICE_FUNC
246  void resize(Index rows, Index cols)
247  {
248  EIGEN_ONLY_USED_FOR_DEBUG(rows);
249  EIGEN_ONLY_USED_FOR_DEBUG(cols);
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 Matrix<typename NumTraits<typename internal::traits<Derived>::Scalar>::Real, internal::traits<Derived>::ColsAtCompileTime, 1> EigenvaluesReturnType;
263 
264 #endif // not EIGEN_PARSED_BY_DOXYGEN
265 
267  template<typename OtherDerived>
268  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
269  Derived& operator=(const DenseBase<OtherDerived>& other);
270 
274  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
275  Derived& operator=(const DenseBase& other);
276 
277  template<typename OtherDerived>
278  EIGEN_DEVICE_FUNC
279  Derived& operator=(const EigenBase<OtherDerived> &other);
280 
281  template<typename OtherDerived>
282  EIGEN_DEVICE_FUNC
283  Derived& operator+=(const EigenBase<OtherDerived> &other);
284 
285  template<typename OtherDerived>
286  EIGEN_DEVICE_FUNC
287  Derived& operator-=(const EigenBase<OtherDerived> &other);
288 
289  template<typename OtherDerived>
290  EIGEN_DEVICE_FUNC
291  Derived& operator=(const ReturnByValue<OtherDerived>& func);
292 
295  template<typename OtherDerived>
297  EIGEN_DEPRECATED EIGEN_DEVICE_FUNC
298  Derived& lazyAssign(const DenseBase<OtherDerived>& other);
299 
300  EIGEN_DEVICE_FUNC
301  CommaInitializer<Derived> operator<< (const Scalar& s);
302 
303  template<unsigned int Added,unsigned int Removed>
305  EIGEN_DEPRECATED
306  const Derived& flagged() const
307  { return derived(); }
308 
309  template<typename OtherDerived>
310  EIGEN_DEVICE_FUNC
311  CommaInitializer<Derived> operator<< (const DenseBase<OtherDerived>& other);
312 
313  typedef Transpose<Derived> TransposeReturnType;
314  EIGEN_DEVICE_FUNC
315  TransposeReturnType transpose();
316  typedef Transpose<const Derived> ConstTransposeReturnType;
317  EIGEN_DEVICE_FUNC
318  const ConstTransposeReturnType transpose() const;
319  EIGEN_DEVICE_FUNC
320  void transposeInPlace();
321 
322  EIGEN_DEVICE_FUNC static const ConstantReturnType
323  Constant(Index rows, Index cols, const Scalar& value);
324  EIGEN_DEVICE_FUNC static const ConstantReturnType
325  Constant(Index size, const Scalar& value);
326  EIGEN_DEVICE_FUNC static const ConstantReturnType
327  Constant(const Scalar& value);
328 
329  EIGEN_DEPRECATED EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType
330  LinSpaced(Sequential_t, Index size, const Scalar& low, const Scalar& high);
331  EIGEN_DEPRECATED EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType
332  LinSpaced(Sequential_t, const Scalar& low, const Scalar& high);
333 
334  EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType
335  LinSpaced(Index size, const Scalar& low, const Scalar& high);
336  EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType
337  LinSpaced(const Scalar& low, const Scalar& high);
338 
339  template<typename CustomNullaryOp> EIGEN_DEVICE_FUNC
341  NullaryExpr(Index rows, Index cols, const CustomNullaryOp& func);
342  template<typename CustomNullaryOp> EIGEN_DEVICE_FUNC
344  NullaryExpr(Index size, const CustomNullaryOp& func);
345  template<typename CustomNullaryOp> EIGEN_DEVICE_FUNC
347  NullaryExpr(const CustomNullaryOp& func);
348 
349  EIGEN_DEVICE_FUNC static const ConstantReturnType Zero(Index rows, Index cols);
350  EIGEN_DEVICE_FUNC static const ConstantReturnType Zero(Index size);
351  EIGEN_DEVICE_FUNC static const ConstantReturnType Zero();
352  EIGEN_DEVICE_FUNC static const ConstantReturnType Ones(Index rows, Index cols);
353  EIGEN_DEVICE_FUNC static const ConstantReturnType Ones(Index size);
354  EIGEN_DEVICE_FUNC static const ConstantReturnType Ones();
355 
356  EIGEN_DEVICE_FUNC void fill(const Scalar& value);
357  EIGEN_DEVICE_FUNC Derived& setConstant(const Scalar& value);
358  EIGEN_DEVICE_FUNC Derived& setLinSpaced(Index size, const Scalar& low, const Scalar& high);
359  EIGEN_DEVICE_FUNC Derived& setLinSpaced(const Scalar& low, const Scalar& high);
360  EIGEN_DEVICE_FUNC Derived& setZero();
361  EIGEN_DEVICE_FUNC Derived& setOnes();
362  EIGEN_DEVICE_FUNC Derived& setRandom();
363 
364  template<typename OtherDerived> EIGEN_DEVICE_FUNC
365  bool isApprox(const DenseBase<OtherDerived>& other,
366  const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
367  EIGEN_DEVICE_FUNC
368  bool isMuchSmallerThan(const RealScalar& other,
369  const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
370  template<typename OtherDerived> EIGEN_DEVICE_FUNC
371  bool isMuchSmallerThan(const DenseBase<OtherDerived>& other,
372  const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
373 
374  EIGEN_DEVICE_FUNC bool isApproxToConstant(const Scalar& value, const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
375  EIGEN_DEVICE_FUNC bool isConstant(const Scalar& value, const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
376  EIGEN_DEVICE_FUNC bool isZero(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
377  EIGEN_DEVICE_FUNC bool isOnes(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
378 
379  EIGEN_DEVICE_FUNC inline bool hasNaN() const;
380  EIGEN_DEVICE_FUNC inline bool allFinite() const;
381 
382  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
383  Derived& operator*=(const Scalar& other);
384  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
385  Derived& operator/=(const Scalar& other);
386 
387  typedef internal::add_const_on_value_type_t<typename internal::eval<Derived>::type> EvalReturnType;
395  EIGEN_DEVICE_FUNC
396  EIGEN_STRONG_INLINE EvalReturnType eval() const
397  {
398  // Even though MSVC does not honor strong inlining when the return type
399  // is a dynamic matrix, we desperately need strong inlining for fixed
400  // size types on MSVC.
401  return typename internal::eval<Derived>::type(derived());
402  }
403 
407  template<typename OtherDerived>
408  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
409  void swap(const DenseBase<OtherDerived>& other)
410  {
411  EIGEN_STATIC_ASSERT(!OtherDerived::IsPlainObjectBase,THIS_EXPRESSION_IS_NOT_A_LVALUE__IT_IS_READ_ONLY);
412  eigen_assert(rows()==other.rows() && cols()==other.cols());
413  call_assignment(derived(), other.const_cast_derived(), internal::swap_assign_op<Scalar>());
414  }
415 
419  template<typename OtherDerived>
420  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
422  {
423  eigen_assert(rows()==other.rows() && cols()==other.cols());
424  call_assignment(derived(), other.derived(), internal::swap_assign_op<Scalar>());
425  }
426 
427  EIGEN_DEVICE_FUNC inline const NestByValue<Derived> nestByValue() const;
428  EIGEN_DEVICE_FUNC inline const ForceAlignedAccess<Derived> forceAlignedAccess() const;
429  EIGEN_DEVICE_FUNC inline ForceAlignedAccess<Derived> forceAlignedAccess();
430  template<bool Enable> EIGEN_DEVICE_FUNC
431  inline const std::conditional_t<Enable,ForceAlignedAccess<Derived>,Derived&> forceAlignedAccessIf() const;
432  template<bool Enable> EIGEN_DEVICE_FUNC
433  inline std::conditional_t<Enable,ForceAlignedAccess<Derived>,Derived&> forceAlignedAccessIf();
434 
435  EIGEN_DEVICE_FUNC Scalar sum() const;
436  EIGEN_DEVICE_FUNC Scalar mean() const;
437  EIGEN_DEVICE_FUNC Scalar trace() const;
438 
439  EIGEN_DEVICE_FUNC Scalar prod() const;
440 
441  template<int NaNPropagation>
442  EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar minCoeff() const;
443  template<int NaNPropagation>
444  EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar maxCoeff() const;
445 
446 
447  // By default, the fastest version with undefined NaN propagation semantics is
448  // used.
449  // TODO(rmlarsen): Replace with default template argument when we move to
450  // c++11 or beyond.
451  EIGEN_DEVICE_FUNC inline typename internal::traits<Derived>::Scalar minCoeff() const {
452  return minCoeff<PropagateFast>();
453  }
454  EIGEN_DEVICE_FUNC inline typename internal::traits<Derived>::Scalar maxCoeff() const {
455  return maxCoeff<PropagateFast>();
456  }
457 
458  template<int NaNPropagation, typename IndexType>
459  EIGEN_DEVICE_FUNC
460  typename internal::traits<Derived>::Scalar minCoeff(IndexType* row, IndexType* col) const;
461  template<int NaNPropagation, typename IndexType>
462  EIGEN_DEVICE_FUNC
463  typename internal::traits<Derived>::Scalar maxCoeff(IndexType* row, IndexType* col) const;
464  template<int NaNPropagation, typename IndexType>
465  EIGEN_DEVICE_FUNC
466  typename internal::traits<Derived>::Scalar minCoeff(IndexType* index) const;
467  template<int NaNPropagation, typename IndexType>
468  EIGEN_DEVICE_FUNC
469  typename internal::traits<Derived>::Scalar maxCoeff(IndexType* index) const;
470 
471  // TODO(rmlarsen): Replace these methods with a default template argument.
472  template<typename IndexType>
473  EIGEN_DEVICE_FUNC inline
474  typename internal::traits<Derived>::Scalar minCoeff(IndexType* row, IndexType* col) const {
475  return minCoeff<PropagateFast>(row, col);
476  }
477  template<typename IndexType>
478  EIGEN_DEVICE_FUNC inline
479  typename internal::traits<Derived>::Scalar maxCoeff(IndexType* row, IndexType* col) const {
480  return maxCoeff<PropagateFast>(row, col);
481  }
482  template<typename IndexType>
483  EIGEN_DEVICE_FUNC inline
484  typename internal::traits<Derived>::Scalar minCoeff(IndexType* index) const {
485  return minCoeff<PropagateFast>(index);
486  }
487  template<typename IndexType>
488  EIGEN_DEVICE_FUNC inline
489  typename internal::traits<Derived>::Scalar maxCoeff(IndexType* index) const {
490  return maxCoeff<PropagateFast>(index);
491  }
492 
493  template<typename BinaryOp>
494  EIGEN_DEVICE_FUNC
495  Scalar redux(const BinaryOp& func) const;
496 
497  template<typename Visitor>
498  EIGEN_DEVICE_FUNC
499  void visit(Visitor& func) const;
500 
508  inline const WithFormat<Derived> format(const IOFormat& fmt) const
509  {
510  return WithFormat<Derived>(derived(), fmt);
511  }
512 
514  EIGEN_DEVICE_FUNC
515  CoeffReturnType value() const
516  {
517  EIGEN_STATIC_ASSERT_SIZE_1x1(Derived)
518  eigen_assert(this->rows() == 1 && this->cols() == 1);
519  return derived().coeff(0,0);
520  }
521 
522  EIGEN_DEVICE_FUNC bool all() const;
523  EIGEN_DEVICE_FUNC bool any() const;
524  EIGEN_DEVICE_FUNC Index count() const;
525 
526  typedef VectorwiseOp<Derived, Horizontal> RowwiseReturnType;
527  typedef const VectorwiseOp<const Derived, Horizontal> ConstRowwiseReturnType;
528  typedef VectorwiseOp<Derived, Vertical> ColwiseReturnType;
529  typedef const VectorwiseOp<const Derived, Vertical> ConstColwiseReturnType;
530 
538  //Code moved here due to a CUDA compiler bug
539  EIGEN_DEVICE_FUNC inline ConstRowwiseReturnType rowwise() const {
540  return ConstRowwiseReturnType(derived());
541  }
542  EIGEN_DEVICE_FUNC RowwiseReturnType rowwise();
543 
551  EIGEN_DEVICE_FUNC inline ConstColwiseReturnType colwise() const {
552  return ConstColwiseReturnType(derived());
553  }
554  EIGEN_DEVICE_FUNC ColwiseReturnType colwise();
555 
556  typedef CwiseNullaryOp<internal::scalar_random_op<Scalar>,PlainObject> RandomReturnType;
557  static const RandomReturnType Random(Index rows, Index cols);
558  static const RandomReturnType Random(Index size);
559  static const RandomReturnType Random();
560 
561  template<typename ThenDerived,typename ElseDerived>
562  inline EIGEN_DEVICE_FUNC const Select<Derived,ThenDerived,ElseDerived>
563  select(const DenseBase<ThenDerived>& thenMatrix,
564  const DenseBase<ElseDerived>& elseMatrix) const;
565 
566  template<typename ThenDerived>
568  select(const DenseBase<ThenDerived>& thenMatrix, const typename ThenDerived::Scalar& elseScalar) const;
569 
570  template<typename ElseDerived>
572  select(const typename ElseDerived::Scalar& thenScalar, const DenseBase<ElseDerived>& elseMatrix) const;
573 
574  template<int p> RealScalar lpNorm() const;
575 
576  template<int RowFactor, int ColFactor>
577  EIGEN_DEVICE_FUNC
578  const Replicate<Derived,RowFactor,ColFactor> replicate() const;
587  //Code moved here due to a CUDA compiler bug
588  EIGEN_DEVICE_FUNC
589  const Replicate<Derived, Dynamic, Dynamic> replicate(Index rowFactor, Index colFactor) const
590  {
591  return Replicate<Derived, Dynamic, Dynamic>(derived(), rowFactor, colFactor);
592  }
593 
594  typedef Reverse<Derived, BothDirections> ReverseReturnType;
595  typedef const Reverse<const Derived, BothDirections> ConstReverseReturnType;
596  EIGEN_DEVICE_FUNC ReverseReturnType reverse();
598  //Code moved here due to a CUDA compiler bug
599  EIGEN_DEVICE_FUNC ConstReverseReturnType reverse() const
600  {
601  return ConstReverseReturnType(derived());
602  }
603  EIGEN_DEVICE_FUNC void reverseInPlace();
604 
605  #ifdef EIGEN_PARSED_BY_DOXYGEN
609  typedef random_access_iterator_type iterator;
611  typedef random_access_iterator_type const_iterator;
612  #else
613  typedef std::conditional_t< (Flags&DirectAccessBit)==DirectAccessBit,
614  internal::pointer_based_stl_iterator<Derived>,
615  internal::generic_randaccess_stl_iterator<Derived>
616  > iterator_type;
617 
618  typedef std::conditional_t< (Flags&DirectAccessBit)==DirectAccessBit,
619  internal::pointer_based_stl_iterator<const Derived>,
620  internal::generic_randaccess_stl_iterator<const Derived>
621  > const_iterator_type;
622 
623  // Stl-style iterators are supported only for vectors.
624 
625  typedef std::conditional_t<IsVectorAtCompileTime, iterator_type, void> iterator;
626 
627  typedef std::conditional_t<IsVectorAtCompileTime, const_iterator_type, void> const_iterator;
628  #endif
629 
630  inline iterator begin();
631  inline const_iterator begin() const;
632  inline const_iterator cbegin() const;
633  inline iterator end();
634  inline const_iterator end() const;
635  inline const_iterator cend() const;
636 
637 #define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::DenseBase
638 #define EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
639 #define EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(COND)
640 #define EIGEN_DOC_UNARY_ADDONS(X,Y)
641 # include "../plugins/CommonCwiseUnaryOps.h"
642 # include "../plugins/BlockMethods.h"
643 # include "../plugins/IndexedViewMethods.h"
644 # include "../plugins/ReshapedMethods.h"
645 # ifdef EIGEN_DENSEBASE_PLUGIN
646 # include EIGEN_DENSEBASE_PLUGIN
647 # endif
648 #undef EIGEN_CURRENT_STORAGE_BASE_CLASS
649 #undef EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
650 #undef EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF
651 #undef EIGEN_DOC_UNARY_ADDONS
652 
653  // disable the use of evalTo for dense objects with a nice compilation error
654  template<typename Dest>
655  EIGEN_DEVICE_FUNC
656  inline void evalTo(Dest& ) const
657  {
658  EIGEN_STATIC_ASSERT((internal::is_same<Dest,void>::value),THE_EVAL_EVALTO_FUNCTION_SHOULD_NEVER_BE_CALLED_FOR_DENSE_OBJECTS);
659  }
660 
661  protected:
662  EIGEN_DEFAULT_COPY_CONSTRUCTOR(DenseBase)
664  EIGEN_DEVICE_FUNC DenseBase()
665  {
666  /* Just checks for self-consistency of the flags.
667  * Only do it when debugging Eigen, as this borders on paranoia and could slow compilation down
668  */
669 #ifdef EIGEN_INTERNAL_DEBUGGING
670  EIGEN_STATIC_ASSERT((internal::check_implication(MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1, int(IsRowMajor))
671  && internal::check_implication(MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1, int(!IsRowMajor))),
672  INVALID_STORAGE_ORDER_FOR_THIS_VECTOR_EXPRESSION)
673 #endif
674  }
675 
676  private:
677  EIGEN_DEVICE_FUNC explicit DenseBase(int);
678  EIGEN_DEVICE_FUNC DenseBase(int,int);
679  template<typename OtherDerived> EIGEN_DEVICE_FUNC explicit DenseBase(const DenseBase<OtherDerived>&);
680 };
681 
682 } // end namespace Eigen
683 
684 #endif // EIGEN_DENSEBASE_H
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.
Definition: CwiseNullaryOp.h:63
Base class for all dense matrices, vectors, and arrays.
Definition: DenseBase.h:42
EIGEN_CONSTEXPR Index outerSize() const
Definition: DenseBase.h:212
void resize(Index rows, Index cols)
Definition: DenseBase.h:246
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:611
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
void swap(PlainObjectBase< OtherDerived > &other)
Definition: DenseBase.h:421
ConstColwiseReturnType colwise() const
Definition: DenseBase.h:551
EIGEN_CONSTEXPR Index innerSize() const
Definition: DenseBase.h:224
internal::traits< Derived >::Scalar Scalar
Definition: DenseBase.h:61
EIGEN_DEPRECATED Derived & lazyAssign(const DenseBase< OtherDerived > &other)
CoeffReturnType value() const
Definition: DenseBase.h:515
Scalar value_type
Definition: DenseBase.h:66
EIGEN_DEPRECATED const Derived & flagged() const
Definition: DenseBase.h:306
ConstReverseReturnType reverse() const
Definition: DenseBase.h:599
ConstRowwiseReturnType rowwise() const
Definition: DenseBase.h:539
EvalReturnType eval() const
Definition: DenseBase.h:396
const WithFormat< Derived > format(const IOFormat &fmt) const
Definition: DenseBase.h:508
random_access_iterator_type iterator
Definition: DenseBase.h:609
void swap(const DenseBase< OtherDerived > &other)
Definition: DenseBase.h:409
const Replicate< Derived, Dynamic, Dynamic > replicate(Index rowFactor, Index colFactor) const
Definition: DenseBase.h:589
Base class providing direct read/write coefficient access to matrices and arrays.
Definition: DenseCoeffsBase.h:559
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.
Definition: ForceAlignedAccess.h:38
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.
Definition: PlainObjectBase.h:102
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 a coefficient wise version of the C++ ternary operator ?:
Definition: Select.h:56
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
Definition: IndexedViewHelper.h:183
static const Eigen::internal::all_t all
Definition: IndexedViewHelper.h:189
@ 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
Namespace containing all symbols from the Eigen library.
Definition: Core:139
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:59
Helper class used by the comma initializer operator.
Definition: CommaInitializer.h:31
Definition: EigenBase.h:32
Eigen::Index Index
The interface type of indices.
Definition: EigenBase.h:41
Stores a set of parameters controlling the way matrices are printed.
Definition: IO.h:54
Definition: Constants.h:524
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:231