Eigen  3.4.90 (git rev a4098ac676528a83cfb73d4d26ce1b42ec05f47c)
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
16namespace Eigen {
17
18// The index type defined by EIGEN_DEFAULT_DENSE_INDEX_TYPE must be a signed type.
19EIGEN_STATIC_ASSERT(NumTraits<DenseIndex>::IsSigned,THE_INDEX_TYPE_MUST_BE_A_SIGNED_TYPE)
20
21
36template<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
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_at_compile_time<internal::traits<Derived>::RowsAtCompileTime,
109 internal::traits<Derived>::ColsAtCompileTime>::ret),
114 MaxRowsAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime,
125 MaxColsAtCompileTime = internal::traits<Derived>::MaxColsAtCompileTime,
136 MaxSizeAtCompileTime = (internal::size_at_compile_time<internal::traits<Derived>::MaxRowsAtCompileTime,
137 internal::traits<Derived>::MaxColsAtCompileTime>::ret),
148 IsVectorAtCompileTime = internal::traits<Derived>::RowsAtCompileTime == 1
149 || internal::traits<Derived>::ColsAtCompileTime == 1,
155 NumDimensions = int(MaxSizeAtCompileTime) == 1 ? 0 : bool(IsVectorAtCompileTime) ? 1 : 2,
160 Flags = internal::traits<Derived>::Flags,
165 IsRowMajor = int(Flags) & RowMajorBit,
167 InnerSizeAtCompileTime = int(IsVectorAtCompileTime) ? int(SizeAtCompileTime)
168 : int(IsRowMajor) ? int(ColsAtCompileTime) : int(RowsAtCompileTime),
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
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
212 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
214 {
215 return IsVectorAtCompileTime ? 1
216 : int(IsRowMajor) ? this->rows() : this->cols();
217 }
218
224 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
226 {
227 return IsVectorAtCompileTime ? this->size()
228 : int(IsRowMajor) ? this->cols() : this->rows();
229 }
230
235 EIGEN_DEVICE_FUNC
236 void resize(Index newSize)
237 {
238 EIGEN_ONLY_USED_FOR_DEBUG(newSize);
239 eigen_assert(newSize == this->size()
240 && "DenseBase::resize() does not actually allow to resize.");
241 }
246 EIGEN_DEVICE_FUNC
247 void resize(Index rows, Index cols)
248 {
249 EIGEN_ONLY_USED_FOR_DEBUG(rows);
250 EIGEN_ONLY_USED_FOR_DEBUG(cols);
251 eigen_assert(rows == this->rows() && cols == this->cols()
252 && "DenseBase::resize() does not actually allow to resize.");
253 }
254
255#ifndef EIGEN_PARSED_BY_DOXYGEN
257 typedef CwiseNullaryOp<internal::scalar_constant_op<Scalar>,PlainObject> ConstantReturnType;
259 EIGEN_DEPRECATED typedef CwiseNullaryOp<internal::linspaced_op<Scalar>,PlainObject> SequentialLinSpacedReturnType;
261 typedef CwiseNullaryOp<internal::linspaced_op<Scalar>,PlainObject> RandomAccessLinSpacedReturnType;
263 typedef Matrix<typename NumTraits<typename internal::traits<Derived>::Scalar>::Real, internal::traits<Derived>::ColsAtCompileTime, 1> EigenvaluesReturnType;
264
265#endif // not EIGEN_PARSED_BY_DOXYGEN
266
268 template<typename OtherDerived>
269 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
270 Derived& operator=(const DenseBase<OtherDerived>& other);
271
275 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
276 Derived& operator=(const DenseBase& other);
277
278 template<typename OtherDerived>
279 EIGEN_DEVICE_FUNC
280 Derived& operator=(const EigenBase<OtherDerived> &other);
281
282 template<typename OtherDerived>
283 EIGEN_DEVICE_FUNC
284 Derived& operator+=(const EigenBase<OtherDerived> &other);
285
286 template<typename OtherDerived>
287 EIGEN_DEVICE_FUNC
288 Derived& operator-=(const EigenBase<OtherDerived> &other);
289
290 template<typename OtherDerived>
291 EIGEN_DEVICE_FUNC
292 Derived& operator=(const ReturnByValue<OtherDerived>& func);
293
296 template<typename OtherDerived>
298 EIGEN_DEPRECATED EIGEN_DEVICE_FUNC
299 Derived& lazyAssign(const DenseBase<OtherDerived>& other);
300
301 EIGEN_DEVICE_FUNC
302 CommaInitializer<Derived> operator<< (const Scalar& s);
303
304 template<unsigned int Added,unsigned int Removed>
306 EIGEN_DEPRECATED
307 const Derived& flagged() const
308 { return derived(); }
309
310 template<typename OtherDerived>
311 EIGEN_DEVICE_FUNC
312 CommaInitializer<Derived> operator<< (const DenseBase<OtherDerived>& other);
313
314 typedef Transpose<Derived> TransposeReturnType;
315 EIGEN_DEVICE_FUNC
316 TransposeReturnType transpose();
317 typedef typename internal::add_const<Transpose<const Derived> >::type ConstTransposeReturnType;
318 EIGEN_DEVICE_FUNC
319 ConstTransposeReturnType transpose() const;
320 EIGEN_DEVICE_FUNC
321 void transposeInPlace();
322
323 EIGEN_DEVICE_FUNC static const ConstantReturnType
324 Constant(Index rows, Index cols, const Scalar& value);
325 EIGEN_DEVICE_FUNC static const ConstantReturnType
326 Constant(Index size, const Scalar& value);
327 EIGEN_DEVICE_FUNC static const ConstantReturnType
328 Constant(const Scalar& value);
329
330 EIGEN_DEPRECATED EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType
331 LinSpaced(Sequential_t, Index size, const Scalar& low, const Scalar& high);
332 EIGEN_DEPRECATED EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType
333 LinSpaced(Sequential_t, const Scalar& low, const Scalar& high);
334
335 EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType
336 LinSpaced(Index size, const Scalar& low, const Scalar& high);
337 EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType
338 LinSpaced(const Scalar& low, const Scalar& high);
339
340 template<typename CustomNullaryOp> EIGEN_DEVICE_FUNC
342 NullaryExpr(Index rows, Index cols, const CustomNullaryOp& func);
343 template<typename CustomNullaryOp> EIGEN_DEVICE_FUNC
345 NullaryExpr(Index size, const CustomNullaryOp& func);
346 template<typename CustomNullaryOp> EIGEN_DEVICE_FUNC
348 NullaryExpr(const CustomNullaryOp& func);
349
350 EIGEN_DEVICE_FUNC static const ConstantReturnType Zero(Index rows, Index cols);
351 EIGEN_DEVICE_FUNC static const ConstantReturnType Zero(Index size);
352 EIGEN_DEVICE_FUNC static const ConstantReturnType Zero();
353 EIGEN_DEVICE_FUNC static const ConstantReturnType Ones(Index rows, Index cols);
354 EIGEN_DEVICE_FUNC static const ConstantReturnType Ones(Index size);
355 EIGEN_DEVICE_FUNC static const ConstantReturnType Ones();
356
357 EIGEN_DEVICE_FUNC void fill(const Scalar& value);
358 EIGEN_DEVICE_FUNC Derived& setConstant(const Scalar& value);
359 EIGEN_DEVICE_FUNC Derived& setLinSpaced(Index size, const Scalar& low, const Scalar& high);
360 EIGEN_DEVICE_FUNC Derived& setLinSpaced(const Scalar& low, const Scalar& high);
361 EIGEN_DEVICE_FUNC Derived& setZero();
362 EIGEN_DEVICE_FUNC Derived& setOnes();
363 EIGEN_DEVICE_FUNC Derived& setRandom();
364
365 template<typename OtherDerived> EIGEN_DEVICE_FUNC
366 bool isApprox(const DenseBase<OtherDerived>& other,
367 const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
368 EIGEN_DEVICE_FUNC
369 bool isMuchSmallerThan(const RealScalar& other,
370 const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
371 template<typename OtherDerived> EIGEN_DEVICE_FUNC
372 bool isMuchSmallerThan(const DenseBase<OtherDerived>& other,
373 const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
374
375 EIGEN_DEVICE_FUNC bool isApproxToConstant(const Scalar& value, const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
376 EIGEN_DEVICE_FUNC bool isConstant(const Scalar& value, const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
377 EIGEN_DEVICE_FUNC bool isZero(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
378 EIGEN_DEVICE_FUNC bool isOnes(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
379
380 EIGEN_DEVICE_FUNC inline bool hasNaN() const;
381 EIGEN_DEVICE_FUNC inline bool allFinite() const;
382
383 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
384 Derived& operator*=(const Scalar& other);
385 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
386 Derived& operator/=(const Scalar& other);
387
388 typedef typename internal::add_const_on_value_type<typename internal::eval<Derived>::type>::type EvalReturnType;
396 EIGEN_DEVICE_FUNC
397 EIGEN_STRONG_INLINE EvalReturnType eval() const
398 {
399 // Even though MSVC does not honor strong inlining when the return type
400 // is a dynamic matrix, we desperately need strong inlining for fixed
401 // size types on MSVC.
402 return typename internal::eval<Derived>::type(derived());
403 }
404
408 template<typename OtherDerived>
409 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
410 void swap(const DenseBase<OtherDerived>& other)
411 {
412 EIGEN_STATIC_ASSERT(!OtherDerived::IsPlainObjectBase,THIS_EXPRESSION_IS_NOT_A_LVALUE__IT_IS_READ_ONLY);
413 eigen_assert(rows()==other.rows() && cols()==other.cols());
414 call_assignment(derived(), other.const_cast_derived(), internal::swap_assign_op<Scalar>());
415 }
416
420 template<typename OtherDerived>
421 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
423 {
424 eigen_assert(rows()==other.rows() && cols()==other.cols());
425 call_assignment(derived(), other.derived(), internal::swap_assign_op<Scalar>());
426 }
427
428 EIGEN_DEVICE_FUNC inline const NestByValue<Derived> nestByValue() const;
429 EIGEN_DEVICE_FUNC inline const ForceAlignedAccess<Derived> forceAlignedAccess() const;
430 EIGEN_DEVICE_FUNC inline ForceAlignedAccess<Derived> forceAlignedAccess();
431 template<bool Enable> EIGEN_DEVICE_FUNC
432 inline const typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type forceAlignedAccessIf() const;
433 template<bool Enable> EIGEN_DEVICE_FUNC
434 inline typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type forceAlignedAccessIf();
435
436 EIGEN_DEVICE_FUNC Scalar sum() const;
437 EIGEN_DEVICE_FUNC Scalar mean() const;
438 EIGEN_DEVICE_FUNC Scalar trace() const;
439
440 EIGEN_DEVICE_FUNC Scalar prod() const;
441
442 template<int NaNPropagation>
443 EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar minCoeff() const;
444 template<int NaNPropagation>
445 EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar maxCoeff() const;
446
447
448 // By default, the fastest version with undefined NaN propagation semantics is
449 // used.
450 // TODO(rmlarsen): Replace with default template argument when we move to
451 // c++11 or beyond.
452 EIGEN_DEVICE_FUNC inline typename internal::traits<Derived>::Scalar minCoeff() const {
453 return minCoeff<PropagateFast>();
454 }
455 EIGEN_DEVICE_FUNC inline typename internal::traits<Derived>::Scalar maxCoeff() const {
456 return maxCoeff<PropagateFast>();
457 }
458
459 template<int NaNPropagation, typename IndexType>
460 EIGEN_DEVICE_FUNC
461 typename internal::traits<Derived>::Scalar minCoeff(IndexType* row, IndexType* col) const;
462 template<int NaNPropagation, typename IndexType>
463 EIGEN_DEVICE_FUNC
464 typename internal::traits<Derived>::Scalar maxCoeff(IndexType* row, IndexType* col) const;
465 template<int NaNPropagation, typename IndexType>
466 EIGEN_DEVICE_FUNC
467 typename internal::traits<Derived>::Scalar minCoeff(IndexType* index) const;
468 template<int NaNPropagation, typename IndexType>
469 EIGEN_DEVICE_FUNC
470 typename internal::traits<Derived>::Scalar maxCoeff(IndexType* index) const;
471
472 // TODO(rmlarsen): Replace these methods with a default template argument.
473 template<typename IndexType>
474 EIGEN_DEVICE_FUNC inline
475 typename internal::traits<Derived>::Scalar minCoeff(IndexType* row, IndexType* col) const {
476 return minCoeff<PropagateFast>(row, col);
477 }
478 template<typename IndexType>
479 EIGEN_DEVICE_FUNC inline
480 typename internal::traits<Derived>::Scalar maxCoeff(IndexType* row, IndexType* col) const {
481 return maxCoeff<PropagateFast>(row, col);
482 }
483 template<typename IndexType>
484 EIGEN_DEVICE_FUNC inline
485 typename internal::traits<Derived>::Scalar minCoeff(IndexType* index) const {
486 return minCoeff<PropagateFast>(index);
487 }
488 template<typename IndexType>
489 EIGEN_DEVICE_FUNC inline
490 typename internal::traits<Derived>::Scalar maxCoeff(IndexType* index) const {
491 return maxCoeff<PropagateFast>(index);
492 }
493
494 template<typename BinaryOp>
495 EIGEN_DEVICE_FUNC
496 Scalar redux(const BinaryOp& func) const;
497
498 template<typename Visitor>
499 EIGEN_DEVICE_FUNC
500 void visit(Visitor& func) const;
501
509 inline const WithFormat<Derived> format(const IOFormat& fmt) const
510 {
511 return WithFormat<Derived>(derived(), fmt);
512 }
513
515 EIGEN_DEVICE_FUNC
516 CoeffReturnType value() const
517 {
518 EIGEN_STATIC_ASSERT_SIZE_1x1(Derived)
519 eigen_assert(this->rows() == 1 && this->cols() == 1);
520 return derived().coeff(0,0);
521 }
522
523 EIGEN_DEVICE_FUNC bool all() const;
524 EIGEN_DEVICE_FUNC bool any() const;
525 EIGEN_DEVICE_FUNC Index count() const;
526
527 typedef VectorwiseOp<Derived, Horizontal> RowwiseReturnType;
528 typedef const VectorwiseOp<const Derived, Horizontal> ConstRowwiseReturnType;
529 typedef VectorwiseOp<Derived, Vertical> ColwiseReturnType;
530 typedef const VectorwiseOp<const Derived, Vertical> ConstColwiseReturnType;
531
539 //Code moved here due to a CUDA compiler bug
540 EIGEN_DEVICE_FUNC inline ConstRowwiseReturnType rowwise() const {
541 return ConstRowwiseReturnType(derived());
542 }
543 EIGEN_DEVICE_FUNC RowwiseReturnType rowwise();
544
552 EIGEN_DEVICE_FUNC inline ConstColwiseReturnType colwise() const {
553 return ConstColwiseReturnType(derived());
554 }
555 EIGEN_DEVICE_FUNC ColwiseReturnType colwise();
556
557 typedef CwiseNullaryOp<internal::scalar_random_op<Scalar>,PlainObject> RandomReturnType;
558 static const RandomReturnType Random(Index rows, Index cols);
559 static const RandomReturnType Random(Index size);
560 static const RandomReturnType Random();
561
562 template<typename ThenDerived,typename ElseDerived>
563 inline EIGEN_DEVICE_FUNC const Select<Derived,ThenDerived,ElseDerived>
564 select(const DenseBase<ThenDerived>& thenMatrix,
565 const DenseBase<ElseDerived>& elseMatrix) const;
566
567 template<typename ThenDerived>
569 select(const DenseBase<ThenDerived>& thenMatrix, const typename ThenDerived::Scalar& elseScalar) const;
570
571 template<typename ElseDerived>
573 select(const typename ElseDerived::Scalar& thenScalar, const DenseBase<ElseDerived>& elseMatrix) const;
574
575 template<int p> RealScalar lpNorm() const;
576
577 template<int RowFactor, int ColFactor>
578 EIGEN_DEVICE_FUNC
579 const Replicate<Derived,RowFactor,ColFactor> replicate() const;
588 //Code moved here due to a CUDA compiler bug
589 EIGEN_DEVICE_FUNC
591 {
592 return Replicate<Derived, Dynamic, Dynamic>(derived(), rowFactor, colFactor);
593 }
594
595 typedef Reverse<Derived, BothDirections> ReverseReturnType;
596 typedef const Reverse<const Derived, BothDirections> ConstReverseReturnType;
597 EIGEN_DEVICE_FUNC ReverseReturnType reverse();
599 //Code moved here due to a CUDA compiler bug
600 EIGEN_DEVICE_FUNC ConstReverseReturnType reverse() const
601 {
602 return ConstReverseReturnType(derived());
603 }
604 EIGEN_DEVICE_FUNC void reverseInPlace();
605
606 #ifdef EIGEN_PARSED_BY_DOXYGEN
610 typedef random_access_iterator_type iterator;
612 typedef random_access_iterator_type const_iterator;
613 #else
614 typedef typename internal::conditional< (Flags&DirectAccessBit)==DirectAccessBit,
615 internal::pointer_based_stl_iterator<Derived>,
616 internal::generic_randaccess_stl_iterator<Derived>
617 >::type iterator_type;
618
619 typedef typename internal::conditional< (Flags&DirectAccessBit)==DirectAccessBit,
620 internal::pointer_based_stl_iterator<const Derived>,
621 internal::generic_randaccess_stl_iterator<const Derived>
622 >::type const_iterator_type;
623
624 // Stl-style iterators are supported only for vectors.
625
626 typedef typename internal::conditional< IsVectorAtCompileTime,
627 iterator_type,
628 void
629 >::type iterator;
630
631 typedef typename internal::conditional< IsVectorAtCompileTime,
632 const_iterator_type,
633 void
634 >::type const_iterator;
635 #endif
636
637 inline iterator begin();
638 inline const_iterator begin() const;
639 inline const_iterator cbegin() const;
640 inline iterator end();
641 inline const_iterator end() const;
642 inline const_iterator cend() const;
643
644#define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::DenseBase
645#define EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
646#define EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(COND)
647#define EIGEN_DOC_UNARY_ADDONS(X,Y)
648# include "../plugins/CommonCwiseUnaryOps.h"
649# include "../plugins/BlockMethods.h"
650# include "../plugins/IndexedViewMethods.h"
651# include "../plugins/ReshapedMethods.h"
652# ifdef EIGEN_DENSEBASE_PLUGIN
653# include EIGEN_DENSEBASE_PLUGIN
654# endif
655#undef EIGEN_CURRENT_STORAGE_BASE_CLASS
656#undef EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
657#undef EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF
658#undef EIGEN_DOC_UNARY_ADDONS
659
660 // disable the use of evalTo for dense objects with a nice compilation error
661 template<typename Dest>
662 EIGEN_DEVICE_FUNC
663 inline void evalTo(Dest& ) const
664 {
665 EIGEN_STATIC_ASSERT((internal::is_same<Dest,void>::value),THE_EVAL_EVALTO_FUNCTION_SHOULD_NEVER_BE_CALLED_FOR_DENSE_OBJECTS);
666 }
667
668 protected:
669 EIGEN_DEFAULT_COPY_CONSTRUCTOR(DenseBase)
671 EIGEN_DEVICE_FUNC DenseBase()
672 {
673 /* Just checks for self-consistency of the flags.
674 * Only do it when debugging Eigen, as this borders on paranoia and could slow compilation down
675 */
676#ifdef EIGEN_INTERNAL_DEBUGGING
677 EIGEN_STATIC_ASSERT((internal::check_implication(MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1, int(IsRowMajor))
678 && internal::check_implication(MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1, int(!IsRowMajor))),
679 INVALID_STORAGE_ORDER_FOR_THIS_VECTOR_EXPRESSION)
680#endif
681 }
682
683 private:
684 EIGEN_DEVICE_FUNC explicit DenseBase(int);
685 EIGEN_DEVICE_FUNC DenseBase(int,int);
686 template<typename OtherDerived> EIGEN_DEVICE_FUNC explicit DenseBase(const DenseBase<OtherDerived>&);
687};
688
689} // end namespace Eigen
690
691#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:213
const WithFormat< Derived > format(const IOFormat &fmt) const
Definition: DenseBase.h:509
void resize(Index rows, Index cols)
Definition: DenseBase.h:247
internal::traits< Derived >::StorageIndex StorageIndex
The type used to store indices.
Definition: DenseBase.h:58
void resize(Index newSize)
Definition: DenseBase.h:236
random_access_iterator_type const_iterator
Definition: DenseBase.h:612
void swap(PlainObjectBase< OtherDerived > &other)
Definition: DenseBase.h:422
ConstColwiseReturnType colwise() const
Definition: DenseBase.h:552
EIGEN_CONSTEXPR Index innerSize() const
Definition: DenseBase.h:225
internal::traits< Derived >::Scalar Scalar
Definition: DenseBase.h:61
const Replicate< Derived, Dynamic, Dynamic > replicate(Index rowFactor, Index colFactor) const
Definition: DenseBase.h:590
CoeffReturnType value() const
Definition: DenseBase.h:516
Scalar value_type
Definition: DenseBase.h:66
ConstReverseReturnType reverse() const
Definition: DenseBase.h:600
ConstRowwiseReturnType rowwise() const
Definition: DenseBase.h:540
EvalReturnType eval() const
Definition: DenseBase.h:397
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
EIGEN_DEPRECATED const Derived & flagged() const
Definition: DenseBase.h:307
EIGEN_DEPRECATED Derived & lazyAssign(const DenseBase< OtherDerived > &other)
random_access_iterator_type iterator
Definition: DenseBase.h:610
void swap(const DenseBase< OtherDerived > &other)
Definition: DenseBase.h:410
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:189
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: B01_Experimental.dox:1
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:235