Eigen  3.2.92
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  DenseCoeffsBase<Derived> >
46 #else
47  : public DenseCoeffsBase<Derived>
48 #endif // not EIGEN_PARSED_BY_DOXYGEN
49 {
50  public:
51 
55  typedef Eigen::InnerIterator<Derived> InnerIterator;
56 
57  typedef typename internal::traits<Derived>::StorageKind StorageKind;
58 
65  typedef typename internal::traits<Derived>::StorageIndex StorageIndex;
66 
68  typedef typename internal::traits<Derived>::Scalar Scalar;
69 
73  typedef Scalar value_type;
74 
75  typedef typename NumTraits<Scalar>::Real RealScalar;
76  typedef internal::special_scalar_op_base<Derived,Scalar,RealScalar, DenseCoeffsBase<Derived> > Base;
77 
78  using Base::operator*;
79  using Base::operator/;
80  using Base::derived;
81  using Base::const_cast_derived;
82  using Base::rows;
83  using Base::cols;
84  using Base::size;
85  using Base::rowIndexByOuterInner;
86  using Base::colIndexByOuterInner;
87  using Base::coeff;
88  using Base::coeffByOuterInner;
89  using Base::operator();
90  using Base::operator[];
91  using Base::x;
92  using Base::y;
93  using Base::z;
94  using Base::w;
95  using Base::stride;
96  using Base::innerStride;
97  using Base::outerStride;
98  using Base::rowStride;
99  using Base::colStride;
100  typedef typename Base::CoeffReturnType CoeffReturnType;
101 
102  enum {
103 
104  RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime,
110  ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime,
117  SizeAtCompileTime = (internal::size_at_compile_time<internal::traits<Derived>::RowsAtCompileTime,
118  internal::traits<Derived>::ColsAtCompileTime>::ret),
123  MaxRowsAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime,
134  MaxColsAtCompileTime = internal::traits<Derived>::MaxColsAtCompileTime,
145  MaxSizeAtCompileTime = (internal::size_at_compile_time<internal::traits<Derived>::MaxRowsAtCompileTime,
146  internal::traits<Derived>::MaxColsAtCompileTime>::ret),
157  IsVectorAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime == 1
158  || internal::traits<Derived>::MaxColsAtCompileTime == 1,
164  Flags = internal::traits<Derived>::Flags,
171  InnerSizeAtCompileTime = int(IsVectorAtCompileTime) ? int(SizeAtCompileTime)
172  : int(IsRowMajor) ? int(ColsAtCompileTime) : int(RowsAtCompileTime),
173 
174  InnerStrideAtCompileTime = internal::inner_stride_at_compile_time<Derived>::ret,
175  OuterStrideAtCompileTime = internal::outer_stride_at_compile_time<Derived>::ret
176  };
177 
178  typedef typename internal::find_best_packet<Scalar,SizeAtCompileTime>::type PacketScalar;
179 
180  enum { IsPlainObjectBase = 0 };
181 
185  internal::traits<Derived>::RowsAtCompileTime,
186  internal::traits<Derived>::ColsAtCompileTime,
187  AutoAlign | (internal::traits<Derived>::Flags&RowMajorBit ? RowMajor : ColMajor),
188  internal::traits<Derived>::MaxRowsAtCompileTime,
189  internal::traits<Derived>::MaxColsAtCompileTime
191 
195  internal::traits<Derived>::RowsAtCompileTime,
196  internal::traits<Derived>::ColsAtCompileTime,
197  AutoAlign | (internal::traits<Derived>::Flags&RowMajorBit ? RowMajor : ColMajor),
198  internal::traits<Derived>::MaxRowsAtCompileTime,
199  internal::traits<Derived>::MaxColsAtCompileTime
201 
208  typedef typename internal::conditional<internal::is_same<typename internal::traits<Derived>::XprKind,MatrixXpr >::value,
210 
213  EIGEN_DEVICE_FUNC
214  inline Index nonZeros() const { return size(); }
215 
221  EIGEN_DEVICE_FUNC
222  Index outerSize() const
223  {
224  return IsVectorAtCompileTime ? 1
225  : int(IsRowMajor) ? this->rows() : this->cols();
226  }
227 
233  EIGEN_DEVICE_FUNC
234  Index innerSize() const
235  {
236  return IsVectorAtCompileTime ? this->size()
237  : int(IsRowMajor) ? this->cols() : this->rows();
238  }
239 
244  EIGEN_DEVICE_FUNC
245  void resize(Index newSize)
246  {
247  EIGEN_ONLY_USED_FOR_DEBUG(newSize);
248  eigen_assert(newSize == this->size()
249  && "DenseBase::resize() does not actually allow to resize.");
250  }
255  EIGEN_DEVICE_FUNC
256  void resize(Index rows, Index cols)
257  {
258  EIGEN_ONLY_USED_FOR_DEBUG(rows);
259  EIGEN_ONLY_USED_FOR_DEBUG(cols);
260  eigen_assert(rows == this->rows() && cols == this->cols()
261  && "DenseBase::resize() does not actually allow to resize.");
262  }
263 
264 #ifndef EIGEN_PARSED_BY_DOXYGEN
265 
266  typedef CwiseNullaryOp<internal::scalar_constant_op<Scalar>,PlainObject> ConstantReturnType;
268  typedef CwiseNullaryOp<internal::linspaced_op<Scalar,PacketScalar,false>,PlainObject> SequentialLinSpacedReturnType;
270  typedef CwiseNullaryOp<internal::linspaced_op<Scalar,PacketScalar,true>,PlainObject> RandomAccessLinSpacedReturnType;
272  typedef Matrix<typename NumTraits<typename internal::traits<Derived>::Scalar>::Real, internal::traits<Derived>::ColsAtCompileTime, 1> EigenvaluesReturnType;
273 
274 #endif // not EIGEN_PARSED_BY_DOXYGEN
275 
277  template<typename OtherDerived>
278  EIGEN_DEVICE_FUNC
279  Derived& operator=(const DenseBase<OtherDerived>& other);
280 
284  EIGEN_DEVICE_FUNC
285  Derived& operator=(const DenseBase& other);
286 
287  template<typename OtherDerived>
288  EIGEN_DEVICE_FUNC
289  Derived& operator=(const EigenBase<OtherDerived> &other);
290 
291  template<typename OtherDerived>
292  EIGEN_DEVICE_FUNC
293  Derived& operator+=(const EigenBase<OtherDerived> &other);
294 
295  template<typename OtherDerived>
296  EIGEN_DEVICE_FUNC
297  Derived& operator-=(const EigenBase<OtherDerived> &other);
298 
299  template<typename OtherDerived>
300  EIGEN_DEVICE_FUNC
301  Derived& operator=(const ReturnByValue<OtherDerived>& func);
302 
306  template<typename OtherDerived>
307  EIGEN_DEVICE_FUNC
308  Derived& lazyAssign(const DenseBase<OtherDerived>& other);
309 
310  EIGEN_DEVICE_FUNC
311  CommaInitializer<Derived> operator<< (const Scalar& s);
312 
314  template<unsigned int Added,unsigned int Removed>
315  EIGEN_DEPRECATED
316  const Derived& flagged() const
317  { return derived(); }
318 
319  template<typename OtherDerived>
320  EIGEN_DEVICE_FUNC
321  CommaInitializer<Derived> operator<< (const DenseBase<OtherDerived>& other);
324  EIGEN_DEVICE_FUNC
325  TransposeReturnType transpose();
326  typedef typename internal::add_const<Transpose<const Derived> >::type ConstTransposeReturnType;
327  EIGEN_DEVICE_FUNC
328  ConstTransposeReturnType transpose() const;
329  EIGEN_DEVICE_FUNC
330  void transposeInPlace();
331 
332  EIGEN_DEVICE_FUNC static const ConstantReturnType
333  Constant(Index rows, Index cols, const Scalar& value);
334  EIGEN_DEVICE_FUNC static const ConstantReturnType
335  Constant(Index size, const Scalar& value);
336  EIGEN_DEVICE_FUNC static const ConstantReturnType
337  Constant(const Scalar& value);
338 
339  EIGEN_DEVICE_FUNC static const SequentialLinSpacedReturnType
340  LinSpaced(Sequential_t, Index size, const Scalar& low, const Scalar& high);
341  EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType
342  LinSpaced(Index size, const Scalar& low, const Scalar& high);
343  EIGEN_DEVICE_FUNC static const SequentialLinSpacedReturnType
344  LinSpaced(Sequential_t, const Scalar& low, const Scalar& high);
345  EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType
346  LinSpaced(const Scalar& low, const Scalar& high);
347 
348  template<typename CustomNullaryOp> EIGEN_DEVICE_FUNC
350  NullaryExpr(Index rows, Index cols, const CustomNullaryOp& func);
351  template<typename CustomNullaryOp> EIGEN_DEVICE_FUNC
353  NullaryExpr(Index size, const CustomNullaryOp& func);
354  template<typename CustomNullaryOp> EIGEN_DEVICE_FUNC
356  NullaryExpr(const CustomNullaryOp& func);
357 
358  EIGEN_DEVICE_FUNC static const ConstantReturnType Zero(Index rows, Index cols);
359  EIGEN_DEVICE_FUNC static const ConstantReturnType Zero(Index size);
360  EIGEN_DEVICE_FUNC static const ConstantReturnType Zero();
361  EIGEN_DEVICE_FUNC static const ConstantReturnType Ones(Index rows, Index cols);
362  EIGEN_DEVICE_FUNC static const ConstantReturnType Ones(Index size);
363  EIGEN_DEVICE_FUNC static const ConstantReturnType Ones();
364 
365  EIGEN_DEVICE_FUNC void fill(const Scalar& value);
366  EIGEN_DEVICE_FUNC Derived& setConstant(const Scalar& value);
367  EIGEN_DEVICE_FUNC Derived& setLinSpaced(Index size, const Scalar& low, const Scalar& high);
368  EIGEN_DEVICE_FUNC Derived& setLinSpaced(const Scalar& low, const Scalar& high);
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;
376  EIGEN_DEVICE_FUNC
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  inline bool hasNaN() const;
389  inline bool allFinite() const;
390 
391  EIGEN_DEVICE_FUNC
392  inline Derived& operator*=(const Scalar& other);
393  EIGEN_DEVICE_FUNC
394  inline Derived& operator/=(const Scalar& other);
395 
396  typedef typename internal::add_const_on_value_type<typename internal::eval<Derived>::type>::type EvalReturnType;
404  EIGEN_DEVICE_FUNC
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
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
431  {
432  eigen_assert(rows()==other.rows() && cols()==other.cols());
433  call_assignment(derived(), other.derived(), internal::swap_assign_op<Scalar>());
434  }
436  EIGEN_DEVICE_FUNC inline const NestByValue<Derived> nestByValue() const;
437  EIGEN_DEVICE_FUNC inline const ForceAlignedAccess<Derived> forceAlignedAccess() const;
438  EIGEN_DEVICE_FUNC inline ForceAlignedAccess<Derived> forceAlignedAccess();
439  template<bool Enable> EIGEN_DEVICE_FUNC
440  inline const typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type forceAlignedAccessIf() const;
441  template<bool Enable> EIGEN_DEVICE_FUNC
442  inline typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type forceAlignedAccessIf();
443 
444  EIGEN_DEVICE_FUNC Scalar sum() const;
445  EIGEN_DEVICE_FUNC Scalar mean() const;
446  EIGEN_DEVICE_FUNC Scalar trace() const;
447 
448  EIGEN_DEVICE_FUNC Scalar prod() const;
449 
450  EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar minCoeff() const;
451  EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar maxCoeff() const;
453  template<typename IndexType> EIGEN_DEVICE_FUNC
454  typename internal::traits<Derived>::Scalar minCoeff(IndexType* row, IndexType* col) const;
455  template<typename IndexType> EIGEN_DEVICE_FUNC
456  typename internal::traits<Derived>::Scalar maxCoeff(IndexType* row, IndexType* col) const;
457  template<typename IndexType> EIGEN_DEVICE_FUNC
458  typename internal::traits<Derived>::Scalar minCoeff(IndexType* index) const;
459  template<typename IndexType> EIGEN_DEVICE_FUNC
460  typename internal::traits<Derived>::Scalar maxCoeff(IndexType* index) const;
461 
462  template<typename BinaryOp>
463  EIGEN_DEVICE_FUNC
464  Scalar redux(const BinaryOp& func) const;
465 
466  template<typename Visitor>
467  EIGEN_DEVICE_FUNC
468  void visit(Visitor& func) const;
469 
470  inline const WithFormat<Derived> format(const IOFormat& fmt) const;
471 
473  EIGEN_DEVICE_FUNC
474  CoeffReturnType value() const
475  {
476  EIGEN_STATIC_ASSERT_SIZE_1x1(Derived)
477  eigen_assert(this->rows() == 1 && this->cols() == 1);
478  return derived().coeff(0,0);
479  }
480 
481  bool all() const;
482  bool any() const;
483  Index count() const;
484 
485  typedef VectorwiseOp<Derived, Horizontal> RowwiseReturnType;
486  typedef const VectorwiseOp<const Derived, Horizontal> ConstRowwiseReturnType;
489 
497  //Code moved here due to a CUDA compiler bug
498  EIGEN_DEVICE_FUNC inline ConstRowwiseReturnType rowwise() const {
499  return ConstRowwiseReturnType(derived());
500  }
501  EIGEN_DEVICE_FUNC RowwiseReturnType rowwise();
502 
510  EIGEN_DEVICE_FUNC inline ConstColwiseReturnType colwise() const {
511  return ConstColwiseReturnType(derived());
512  }
513  EIGEN_DEVICE_FUNC ColwiseReturnType colwise();
514 
515  typedef CwiseNullaryOp<internal::scalar_random_op<Scalar>,PlainObject> RandomReturnType;
516  static const RandomReturnType Random(Index rows, Index cols);
517  static const RandomReturnType Random(Index size);
518  static const RandomReturnType Random();
519 
520  template<typename ThenDerived,typename ElseDerived>
522  select(const DenseBase<ThenDerived>& thenMatrix,
523  const DenseBase<ElseDerived>& elseMatrix) const;
524 
525  template<typename ThenDerived>
527  select(const DenseBase<ThenDerived>& thenMatrix, const typename ThenDerived::Scalar& elseScalar) const;
528 
529  template<typename ElseDerived>
531  select(const typename ElseDerived::Scalar& thenScalar, const DenseBase<ElseDerived>& elseMatrix) const;
532 
533  template<int p> RealScalar lpNorm() const;
534 
535  template<int RowFactor, int ColFactor>
536  EIGEN_DEVICE_FUNC
546  //Code moved here due to a CUDA compiler bug
547  EIGEN_DEVICE_FUNC
548  const Replicate<Derived, Dynamic, Dynamic> replicate(Index rowFactor, Index colFactor) const
549  {
550  return Replicate<Derived, Dynamic, Dynamic>(derived(), rowFactor, colFactor);
551  }
552 
553  typedef Reverse<Derived, BothDirections> ReverseReturnType;
554  typedef const Reverse<const Derived, BothDirections> ConstReverseReturnType;
555  EIGEN_DEVICE_FUNC ReverseReturnType reverse();
557  //Code moved here due to a CUDA compiler bug
558  EIGEN_DEVICE_FUNC ConstReverseReturnType reverse() const
559  {
560  return ConstReverseReturnType(derived());
561  }
562  EIGEN_DEVICE_FUNC void reverseInPlace();
563 
564 #define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::DenseBase
565 # include "../plugins/BlockMethods.h"
566 # ifdef EIGEN_DENSEBASE_PLUGIN
567 # include EIGEN_DENSEBASE_PLUGIN
568 # endif
569 #undef EIGEN_CURRENT_STORAGE_BASE_CLASS
570 
571 
572  // disable the use of evalTo for dense objects with a nice compilation error
573  template<typename Dest>
574  EIGEN_DEVICE_FUNC
575  inline void evalTo(Dest& ) const
576  {
577  EIGEN_STATIC_ASSERT((internal::is_same<Dest,void>::value),THE_EVAL_EVALTO_FUNCTION_SHOULD_NEVER_BE_CALLED_FOR_DENSE_OBJECTS);
578  }
579 
580  protected:
582  EIGEN_DEVICE_FUNC DenseBase()
583  {
584  /* Just checks for self-consistency of the flags.
585  * Only do it when debugging Eigen, as this borders on paranoiac and could slow compilation down
586  */
587 #ifdef EIGEN_INTERNAL_DEBUGGING
588  EIGEN_STATIC_ASSERT((EIGEN_IMPLIES(MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1, int(IsRowMajor))
589  && EIGEN_IMPLIES(MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1, int(!IsRowMajor))),
590  INVALID_STORAGE_ORDER_FOR_THIS_VECTOR_EXPRESSION)
591 #endif
592  }
594  private:
595  EIGEN_DEVICE_FUNC explicit DenseBase(int);
596  EIGEN_DEVICE_FUNC DenseBase(int,int);
597  template<typename OtherDerived> EIGEN_DEVICE_FUNC explicit DenseBase(const DenseBase<OtherDerived>&);
598 };
599 
600 } // end namespace Eigen
601 
602 #endif // EIGEN_DENSEBASE_H
ConstReverseReturnType reverse() const
Definition: DenseBase.h:558
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
Definition: DenseBase.h:123
const Replicate< Derived, Dynamic, Dynamic > replicate(Index rowFactor, Index colFactor) const
Definition: DenseBase.h:548
ColXpr col(Index i)
Definition: DenseBase.h:778
Enforce aligned packet loads and stores regardless of what is requested.
Definition: ForceAlignedAccess.h:34
internal::traits< Derived >::Scalar Scalar
Definition: DenseBase.h:68
bool any() const
Definition: BooleanRedux.h:105
Definition: DenseBase.h:164
const Replicate< Derived, RowFactor, ColFactor > replicate() const
Definition: Replicate.h:118
Scalar prod() const
Definition: Redux.h:472
bool allFinite() const
Definition: BooleanRedux.h:153
Expression of the transpose of a matrix.
Definition: Transpose.h:53
Derived & setRandom()
Definition: Random.h:132
Definition: DenseBase.h:134
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:73
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:434
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
Pseudo expression providing partial reduction operations.
Definition: ForwardDeclarations.h:243
ConstColwiseReturnType colwise() const
Definition: DenseBase.h:510
const unsigned int RowMajorBit
Definition: Constants.h:61
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:190
static const RandomReturnType Random()
Definition: Random.h:114
Scalar mean() const
Definition: Redux.h:458
TransposeReturnType transpose()
Definition: Transpose.h:166
static const ConstantReturnType Constant(Index rows, Index cols, const Scalar &value)
Definition: CwiseNullaryOp.h:182
void resize(Index newSize)
Definition: DenseBase.h:245
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:65
Definition: EigenBase.h:28
Definition: Constants.h:505
Definition: DenseBase.h:104
Definition: DenseBase.h:169
Definition: Constants.h:320
Index innerSize() const
Definition: DenseBase.h:234
bool isZero(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: CwiseNullaryOp.h:486
Index outerSize() const
Definition: DenseBase.h:222
Definition: DenseBase.h:157
Definition: Constants.h:322
static const ConstantReturnType Zero()
Definition: CwiseNullaryOp.h:472
void fill(const Scalar &value)
Definition: CwiseNullaryOp.h:326
CoeffReturnType value() const
Definition: DenseBase.h:474
Definition: DenseBase.h:145
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:316
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:405
Scalar sum() const
Definition: Redux.h:445
Expression which must be nested by value.
Definition: NestByValue.h:35
void swap(const DenseBase< OtherDerived > &other)
Definition: DenseBase.h:418
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:582
Definition: DenseBase.h:117
Derived & lazyAssign(const DenseBase< OtherDerived > &other)
Definition: Assign.h:20
bool hasNaN() const
Definition: BooleanRedux.h:139
internal::traits< Derived >::Scalar minCoeff() const
Definition: Redux.h:424
const Select< Derived, ThenDerived, ElseDerived > select(const DenseBase< ThenDerived > &thenMatrix, const DenseBase< ElseDerived > &elseMatrix) const
Definition: Select.h:124
Definition: Eigen_Colamd.h:54
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:209
Index nonZeros() const
Definition: DenseBase.h:214
bool isConstant(const Scalar &value, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: CwiseNullaryOp.h:316
Derived & setZero()
Definition: CwiseNullaryOp.h:504
Definition: Constants.h:324
Index count() const
Definition: BooleanRedux.h:129
General-purpose arrays with easy API for coefficient-wise operations.
Definition: Array.h:45
Derived & setOnes()
Definition: CwiseNullaryOp.h:630
ConstRowwiseReturnType rowwise() const
Definition: DenseBase.h:498
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: DenseBase.h:110
const WithFormat< Derived > format(const IOFormat &fmt) const
Definition: IO.h:121
void transposeInPlace()
Definition: Transpose.h:278
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:256
void swap(PlainObjectBase< OtherDerived > &other)
Definition: DenseBase.h:430
Expression of a coefficient wise version of the C++ ternary operator ?:
Definition: Select.h:52