Eigen  3.3.9
 
Loading...
Searching...
No Matches
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
14namespace Eigen {
15
16namespace 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.
20static 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
41template<typename Derived> class DenseBase
42#ifndef EIGEN_PARSED_BY_DOXYGEN
43 : public DenseCoeffsBase<Derived, internal::accessors_level<Derived>::value>
44#else
45 : public DenseCoeffsBase<Derived,DirectWriteAccessors>
46#endif // not EIGEN_PARSED_BY_DOXYGEN
47{
48 public:
49
54
55 typedef typename internal::traits<Derived>::StorageKind StorageKind;
56
63 typedef typename internal::traits<Derived>::StorageIndex StorageIndex;
64
65 /** The numeric type of the expression' coefficients, e.g. float, double, int or std::complex<float>, etc. */
66 typedef typename internal::traits<Derived>::Scalar Scalar;
67
69
73 typedef typename NumTraits<Scalar>::Real RealScalar;
74 typedef DenseCoeffsBase<Derived, internal::accessors_level<Derived>::value> Base;
75
76 using Base::derived;
77 using Base::const_cast_derived;
78 using Base::rows;
79 using Base::cols;
80 using Base::size;
81 using Base::rowIndexByOuterInner;
82 using Base::colIndexByOuterInner;
83 using Base::coeff;
84 using Base::coeffByOuterInner;
85 using Base::operator();
86 using Base::operator[];
87 using Base::x;
88 using Base::y;
89 using Base::z;
90 using Base::w;
91 using Base::stride;
92 using Base::innerStride;
93 using Base::outerStride;
94 using Base::rowStride;
95 using Base::colStride;
96 typedef typename Base::CoeffReturnType CoeffReturnType;
97
98 enum {
99
100 RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime,
105
106 ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime,
111
112
113 SizeAtCompileTime = (internal::size_at_compile_time<internal::traits<Derived>::RowsAtCompileTime,
114 internal::traits<Derived>::ColsAtCompileTime>::ret),
118
119 MaxRowsAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime,
127 * \sa RowsAtCompileTime, MaxColsAtCompileTime, MaxSizeAtCompileTime
128 */
129
130 MaxColsAtCompileTime = internal::traits<Derived>::MaxColsAtCompileTime,
140
141 MaxSizeAtCompileTime = (internal::size_at_compile_time<internal::traits<Derived>::MaxRowsAtCompileTime,
142 internal::traits<Derived>::MaxColsAtCompileTime>::ret),
153 IsVectorAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime == 1
154 || internal::traits<Derived>::MaxColsAtCompileTime == 1,
156
160 Flags = internal::traits<Derived>::Flags,
163
164
166
167 InnerSizeAtCompileTime = int(IsVectorAtCompileTime) ? int(SizeAtCompileTime)
169
170 InnerStrideAtCompileTime = internal::inner_stride_at_compile_time<Derived>::ret,
171 OuterStrideAtCompileTime = internal::outer_stride_at_compile_time<Derived>::ret
172 };
173
174 typedef typename internal::find_best_packet<Scalar,SizeAtCompileTime>::type PacketScalar;
175
176 enum { IsPlainObjectBase = 0 };
177
179 * \sa PlainObject */
181 internal::traits<Derived>::RowsAtCompileTime,
182 internal::traits<Derived>::ColsAtCompileTime,
183 AutoAlign | (internal::traits<Derived>::Flags&RowMajorBit ? RowMajor : ColMajor),
184 internal::traits<Derived>::MaxRowsAtCompileTime,
185 internal::traits<Derived>::MaxColsAtCompileTime
187
191 internal::traits<Derived>::RowsAtCompileTime,
192 internal::traits<Derived>::ColsAtCompileTime,
193 AutoAlign | (internal::traits<Derived>::Flags&RowMajorBit ? RowMajor : ColMajor),
194 internal::traits<Derived>::MaxRowsAtCompileTime,
195 internal::traits<Derived>::MaxColsAtCompileTime
197
204 typedef typename internal::conditional<internal::is_same<typename internal::traits<Derived>::XprKind,MatrixXpr >::value,
206
208
209 EIGEN_DEVICE_FUNC
210 inline Index nonZeros() const { return size(); }
211
212 /** \returns the outer size.
213 *
214 * \note For a vector, this returns just 1. For a matrix (non-vector), this is the major dimension
215 * with respect to the \ref TopicStorageOrders "storage order", i.e., the number of columns for a
216 * column-major matrix, and the number of rows for a row-major matrix. */
217 EIGEN_DEVICE_FUNC
219 {
220 return IsVectorAtCompileTime ? 1
221 : int(IsRowMajor) ? this->rows() : this->cols();
222 }
223
229 EIGEN_DEVICE_FUNC
231 {
232 return IsVectorAtCompileTime ? this->size()
233 : int(IsRowMajor) ? this->cols() : this->rows();
234 }
235
237 * Matrix::resize() and Array::resize(). The present method only asserts that the new size equals the old size, and does
238 * nothing else.
239 */
240 EIGEN_DEVICE_FUNC
241 void resize(Index newSize)
242 {
243 EIGEN_ONLY_USED_FOR_DEBUG(newSize);
244 eigen_assert(newSize == this->size()
245 && "DenseBase::resize() does not actually allow to resize.");
246 }
248
251 EIGEN_DEVICE_FUNC
252 void resize(Index rows, Index cols)
253 {
254 EIGEN_ONLY_USED_FOR_DEBUG(rows);
255 EIGEN_ONLY_USED_FOR_DEBUG(cols);
256 eigen_assert(rows == this->rows() && cols == this->cols()
257 && "DenseBase::resize() does not actually allow to resize.");
258 }
259
260#ifndef EIGEN_PARSED_BY_DOXYGEN
262 typedef CwiseNullaryOp<internal::scalar_constant_op<Scalar>,PlainObject> ConstantReturnType;
268 typedef Matrix<typename NumTraits<typename internal::traits<Derived>::Scalar>::Real, internal::traits<Derived>::ColsAtCompileTime, 1> EigenvaluesReturnType;
269
270#endif // not EIGEN_PARSED_BY_DOXYGEN
273 template<typename OtherDerived>
274 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
275 Derived& operator=(const DenseBase<OtherDerived>& other);
276
280 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
281 Derived& operator=(const DenseBase& other);
282
283 template<typename OtherDerived>
284 EIGEN_DEVICE_FUNC
285 Derived& operator=(const EigenBase<OtherDerived> &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 ReturnByValue<OtherDerived>& func);
298
301
302 template<typename OtherDerived>
303 EIGEN_DEVICE_FUNC
304 Derived& lazyAssign(const DenseBase<OtherDerived>& other);
305
306 EIGEN_DEVICE_FUNC
308
310 template<unsigned int Added,unsigned int Removed>
311 EIGEN_DEPRECATED
312 const Derived& flagged() const
313 { return derived(); }
314
315 template<typename OtherDerived>
316 EIGEN_DEVICE_FUNC
318
319 typedef Transpose<Derived> TransposeReturnType;
320 EIGEN_DEVICE_FUNC
321 TransposeReturnType transpose();
322 typedef typename internal::add_const<Transpose<const Derived> >::type ConstTransposeReturnType;
323 EIGEN_DEVICE_FUNC
324 ConstTransposeReturnType transpose() const;
325 EIGEN_DEVICE_FUNC
326 void transposeInPlace();
327
328 EIGEN_DEVICE_FUNC static const ConstantReturnType
329 Constant(Index rows, Index cols, const Scalar& value);
330 EIGEN_DEVICE_FUNC static const ConstantReturnType
331 Constant(Index size, const Scalar& value);
332 EIGEN_DEVICE_FUNC static const ConstantReturnType
333 Constant(const Scalar& value);
334
335 EIGEN_DEVICE_FUNC static const SequentialLinSpacedReturnType
336 LinSpaced(Sequential_t, Index size, const Scalar& low, const Scalar& high);
337 EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType
338 LinSpaced(Index size, const Scalar& low, const Scalar& high);
339 EIGEN_DEVICE_FUNC static const SequentialLinSpacedReturnType
340 LinSpaced(Sequential_t, const Scalar& low, const Scalar& high);
341 EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType
342 LinSpaced(const Scalar& low, const Scalar& high);
343
344 template<typename CustomNullaryOp> EIGEN_DEVICE_FUNC
346 NullaryExpr(Index rows, Index cols, const CustomNullaryOp& func);
347 template<typename CustomNullaryOp> EIGEN_DEVICE_FUNC
349 NullaryExpr(Index size, const CustomNullaryOp& func);
350 template<typename CustomNullaryOp> EIGEN_DEVICE_FUNC
352 NullaryExpr(const CustomNullaryOp& func);
353
354 EIGEN_DEVICE_FUNC static const ConstantReturnType Zero(Index rows, Index cols);
355 EIGEN_DEVICE_FUNC static const ConstantReturnType Zero(Index size);
356 EIGEN_DEVICE_FUNC static const ConstantReturnType Zero();
357 EIGEN_DEVICE_FUNC static const ConstantReturnType Ones(Index rows, Index cols);
358 EIGEN_DEVICE_FUNC static const ConstantReturnType Ones(Index size);
359 EIGEN_DEVICE_FUNC static const ConstantReturnType Ones();
360
361 EIGEN_DEVICE_FUNC void fill(const Scalar& value);
362 EIGEN_DEVICE_FUNC Derived& setConstant(const Scalar& value);
363 EIGEN_DEVICE_FUNC Derived& setLinSpaced(Index size, const Scalar& low, const Scalar& high);
364 EIGEN_DEVICE_FUNC Derived& setLinSpaced(const Scalar& low, const Scalar& high);
365 EIGEN_DEVICE_FUNC Derived& setZero();
366 EIGEN_DEVICE_FUNC Derived& setOnes();
367 EIGEN_DEVICE_FUNC Derived& setRandom();
368
369 template<typename OtherDerived> EIGEN_DEVICE_FUNC
370 bool isApprox(const DenseBase<OtherDerived>& other,
371 const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
372 EIGEN_DEVICE_FUNC
373 bool isMuchSmallerThan(const RealScalar& other,
374 const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
375 template<typename OtherDerived> EIGEN_DEVICE_FUNC
376 bool isMuchSmallerThan(const DenseBase<OtherDerived>& other,
377 const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
378
379 EIGEN_DEVICE_FUNC bool isApproxToConstant(const Scalar& value, const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
380 EIGEN_DEVICE_FUNC bool isConstant(const Scalar& value, const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
381 EIGEN_DEVICE_FUNC bool isZero(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
382 EIGEN_DEVICE_FUNC bool isOnes(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
383
384 inline bool hasNaN() const;
385 inline bool allFinite() const;
386
387 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
388 Derived& operator*=(const Scalar& other);
389 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
390 Derived& operator/=(const Scalar& other);
391
392 typedef typename internal::add_const_on_value_type<typename internal::eval<Derived>::type>::type EvalReturnType;
400 EIGEN_DEVICE_FUNC
401 EIGEN_STRONG_INLINE EvalReturnType eval() const
402 {
403 // Even though MSVC does not honor strong inlining when the return type
404 // is a dynamic matrix, we desperately need strong inlining for fixed
405 // size types on MSVC.
406 return typename internal::eval<Derived>::type(derived());
408
412 template<typename OtherDerived>
413 EIGEN_DEVICE_FUNC
414 void swap(const DenseBase<OtherDerived>& other)
415 {
416 EIGEN_STATIC_ASSERT(!OtherDerived::IsPlainObjectBase,THIS_EXPRESSION_IS_NOT_A_LVALUE__IT_IS_READ_ONLY);
417 eigen_assert(rows()==other.rows() && cols()==other.cols());
418 call_assignment(derived(), other.const_cast_derived(), internal::swap_assign_op<Scalar>());
419 }
420
424 template<typename OtherDerived>
425 EIGEN_DEVICE_FUNC
427 {
428 eigen_assert(rows()==other.rows() && cols()==other.cols());
429 call_assignment(derived(), other.derived(), internal::swap_assign_op<Scalar>());
430 }
431
432 EIGEN_DEVICE_FUNC inline const NestByValue<Derived> nestByValue() const;
433 EIGEN_DEVICE_FUNC inline const ForceAlignedAccess<Derived> forceAlignedAccess() const;
434 EIGEN_DEVICE_FUNC inline ForceAlignedAccess<Derived> forceAlignedAccess();
435 template<bool Enable> EIGEN_DEVICE_FUNC
436 inline const typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type forceAlignedAccessIf() const;
437 template<bool Enable> EIGEN_DEVICE_FUNC
438 inline typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type forceAlignedAccessIf();
439
440 EIGEN_DEVICE_FUNC Scalar sum() const;
441 EIGEN_DEVICE_FUNC Scalar mean() const;
442 EIGEN_DEVICE_FUNC Scalar trace() const;
443
444 EIGEN_DEVICE_FUNC Scalar prod() const;
445
446 EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar minCoeff() const;
447 EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar maxCoeff() const;
448
449 template<typename IndexType> EIGEN_DEVICE_FUNC
450 typename internal::traits<Derived>::Scalar minCoeff(IndexType* row, IndexType* col) const;
451 template<typename IndexType> EIGEN_DEVICE_FUNC
452 typename internal::traits<Derived>::Scalar maxCoeff(IndexType* row, IndexType* col) const;
453 template<typename IndexType> EIGEN_DEVICE_FUNC
454 typename internal::traits<Derived>::Scalar minCoeff(IndexType* index) const;
455 template<typename IndexType> EIGEN_DEVICE_FUNC
456 typename internal::traits<Derived>::Scalar maxCoeff(IndexType* index) const;
457
458 template<typename BinaryOp>
459 EIGEN_DEVICE_FUNC
460 Scalar redux(const BinaryOp& func) const;
461
462 template<typename Visitor>
463 EIGEN_DEVICE_FUNC
464 void visit(Visitor& func) const;
465
466
471 * \sa class IOFormat, class WithFormat
472 */
473 inline const WithFormat<Derived> format(const IOFormat& fmt) const
474 {
475 return WithFormat<Derived>(derived(), fmt);
476 }
477
479 EIGEN_DEVICE_FUNC
480 CoeffReturnType value() const
481 {
482 EIGEN_STATIC_ASSERT_SIZE_1x1(Derived)
483 eigen_assert(this->rows() == 1 && this->cols() == 1);
484 return derived().coeff(0,0);
485 }
486
487 EIGEN_DEVICE_FUNC bool all() const;
488 EIGEN_DEVICE_FUNC bool any() const;
489 EIGEN_DEVICE_FUNC Index count() const;
490
491 typedef VectorwiseOp<Derived, Horizontal> RowwiseReturnType;
492 typedef const VectorwiseOp<const Derived, Horizontal> ConstRowwiseReturnType;
493 typedef VectorwiseOp<Derived, Vertical> ColwiseReturnType;
494 typedef const VectorwiseOp<const Derived, Vertical> ConstColwiseReturnType;
495
496 /** \returns a VectorwiseOp wrapper of *this providing additional partial reduction operations
497 *
498 * Example: \include MatrixBase_rowwise.cpp
499 * Output: \verbinclude MatrixBase_rowwise.out
500 *
501 * \sa colwise(), class VectorwiseOp, \ref TutorialReductionsVisitorsBroadcasting
502 */
503 //Code moved here due to a CUDA compiler bug
504 EIGEN_DEVICE_FUNC inline ConstRowwiseReturnType rowwise() const {
505 return ConstRowwiseReturnType(derived());
506 }
507 EIGEN_DEVICE_FUNC RowwiseReturnType rowwise();
508
516 EIGEN_DEVICE_FUNC inline ConstColwiseReturnType colwise() const {
517 return ConstColwiseReturnType(derived());
519 EIGEN_DEVICE_FUNC ColwiseReturnType colwise();
520
521 typedef CwiseNullaryOp<internal::scalar_random_op<Scalar>,PlainObject> RandomReturnType;
522 static const RandomReturnType Random(Index rows, Index cols);
523 static const RandomReturnType Random(Index size);
524 static const RandomReturnType Random();
525
526 template<typename ThenDerived,typename ElseDerived>
528 select(const DenseBase<ThenDerived>& thenMatrix,
529 const DenseBase<ElseDerived>& elseMatrix) const;
530
531 template<typename ThenDerived>
533 select(const DenseBase<ThenDerived>& thenMatrix, const typename ThenDerived::Scalar& elseScalar) const;
534
535 template<typename ElseDerived>
537 select(const typename ElseDerived::Scalar& thenScalar, const DenseBase<ElseDerived>& elseMatrix) const;
538
539 template<int p> RealScalar lpNorm() const;
540
541 template<int RowFactor, int ColFactor>
542 EIGEN_DEVICE_FUNC
547 * Example: \include MatrixBase_replicate_int_int.cpp
548 * Output: \verbinclude MatrixBase_replicate_int_int.out
549 *
550 * \sa VectorwiseOp::replicate(), DenseBase::replicate<int,int>(), class Replicate
551 */
552 //Code moved here due to a CUDA compiler bug
553 EIGEN_DEVICE_FUNC
555 {
556 return Replicate<Derived, Dynamic, Dynamic>(derived(), rowFactor, colFactor);
557 }
558
559 typedef Reverse<Derived, BothDirections> ReverseReturnType;
560 typedef const Reverse<const Derived, BothDirections> ConstReverseReturnType;
561 EIGEN_DEVICE_FUNC ReverseReturnType reverse();
563 //Code moved here due to a CUDA compiler bug
564 EIGEN_DEVICE_FUNC ConstReverseReturnType reverse() const
565 {
566 return ConstReverseReturnType(derived());
567 }
568 EIGEN_DEVICE_FUNC void reverseInPlace();
569
570#define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::DenseBase
571#define EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
572#define EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(COND)
573# include "../plugins/BlockMethods.h"
574# ifdef EIGEN_DENSEBASE_PLUGIN
575# include EIGEN_DENSEBASE_PLUGIN
576# endif
577#undef EIGEN_CURRENT_STORAGE_BASE_CLASS
578#undef EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
579#undef EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF
580
581 // disable the use of evalTo for dense objects with a nice compilation error
582 template<typename Dest>
583 EIGEN_DEVICE_FUNC
584 inline void evalTo(Dest& ) const
585 {
586 EIGEN_STATIC_ASSERT((internal::is_same<Dest,void>::value),THE_EVAL_EVALTO_FUNCTION_SHOULD_NEVER_BE_CALLED_FOR_DENSE_OBJECTS);
587 }
588
589 protected:
590 EIGEN_DEFAULT_COPY_CONSTRUCTOR(DenseBase)
592 EIGEN_DEVICE_FUNC DenseBase()
593 {
594 /* Just checks for self-consistency of the flags.
595 * Only do it when debugging Eigen, as this borders on paranoia and could slow compilation down
596 */
597#ifdef EIGEN_INTERNAL_DEBUGGING
598 EIGEN_STATIC_ASSERT((EIGEN_IMPLIES(MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1, int(IsRowMajor))
599 && EIGEN_IMPLIES(MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1, int(!IsRowMajor))),
600 INVALID_STORAGE_ORDER_FOR_THIS_VECTOR_EXPRESSION)
601#endif
602 }
604 private:
605 EIGEN_DEVICE_FUNC explicit DenseBase(int);
606 EIGEN_DEVICE_FUNC DenseBase(int,int);
607 template<typename OtherDerived> EIGEN_DEVICE_FUNC explicit DenseBase(const DenseBase<OtherDerived>&);
608};
609
610} // end namespace Eigen
611
612#endif // EIGEN_DENSEBASE_H
General-purpose arrays with easy API for coefficient-wise operations.
Definition Array.h:47
Generic expression of a matrix where all coefficients are defined by a functor.
Definition CwiseNullaryOp.h:61
Base class for all dense matrices, vectors, and arrays.
Definition DenseBase.h:47
RowXpr row(Index i)
Definition DenseBase.h:860
CommaInitializer< Derived > operator<<(const Scalar &s)
Definition CommaInitializer.h:144
const WithFormat< Derived > format(const IOFormat &fmt) const
Definition DenseBase.h:473
bool isConstant(const Scalar &value, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition CwiseNullaryOp.h:305
Scalar mean() const
Definition Redux.h:462
Index count() const
Definition BooleanRedux.h:129
Derived & setOnes()
Definition CwiseNullaryOp.h:625
void resize(Index rows, Index cols)
Definition DenseBase.h:252
static const ConstantReturnType Ones()
Definition CwiseNullaryOp.h:597
ColXpr col(Index i)
Definition DenseBase.h:839
internal::traits< Derived >::StorageIndex StorageIndex
The type used to store indices.
Definition DenseBase.h:63
void resize(Index newSize)
Definition DenseBase.h:241
ReverseReturnType reverse()
Definition Reverse.h:118
const NestByValue< Derived > nestByValue() const
Definition NestByValue.h:103
void visit(Visitor &func) const
Definition Visitor.h:107
static const ConstantReturnType Zero()
Definition CwiseNullaryOp.h:467
void swap(PlainObjectBase< OtherDerived > &other)
Definition DenseBase.h:426
Index outerSize() const
Definition DenseBase.h:218
Eigen::InnerIterator< Derived > InnerIterator
Definition DenseBase.h:53
ConstColwiseReturnType colwise() const
Definition DenseBase.h:516
Derived & setLinSpaced(Index size, const Scalar &low, const Scalar &high)
Sets a linearly spaced vector.
Definition CwiseNullaryOp.h:383
internal::traits< Derived >::Scalar Scalar
Definition DenseBase.h:66
const Replicate< Derived, RowFactor, ColFactor > replicate() const
Definition Replicate.h:119
Array< 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 > PlainArray
Definition DenseBase.h:196
const Select< Derived, ThenDerived, ElseDerived > select(const DenseBase< ThenDerived > &thenMatrix, const DenseBase< ElseDerived > &elseMatrix) const
Definition Select.h:124
static const ConstantReturnType Constant(Index rows, Index cols, const Scalar &value)
Definition CwiseNullaryOp.h:174
internal::traits< Derived >::Scalar maxCoeff() const
Definition Redux.h:436
Index innerSize() const
Definition DenseBase.h:230
Index nonZeros() const
Definition DenseBase.h:210
const Replicate< Derived, Dynamic, Dynamic > replicate(Index rowFactor, Index colFactor) const
Definition DenseBase.h:554
CoeffReturnType value() const
Definition DenseBase.h:480
@ IsVectorAtCompileTime
Definition DenseBase.h:153
@ SizeAtCompileTime
Definition DenseBase.h:113
@ MaxSizeAtCompileTime
Definition DenseBase.h:141
@ IsRowMajor
Definition DenseBase.h:165
@ Flags
Definition DenseBase.h:160
@ ColsAtCompileTime
Definition DenseBase.h:106
@ MaxColsAtCompileTime
Definition DenseBase.h:130
@ MaxRowsAtCompileTime
Definition DenseBase.h:119
@ RowsAtCompileTime
Definition DenseBase.h:100
Scalar value_type
Definition DenseBase.h:71
void fill(const Scalar &value)
Definition CwiseNullaryOp.h:315
ConstReverseReturnType reverse() const
Definition DenseBase.h:564
ConstRowwiseReturnType rowwise() const
Definition DenseBase.h:504
DenseBase()
Definition DenseBase.h:592
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
bool isOnes(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition CwiseNullaryOp.h:612
EvalReturnType eval() const
Definition DenseBase.h:401
internal::traits< Derived >::Scalar minCoeff() const
Definition Redux.h:426
bool hasNaN() const
Definition BooleanRedux.h:139
Derived & operator=(const DenseBase< OtherDerived > &other)
Definition Assign.h:39
bool any() const
Definition BooleanRedux.h:105
Derived & setConstant(const Scalar &value)
Definition CwiseNullaryOp.h:325
Derived & setRandom()
Definition Random.h:131
void transposeInPlace()
Definition Transpose.h:286
TransposeReturnType transpose()
Definition Transpose.h:174
internal::conditional< internal::is_same< typenameinternal::traits< Derived >::XprKind, MatrixXpr >::value, PlainMatrix, PlainArray >::type PlainObject
The plain matrix or array type corresponding to this expression.
Definition DenseBase.h:205
void reverseInPlace()
Definition Reverse.h:139
Scalar sum() const
Definition Redux.h:449
EIGEN_DEPRECATED const Derived & flagged() const
Definition DenseBase.h:312
bool all() const
Definition BooleanRedux.h:81
static const RandomReturnType Random()
Definition Random.h:113
bool isApprox(const DenseBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition Fuzzy.h:103
static const SequentialLinSpacedReturnType LinSpaced(Sequential_t, Index size, const Scalar &low, const Scalar &high)
Definition CwiseNullaryOp.h:224
Scalar prod() const
Definition Redux.h:483
bool allFinite() const
Definition BooleanRedux.h:153
Derived & setZero()
Definition CwiseNullaryOp.h:499
bool isZero(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition CwiseNullaryOp.h:481
bool isApproxToConstant(const Scalar &value, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition CwiseNullaryOp.h:290
void swap(const DenseBase< OtherDerived > &other)
Definition DenseBase.h:414
Enforce aligned packet loads and stores regardless of what is requested.
Definition ForceAlignedAccess.h:36
An InnerIterator allows to loop over the element of any matrix expression.
Definition CoreIterators.h:34
The matrix class, also used for vectors and row-vectors.
Definition Matrix.h:180
Expression which must be nested by value.
Definition NestByValue.h:36
Dense storage base class for matrices and arrays.
Definition PlainObjectBase.h:100
Expression of the multiple replication of a matrix or vector.
Definition Replicate.h:63
Expression of the reverse of a vector or matrix.
Definition Reverse.h:65
Expression of a coefficient wise version of the C++ ternary operator ?:
Definition Select.h:54
Expression of the transpose of a matrix.
Definition Transpose.h:54
Pseudo expression providing partial reduction operations.
Definition VectorwiseOp.h:157
Pseudo expression providing matrix output with given format.
Definition IO.h:95
@ ColMajor
Definition Constants.h:320
@ RowMajor
Definition Constants.h:322
@ AutoAlign
Definition Constants.h:324
const unsigned int RowMajorBit
Definition Constants.h:61
Namespace containing all symbols from the Eigen library.
Definition A05_PortingFrom2To3.dox:1
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:65
Helper class used by the comma initializer operator.
Definition CommaInitializer.h:29
Definition EigenBase.h:30
Stores a set of parameters controlling the way matrices are printed.
Definition IO.h:51
Definition Constants.h:506