Eigen  3.2.91
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 namespace Eigen {
15 
16 namespace internal {
17 
18 // The index type defined by EIGEN_DEFAULT_DENSE_INDEX_TYPE must be a signed type.
19 // This dummy function simply aims at checking that at compile time.
20 static inline void check_DenseIndex_is_signed() {
21  EIGEN_STATIC_ASSERT(NumTraits<DenseIndex>::IsSigned,THE_INDEX_TYPE_MUST_BE_A_SIGNED_TYPE);
22 }
23 
24 } // end namespace internal
25 
41 template<typename Derived> class DenseBase
42 #ifndef EIGEN_PARSED_BY_DOXYGEN
43  : public internal::special_scalar_op_base<Derived,typename internal::traits<Derived>::Scalar,
44  typename NumTraits<typename internal::traits<Derived>::Scalar>::Real>
45 #else
46  : public DenseCoeffsBase<Derived>
47 #endif // not EIGEN_PARSED_BY_DOXYGEN
48 {
49  public:
50  using internal::special_scalar_op_base<Derived,typename internal::traits<Derived>::Scalar,
51  typename NumTraits<typename internal::traits<Derived>::Scalar>::Real>::operator*;
52  using internal::special_scalar_op_base<Derived,typename internal::traits<Derived>::Scalar,
53  typename NumTraits<typename internal::traits<Derived>::Scalar>::Real>::operator/;
54 
55 
59  typedef Eigen::InnerIterator<Derived> InnerIterator;
60 
61  typedef typename internal::traits<Derived>::StorageKind StorageKind;
62 
69  typedef typename internal::traits<Derived>::StorageIndex StorageIndex;
70 
72  typedef typename internal::traits<Derived>::Scalar Scalar;
73 
77  typedef Scalar value_type;
78 
79  typedef typename NumTraits<Scalar>::Real RealScalar;
80 
81  typedef internal::special_scalar_op_base<Derived,typename internal::traits<Derived>::Scalar,
83  using Base::derived;
84  using Base::const_cast_derived;
85  using Base::rows;
86  using Base::cols;
87  using Base::size;
88  using Base::rowIndexByOuterInner;
89  using Base::colIndexByOuterInner;
90  using Base::coeff;
91  using Base::coeffByOuterInner;
92  using Base::operator();
93  using Base::operator[];
94  using Base::x;
95  using Base::y;
96  using Base::z;
97  using Base::w;
98  using Base::stride;
99  using Base::innerStride;
100  using Base::outerStride;
101  using Base::rowStride;
102  using Base::colStride;
103  typedef typename Base::CoeffReturnType CoeffReturnType;
104 
105  enum {
106 
107  RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime,
113  ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime,
120  SizeAtCompileTime = (internal::size_at_compile_time<internal::traits<Derived>::RowsAtCompileTime,
121  internal::traits<Derived>::ColsAtCompileTime>::ret),
126  MaxRowsAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime,
137  MaxColsAtCompileTime = internal::traits<Derived>::MaxColsAtCompileTime,
148  MaxSizeAtCompileTime = (internal::size_at_compile_time<internal::traits<Derived>::MaxRowsAtCompileTime,
149  internal::traits<Derived>::MaxColsAtCompileTime>::ret),
160  IsVectorAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime == 1
161  || internal::traits<Derived>::MaxColsAtCompileTime == 1,
167  Flags = internal::traits<Derived>::Flags,
174  InnerSizeAtCompileTime = int(IsVectorAtCompileTime) ? int(SizeAtCompileTime)
175  : int(IsRowMajor) ? int(ColsAtCompileTime) : int(RowsAtCompileTime),
176 
177  InnerStrideAtCompileTime = internal::inner_stride_at_compile_time<Derived>::ret,
178  OuterStrideAtCompileTime = internal::outer_stride_at_compile_time<Derived>::ret
179  };
180 
181  typedef typename internal::find_best_packet<Scalar,SizeAtCompileTime>::type PacketScalar;
182 
183  enum { IsPlainObjectBase = 0 };
184 
188  internal::traits<Derived>::RowsAtCompileTime,
189  internal::traits<Derived>::ColsAtCompileTime,
190  AutoAlign | (internal::traits<Derived>::Flags&RowMajorBit ? RowMajor : ColMajor),
191  internal::traits<Derived>::MaxRowsAtCompileTime,
192  internal::traits<Derived>::MaxColsAtCompileTime
194 
198  internal::traits<Derived>::RowsAtCompileTime,
199  internal::traits<Derived>::ColsAtCompileTime,
200  AutoAlign | (internal::traits<Derived>::Flags&RowMajorBit ? RowMajor : ColMajor),
201  internal::traits<Derived>::MaxRowsAtCompileTime,
202  internal::traits<Derived>::MaxColsAtCompileTime
204 
211  typedef typename internal::conditional<internal::is_same<typename internal::traits<Derived>::XprKind,MatrixXpr >::value,
213 
216  EIGEN_DEVICE_FUNC
217  inline Index nonZeros() const { return size(); }
228  EIGEN_DEVICE_FUNC
229  Index outerSize() const
230  {
231  return IsVectorAtCompileTime ? 1
232  : int(IsRowMajor) ? this->rows() : this->cols();
233  }
234 
240  EIGEN_DEVICE_FUNC
241  Index innerSize() const
242  {
243  return IsVectorAtCompileTime ? this->size()
244  : int(IsRowMajor) ? this->cols() : this->rows();
245  }
246 
251  EIGEN_DEVICE_FUNC
252  void resize(Index newSize)
253  {
254  EIGEN_ONLY_USED_FOR_DEBUG(newSize);
255  eigen_assert(newSize == this->size()
256  && "DenseBase::resize() does not actually allow to resize.");
257  }
262  EIGEN_DEVICE_FUNC
263  void resize(Index rows, Index cols)
264  {
265  EIGEN_ONLY_USED_FOR_DEBUG(rows);
266  EIGEN_ONLY_USED_FOR_DEBUG(cols);
267  eigen_assert(rows == this->rows() && cols == this->cols()
268  && "DenseBase::resize() does not actually allow to resize.");
269  }
270 
271 #ifndef EIGEN_PARSED_BY_DOXYGEN
272 
273  typedef CwiseNullaryOp<internal::scalar_constant_op<Scalar>,PlainObject> ConstantReturnType;
275  typedef CwiseNullaryOp<internal::linspaced_op<Scalar,PacketScalar,false>,PlainObject> SequentialLinSpacedReturnType;
277  typedef CwiseNullaryOp<internal::linspaced_op<Scalar,PacketScalar,true>,PlainObject> RandomAccessLinSpacedReturnType;
279  typedef Matrix<typename NumTraits<typename internal::traits<Derived>::Scalar>::Real, internal::traits<Derived>::ColsAtCompileTime, 1> EigenvaluesReturnType;
280 
281 #endif // not EIGEN_PARSED_BY_DOXYGEN
282 
284  template<typename OtherDerived>
285  EIGEN_DEVICE_FUNC
286  Derived& operator=(const DenseBase<OtherDerived>& other);
287 
291  EIGEN_DEVICE_FUNC
292  Derived& operator=(const DenseBase& other);
293 
294  template<typename OtherDerived>
295  EIGEN_DEVICE_FUNC
296  Derived& operator=(const EigenBase<OtherDerived> &other);
298  template<typename OtherDerived>
299  EIGEN_DEVICE_FUNC
300  Derived& operator+=(const EigenBase<OtherDerived> &other);
301 
302  template<typename OtherDerived>
303  EIGEN_DEVICE_FUNC
304  Derived& operator-=(const EigenBase<OtherDerived> &other);
305 
306  template<typename OtherDerived>
307  EIGEN_DEVICE_FUNC
308  Derived& operator=(const ReturnByValue<OtherDerived>& func);
309 
313  template<typename OtherDerived>
314  EIGEN_DEVICE_FUNC
315  Derived& lazyAssign(const DenseBase<OtherDerived>& other);
316 
317  EIGEN_DEVICE_FUNC
318  CommaInitializer<Derived> operator<< (const Scalar& s);
319 
321  template<unsigned int Added,unsigned int Removed>
322  EIGEN_DEPRECATED
323  const Derived& flagged() const
324  { return derived(); }
325 
326  template<typename OtherDerived>
327  EIGEN_DEVICE_FUNC
328  CommaInitializer<Derived> operator<< (const DenseBase<OtherDerived>& other);
331  EIGEN_DEVICE_FUNC
332  TransposeReturnType transpose();
333  typedef typename internal::add_const<Transpose<const Derived> >::type ConstTransposeReturnType;
334  EIGEN_DEVICE_FUNC
335  ConstTransposeReturnType transpose() const;
336  EIGEN_DEVICE_FUNC
337  void transposeInPlace();
338 
339  EIGEN_DEVICE_FUNC static const ConstantReturnType
340  Constant(Index rows, Index cols, const Scalar& value);
341  EIGEN_DEVICE_FUNC static const ConstantReturnType
342  Constant(Index size, const Scalar& value);
343  EIGEN_DEVICE_FUNC static const ConstantReturnType
344  Constant(const Scalar& value);
346  EIGEN_DEVICE_FUNC static const SequentialLinSpacedReturnType
347  LinSpaced(Sequential_t, Index size, const Scalar& low, const Scalar& high);
348  EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType
349  LinSpaced(Index size, const Scalar& low, const Scalar& high);
350  EIGEN_DEVICE_FUNC static const SequentialLinSpacedReturnType
351  LinSpaced(Sequential_t, const Scalar& low, const Scalar& high);
352  EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType
353  LinSpaced(const Scalar& low, const Scalar& high);
354 
355  template<typename CustomNullaryOp> EIGEN_DEVICE_FUNC
357  NullaryExpr(Index rows, Index cols, const CustomNullaryOp& func);
358  template<typename CustomNullaryOp> EIGEN_DEVICE_FUNC
360  NullaryExpr(Index size, const CustomNullaryOp& func);
361  template<typename CustomNullaryOp> EIGEN_DEVICE_FUNC
363  NullaryExpr(const CustomNullaryOp& func);
364 
365  EIGEN_DEVICE_FUNC static const ConstantReturnType Zero(Index rows, Index cols);
366  EIGEN_DEVICE_FUNC static const ConstantReturnType Zero(Index size);
367  EIGEN_DEVICE_FUNC static const ConstantReturnType Zero();
368  EIGEN_DEVICE_FUNC static const ConstantReturnType Ones(Index rows, Index cols);
369  EIGEN_DEVICE_FUNC static const ConstantReturnType Ones(Index size);
370  EIGEN_DEVICE_FUNC static const ConstantReturnType Ones();
371 
372  EIGEN_DEVICE_FUNC void fill(const Scalar& value);
373  EIGEN_DEVICE_FUNC Derived& setConstant(const Scalar& value);
374  EIGEN_DEVICE_FUNC Derived& setLinSpaced(Index size, const Scalar& low, const Scalar& high);
375  EIGEN_DEVICE_FUNC Derived& setLinSpaced(const Scalar& low, const Scalar& high);
376  EIGEN_DEVICE_FUNC Derived& setZero();
377  EIGEN_DEVICE_FUNC Derived& setOnes();
378  EIGEN_DEVICE_FUNC Derived& setRandom();
379 
380  template<typename OtherDerived> EIGEN_DEVICE_FUNC
381  bool isApprox(const DenseBase<OtherDerived>& other,
382  const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
383  EIGEN_DEVICE_FUNC
384  bool isMuchSmallerThan(const RealScalar& other,
385  const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
386  template<typename OtherDerived> EIGEN_DEVICE_FUNC
387  bool isMuchSmallerThan(const DenseBase<OtherDerived>& other,
388  const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
389 
390  EIGEN_DEVICE_FUNC bool isApproxToConstant(const Scalar& value, const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
391  EIGEN_DEVICE_FUNC bool isConstant(const Scalar& value, const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
392  EIGEN_DEVICE_FUNC bool isZero(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
393  EIGEN_DEVICE_FUNC bool isOnes(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
394 
395  inline bool hasNaN() const;
396  inline bool allFinite() const;
397 
398  EIGEN_DEVICE_FUNC
399  inline Derived& operator*=(const Scalar& other);
400  EIGEN_DEVICE_FUNC
401  inline Derived& operator/=(const Scalar& other);
402 
403  typedef typename internal::add_const_on_value_type<typename internal::eval<Derived>::type>::type EvalReturnType;
411  EIGEN_DEVICE_FUNC
412  EIGEN_STRONG_INLINE EvalReturnType eval() const
413  {
414  // Even though MSVC does not honor strong inlining when the return type
415  // is a dynamic matrix, we desperately need strong inlining for fixed
416  // size types on MSVC.
417  return typename internal::eval<Derived>::type(derived());
418  }
419 
423  template<typename OtherDerived>
424  EIGEN_DEVICE_FUNC
425  void swap(const DenseBase<OtherDerived>& other)
426  {
427  EIGEN_STATIC_ASSERT(!OtherDerived::IsPlainObjectBase,THIS_EXPRESSION_IS_NOT_A_LVALUE__IT_IS_READ_ONLY);
428  eigen_assert(rows()==other.rows() && cols()==other.cols());
429  call_assignment(derived(), other.const_cast_derived(), internal::swap_assign_op<Scalar>());
430  }
431 
435  template<typename OtherDerived>
436  EIGEN_DEVICE_FUNC
438  {
439  eigen_assert(rows()==other.rows() && cols()==other.cols());
440  call_assignment(derived(), other.derived(), internal::swap_assign_op<Scalar>());
441  }
442 
443  EIGEN_DEVICE_FUNC inline const NestByValue<Derived> nestByValue() const;
444  EIGEN_DEVICE_FUNC inline const ForceAlignedAccess<Derived> forceAlignedAccess() const;
445  EIGEN_DEVICE_FUNC inline ForceAlignedAccess<Derived> forceAlignedAccess();
446  template<bool Enable> EIGEN_DEVICE_FUNC
447  inline const typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type forceAlignedAccessIf() const;
448  template<bool Enable> EIGEN_DEVICE_FUNC
449  inline typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type forceAlignedAccessIf();
450 
451  EIGEN_DEVICE_FUNC Scalar sum() const;
452  EIGEN_DEVICE_FUNC Scalar mean() const;
453  EIGEN_DEVICE_FUNC Scalar trace() const;
454 
455  EIGEN_DEVICE_FUNC Scalar prod() const;
456 
457  EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar minCoeff() const;
458  EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar maxCoeff() const;
460  template<typename IndexType> EIGEN_DEVICE_FUNC
461  typename internal::traits<Derived>::Scalar minCoeff(IndexType* row, IndexType* col) const;
462  template<typename IndexType> EIGEN_DEVICE_FUNC
463  typename internal::traits<Derived>::Scalar maxCoeff(IndexType* row, IndexType* col) const;
464  template<typename IndexType> EIGEN_DEVICE_FUNC
465  typename internal::traits<Derived>::Scalar minCoeff(IndexType* index) const;
466  template<typename IndexType> EIGEN_DEVICE_FUNC
467  typename internal::traits<Derived>::Scalar maxCoeff(IndexType* index) const;
468 
469  template<typename BinaryOp>
470  EIGEN_DEVICE_FUNC
471  Scalar redux(const BinaryOp& func) const;
472 
473  template<typename Visitor>
474  EIGEN_DEVICE_FUNC
475  void visit(Visitor& func) const;
476 
477  inline const WithFormat<Derived> format(const IOFormat& fmt) const;
478 
480  EIGEN_DEVICE_FUNC
481  CoeffReturnType value() const
482  {
483  EIGEN_STATIC_ASSERT_SIZE_1x1(Derived)
484  eigen_assert(this->rows() == 1 && this->cols() == 1);
485  return derived().coeff(0,0);
486  }
488  bool all() const;
489  bool any() const;
490  Index count() const;
491 
496 
504  //Code moved here due to a CUDA compiler bug
505  EIGEN_DEVICE_FUNC inline ConstRowwiseReturnType rowwise() const {
506  return ConstRowwiseReturnType(derived());
507  }
508  EIGEN_DEVICE_FUNC RowwiseReturnType rowwise();
509 
517  EIGEN_DEVICE_FUNC inline ConstColwiseReturnType colwise() const {
518  return ConstColwiseReturnType(derived());
519  }
520  EIGEN_DEVICE_FUNC ColwiseReturnType colwise();
521 
522  typedef CwiseNullaryOp<internal::scalar_random_op<Scalar>,PlainObject> RandomReturnType;
523  static const RandomReturnType Random(Index rows, Index cols);
524  static const RandomReturnType Random(Index size);
525  static const RandomReturnType Random();
526 
527  template<typename ThenDerived,typename ElseDerived>
529  select(const DenseBase<ThenDerived>& thenMatrix,
530  const DenseBase<ElseDerived>& elseMatrix) const;
531 
532  template<typename ThenDerived>
534  select(const DenseBase<ThenDerived>& thenMatrix, const typename ThenDerived::Scalar& elseScalar) const;
535 
536  template<typename ElseDerived>
538  select(const typename ElseDerived::Scalar& thenScalar, const DenseBase<ElseDerived>& elseMatrix) const;
539 
540  template<int p> RealScalar lpNorm() const;
542  template<int RowFactor, int ColFactor>
543  EIGEN_DEVICE_FUNC
553  //Code moved here due to a CUDA compiler bug
554  EIGEN_DEVICE_FUNC
555  const Replicate<Derived, Dynamic, Dynamic> replicate(Index rowFactor, Index colFactor) const
556  {
557  return Replicate<Derived, Dynamic, Dynamic>(derived(), rowFactor, colFactor);
558  }
559 
560  typedef Reverse<Derived, BothDirections> ReverseReturnType;
561  typedef const Reverse<const Derived, BothDirections> ConstReverseReturnType;
562  EIGEN_DEVICE_FUNC ReverseReturnType reverse();
564  //Code moved here due to a CUDA compiler bug
565  EIGEN_DEVICE_FUNC ConstReverseReturnType reverse() const
566  {
567  return ConstReverseReturnType(derived());
568  }
569  EIGEN_DEVICE_FUNC void reverseInPlace();
570 
571 #define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::DenseBase
572 # include "../plugins/BlockMethods.h"
573 # ifdef EIGEN_DENSEBASE_PLUGIN
574 # include EIGEN_DENSEBASE_PLUGIN
575 # endif
576 #undef EIGEN_CURRENT_STORAGE_BASE_CLASS
577 
578 
579  // disable the use of evalTo for dense objects with a nice compilation error
580  template<typename Dest>
581  EIGEN_DEVICE_FUNC
582  inline void evalTo(Dest& ) const
583  {
584  EIGEN_STATIC_ASSERT((internal::is_same<Dest,void>::value),THE_EVAL_EVALTO_FUNCTION_SHOULD_NEVER_BE_CALLED_FOR_DENSE_OBJECTS);
585  }
586 
587  protected:
589  EIGEN_DEVICE_FUNC DenseBase()
590  {
591  /* Just checks for self-consistency of the flags.
592  * Only do it when debugging Eigen, as this borders on paranoiac and could slow compilation down
593  */
594 #ifdef EIGEN_INTERNAL_DEBUGGING
595  EIGEN_STATIC_ASSERT((EIGEN_IMPLIES(MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1, int(IsRowMajor))
596  && EIGEN_IMPLIES(MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1, int(!IsRowMajor))),
597  INVALID_STORAGE_ORDER_FOR_THIS_VECTOR_EXPRESSION)
598 #endif
599  }
600 
601  private:
602  EIGEN_DEVICE_FUNC explicit DenseBase(int);
603  EIGEN_DEVICE_FUNC DenseBase(int,int);
604  template<typename OtherDerived> EIGEN_DEVICE_FUNC explicit DenseBase(const DenseBase<OtherDerived>&);
605 };
606 
607 } // end namespace Eigen
608 
609 #endif // EIGEN_DENSEBASE_H
ConstReverseReturnType reverse() const
Definition: DenseBase.h:565
Generic expression of a matrix where all coefficients are defined by a functor.
Definition: CwiseNullaryOp.h:44
bool isApprox(const DenseBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: Fuzzy.h:103
const Replicate< Derived, Dynamic, Dynamic > replicate(Index rowFactor, Index colFactor) const
Definition: DenseBase.h:555
ColXpr col(Index i)
Definition: DenseBase.h:778
Enforce aligned packet loads and stores regardless of what is requested.
Definition: ForceAlignedAccess.h:34
Definition: Constants.h:314
internal::traits< Derived >::Scalar Scalar
Definition: DenseBase.h:72
bool any() const
Definition: BooleanRedux.h:107
const Replicate< Derived, RowFactor, ColFactor > replicate() const
Definition: Replicate.h:118
Scalar prod() const
Definition: Redux.h:487
bool allFinite() const
Definition: BooleanRedux.h:153
Expression of the transpose of a matrix.
Definition: Transpose.h:53
Derived & setRandom()
Definition: Random.h:132
static const SequentialLinSpacedReturnType LinSpaced(Sequential_t, Index size, const Scalar &low, const Scalar &high)
Sets a linearly space vector.
Definition: CwiseNullaryOp.h:245
Definition: LDLT.h:16
Scalar value_type
Definition: DenseBase.h:77
Derived & operator=(const DenseBase< OtherDerived > &other)
Definition: Assign.h:39
void visit(Visitor &func) const
Definition: Visitor.h:107
internal::traits< Derived >::Scalar maxCoeff() const
Definition: Redux.h:449
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
Definition: NumTraits.h:107
RowXpr row(Index i)
Definition: DenseBase.h:797
Definition: DenseBase.h:120
Definition: DenseBase.h:107
Pseudo expression providing partial reduction operations.
Definition: ForwardDeclarations.h:242
ConstColwiseReturnType colwise() const
Definition: DenseBase.h:517
const unsigned int RowMajorBit
Definition: Constants.h:53
Base class for all dense matrices, vectors, and arrays.
Definition: DenseBase.h:41
CommaInitializer< Derived > operator<<(const Scalar &s)
Definition: CommaInitializer.h:147
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:193
static const RandomReturnType Random()
Definition: Random.h:114
Scalar mean() const
Definition: Redux.h:473
TransposeReturnType transpose()
Definition: Transpose.h:166
Definition: DenseBase.h:148
static const ConstantReturnType Constant(Index rows, Index cols, const Scalar &value)
Definition: CwiseNullaryOp.h:182
void resize(Index newSize)
Definition: DenseBase.h:252
Helper class used by the comma initializer operator.
Definition: CommaInitializer.h:28
internal::traits< Derived >::StorageIndex StorageIndex
The type used to store indices.
Definition: DenseBase.h:69
Definition: EigenBase.h:28
Definition: Constants.h:494
Index innerSize() const
Definition: DenseBase.h:241
bool isZero(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: CwiseNullaryOp.h:486
Definition: DenseBase.h:160
Index outerSize() const
Definition: DenseBase.h:229
Definition: DenseBase.h:137
static const ConstantReturnType Zero()
Definition: CwiseNullaryOp.h:472
void fill(const Scalar &value)
Definition: CwiseNullaryOp.h:326
CoeffReturnType value() const
Definition: DenseBase.h:481
Dense storage base class for matrices and arrays.
Definition: PlainObjectBase.h:88
Expression of the multiple replication of a matrix or vector.
Definition: Replicate.h:60
EIGEN_DEPRECATED const Derived & flagged() const
Definition: DenseBase.h:323
bool isOnes(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: CwiseNullaryOp.h:617
bool all() const
Definition: BooleanRedux.h:81
EvalReturnType eval() const
Definition: DenseBase.h:412
Scalar sum() const
Definition: Redux.h:460
Expression which must be nested by value.
Definition: NestByValue.h:35
void swap(const DenseBase< OtherDerived > &other)
Definition: DenseBase.h:425
ReverseReturnType reverse()
Definition: Reverse.h:118
static const ConstantReturnType Ones()
Definition: CwiseNullaryOp.h:602
Derived & setLinSpaced(Index size, const Scalar &low, const Scalar &high)
Sets a linearly space vector.
Definition: CwiseNullaryOp.h:391
DenseBase()
Definition: DenseBase.h:589
Derived & lazyAssign(const DenseBase< OtherDerived > &other)
Definition: Assign.h:20
bool hasNaN() const
Definition: BooleanRedux.h:143
internal::traits< Derived >::Scalar minCoeff() const
Definition: Redux.h:439
const Select< Derived, ThenDerived, ElseDerived > select(const DenseBase< ThenDerived > &thenMatrix, const DenseBase< ElseDerived > &elseMatrix) const
Definition: Select.h:124
Definition: DenseBase.h:113
Definition: Eigen_Colamd.h:54
Definition: DenseBase.h:172
internal::conditional< internal::is_same< typename internal::traits< Derived >::XprKind, MatrixXpr >::value, PlainMatrix, PlainArray >::type PlainObject
The plain matrix or array type corresponding to this expression.
Definition: DenseBase.h:212
Index nonZeros() const
Definition: DenseBase.h:217
bool isConstant(const Scalar &value, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: CwiseNullaryOp.h:316
Derived & setZero()
Definition: CwiseNullaryOp.h:504
Index count() const
Definition: BooleanRedux.h:133
General-purpose arrays with easy API for coefficient-wise operations.
Definition: Array.h:45
Definition: Constants.h:316
Derived & setOnes()
Definition: CwiseNullaryOp.h:630
ConstRowwiseReturnType rowwise() const
Definition: DenseBase.h:505
const NestByValue< Derived > nestByValue() const
Definition: NestByValue.h:104
void reverseInPlace()
Definition: Reverse.h:139
bool isApproxToConstant(const Scalar &value, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: CwiseNullaryOp.h:301
Derived & setConstant(const Scalar &value)
Definition: CwiseNullaryOp.h:336
Definition: Constants.h:312
Definition: DenseBase.h:167
const WithFormat< Derived > format(const IOFormat &fmt) const
Definition: IO.h:121
void transposeInPlace()
Definition: Transpose.h:278
Definition: DenseBase.h:126
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:178
Pseudo expression providing matrix output with given format.
Definition: IO.h:94
Expression of the reverse of a vector or matrix.
Definition: Reverse.h:63
Stores a set of parameters controlling the way matrices are printed.
Definition: IO.h:50
void resize(Index rows, Index cols)
Definition: DenseBase.h:263
void swap(PlainObjectBase< OtherDerived > &other)
Definition: DenseBase.h:437
Expression of a coefficient wise version of the C++ ternary operator ?:
Definition: Select.h:52