11 #ifndef EIGEN_DENSEBASE_H 12 #define EIGEN_DENSEBASE_H 20 static inline void check_DenseIndex_is_signed() {
21 EIGEN_STATIC_ASSERT(NumTraits<DenseIndex>::IsSigned,THE_INDEX_TYPE_MUST_BE_A_SIGNED_TYPE);
42 #ifndef EIGEN_PARSED_BY_DOXYGEN
44 typename NumTraits<typename internal::traits<Derived>::Scalar>::Real,
45 DenseCoeffsBase<Derived> >
48 #endif // not EIGEN_PARSED_BY_DOXYGEN 63 typedef typename internal::packet_traits<Scalar>::type
PacketScalar;
67 using Base::operator*;
69 using Base::const_cast_derived;
73 using Base::rowIndexByOuterInner;
74 using Base::colIndexByOuterInner;
76 using Base::coeffByOuterInner;
78 using Base::packetByOuterInner;
79 using Base::writePacket;
80 using Base::writePacketByOuterInner;
82 using Base::coeffRefByOuterInner;
83 using Base::copyCoeff;
84 using Base::copyCoeffByOuterInner;
85 using Base::copyPacket;
86 using Base::copyPacketByOuterInner;
87 using Base::operator();
88 using Base::operator[];
94 using Base::innerStride;
95 using Base::outerStride;
96 using Base::rowStride;
97 using Base::colStride;
98 typedef typename Base::CoeffReturnType CoeffReturnType;
169 InnerSizeAtCompileTime = int(IsVectorAtCompileTime) ? int(SizeAtCompileTime)
170 : int(IsRowMajor) ? int(ColsAtCompileTime) : int(RowsAtCompileTime),
172 CoeffReadCost =
internal::traits<Derived>::CoeffReadCost,
177 InnerStrideAtCompileTime =
internal::inner_stride_at_compile_time<Derived>::ret,
178 OuterStrideAtCompileTime =
internal::outer_stride_at_compile_time<Derived>::ret
181 enum { ThisConstantIsPrivateInPlainObjectBase };
185 inline Index nonZeros()
const {
return size(); }
194 return IsVectorAtCompileTime ? 1
195 : int(IsRowMajor) ? this->rows() : this->cols();
205 return IsVectorAtCompileTime ? this->
size()
206 : int(IsRowMajor) ? this->cols() : this->rows();
215 EIGEN_ONLY_USED_FOR_DEBUG(newSize);
216 eigen_assert(newSize == this->
size()
217 &&
"DenseBase::resize() does not actually allow to resize.");
225 EIGEN_ONLY_USED_FOR_DEBUG(nbRows);
226 EIGEN_ONLY_USED_FOR_DEBUG(nbCols);
227 eigen_assert(nbRows == this->rows() && nbCols == this->cols()
228 &&
"DenseBase::resize() does not actually allow to resize.");
231 #ifndef EIGEN_PARSED_BY_DOXYGEN 242 #endif // not EIGEN_PARSED_BY_DOXYGEN 245 template<
typename OtherDerived>
251 Derived& operator=(
const DenseBase& other);
253 template<
typename OtherDerived>
256 template<
typename OtherDerived>
259 template<
typename OtherDerived>
262 template<
typename OtherDerived>
266 template<
typename OtherDerived>
270 template<
typename OtherDerived>
275 template<
unsigned int Added,
unsigned int Removed>
278 template<
typename OtherDerived>
283 ConstTransposeReturnType transpose()
const;
284 void transposeInPlace();
285 #ifndef EIGEN_NO_DEBUG 287 template<
typename OtherDerived>
288 void checkTransposeAliasing(
const OtherDerived& other)
const;
293 static const ConstantReturnType
294 Constant(Index rows, Index cols,
const Scalar& value);
295 static const ConstantReturnType
296 Constant(Index
size,
const Scalar& value);
297 static const ConstantReturnType
298 Constant(
const Scalar& value);
300 static const SequentialLinSpacedReturnType
301 LinSpaced(Sequential_t, Index
size,
const Scalar& low,
const Scalar& high);
302 static const RandomAccessLinSpacedReturnType
303 LinSpaced(Index
size,
const Scalar& low,
const Scalar& high);
304 static const SequentialLinSpacedReturnType
305 LinSpaced(Sequential_t,
const Scalar& low,
const Scalar& high);
306 static const RandomAccessLinSpacedReturnType
307 LinSpaced(
const Scalar& low,
const Scalar& high);
309 template<
typename CustomNullaryOp>
311 NullaryExpr(Index rows, Index cols,
const CustomNullaryOp&
func);
312 template<
typename CustomNullaryOp>
314 NullaryExpr(Index
size,
const CustomNullaryOp&
func);
315 template<
typename CustomNullaryOp>
317 NullaryExpr(
const CustomNullaryOp&
func);
319 static const ConstantReturnType Zero(Index rows, Index cols);
320 static const ConstantReturnType Zero(Index
size);
321 static const ConstantReturnType Zero();
322 static const ConstantReturnType Ones(Index rows, Index cols);
323 static const ConstantReturnType Ones(Index
size);
324 static const ConstantReturnType Ones();
326 void fill(
const Scalar& value);
327 Derived& setConstant(
const Scalar& value);
328 Derived& setLinSpaced(Index
size,
const Scalar& low,
const Scalar& high);
329 Derived& setLinSpaced(
const Scalar& low,
const Scalar& high);
332 Derived& setRandom();
334 template<
typename OtherDerived>
337 bool isMuchSmallerThan(
const RealScalar& other,
339 template<
typename OtherDerived>
348 inline bool hasNaN()
const;
349 inline bool allFinite()
const;
351 inline Derived& operator*=(
const Scalar& other);
352 inline Derived& operator/=(
const Scalar& other);
360 EIGEN_STRONG_INLINE EvalReturnType
eval()
const 371 template<
typename OtherDerived>
373 int = OtherDerived::ThisConstantIsPrivateInPlainObjectBase)
381 template<
typename OtherDerived>
392 template<
bool Enable>
inline typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type forceAlignedAccessIf();
396 Scalar trace()
const;
403 template<
typename IndexType>
405 template<
typename IndexType>
407 template<
typename IndexType>
409 template<
typename IndexType>
412 template<
typename BinaryOp>
414 redux(
const BinaryOp&
func)
const;
416 template<
typename Visitor>
417 void visit(Visitor& func)
const;
424 EIGEN_STATIC_ASSERT_SIZE_1x1(Derived)
425 eigen_assert(this->rows() == 1 && this->cols() == 1);
426 return derived().coeff(0,0);
429 bool all(
void)
const;
430 bool any(
void)
const;
438 ConstRowwiseReturnType rowwise()
const;
439 RowwiseReturnType rowwise();
440 ConstColwiseReturnType colwise()
const;
441 ColwiseReturnType colwise();
447 template<
typename ThenDerived,
typename ElseDerived>
452 template<
typename ThenDerived>
456 template<
typename ElseDerived>
460 template<
int p> RealScalar lpNorm()
const;
462 template<
int RowFactor,
int ColFactor>
466 inline const ReplicateReturnType replicate(Index rowFacor,Index colFactor)
const;
470 ReverseReturnType reverse();
471 ConstReverseReturnType reverse()
const;
472 void reverseInPlace();
474 #define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::DenseBase 475 # include "../plugins/BlockMethods.h" 476 # ifdef EIGEN_DENSEBASE_PLUGIN 477 # include EIGEN_DENSEBASE_PLUGIN 479 #undef EIGEN_CURRENT_STORAGE_BASE_CLASS 481 #ifdef EIGEN2_SUPPORT 485 template<
int CRows,
int CCols>
487 template<
int CRows,
int CCols>
490 #endif // EIGEN2_SUPPORT 494 template<
typename Dest>
inline void evalTo(Dest& )
const 506 #ifdef EIGEN_INTERNAL_DEBUGGING 507 EIGEN_STATIC_ASSERT((EIGEN_IMPLIES(MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1,
int(IsRowMajor))
508 && EIGEN_IMPLIES(MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1,
int(!IsRowMajor))),
509 INVALID_STORAGE_ORDER_FOR_THIS_VECTOR_EXPRESSION)
521 #endif // EIGEN_DENSEBASE_H Generic expression of a matrix where all coefficients are defined by a functor.
Definition: CwiseNullaryOp.h:49
Index innerSize() const
Definition: DenseBase.h:203
Enforce aligned packet loads and stores regardless of what is requested.
Definition: ForceAlignedAccess.h:34
CornerType
Enum used by DenseBase::corner() in Eigen2 compatibility mode.
Definition: Constants.h:201
Expression with modified flags.
Definition: Flagged.h:39
internal::traits< Derived >::Index Index
The type of indices.
Definition: DenseBase.h:60
Expression of the transpose of a matrix.
Definition: Transpose.h:57
iterative scaling algorithm to equilibrate rows and column norms in matrices
Definition: TestIMU_Common.h:87
Holds information about the various numeric (i.e.
Definition: NumTraits.h:88
Definition: ForwardDeclarations.h:50
Pseudo expression providing partial reduction operations.
Definition: ForwardDeclarations.h:212
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition: Constants.h:53
Base class for all dense matrices, vectors, and arrays.
Definition: DenseBase.h:41
void resize(Index newSize)
Only plain matrices/arrays, not expressions, may be resized; therefore the only useful resize methods...
Definition: DenseBase.h:213
Helper class used by the comma initializer operator.
Definition: CommaInitializer.h:28
Common base class for all classes T such that MatrixBase has an operator=(T) and a constructor Matrix...
Definition: EigenBase.h:26
Definition: ReturnByValue.h:50
EIGEN_STRONG_INLINE EvalReturnType eval() const
Definition: DenseBase.h:360
detail::size< coerce_list< Ts... >> size
Get the size of a list (number of elements.)
Definition: Size.h:56
Definition: XprHelper.h:371
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:62
void resize(Index nbRows, Index nbCols)
Only plain matrices/arrays, not expressions, may be resized; therefore the only useful resize methods...
Definition: DenseBase.h:223
Expression which must be nested by value.
Definition: NestByValue.h:35
DenseBase()
Default constructor.
Definition: DenseBase.h:501
Definition: benchGeometry.cpp:23
Definition: BandTriangularSolver.h:13
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:103
void swap(const DenseBase< OtherDerived > &other, int=OtherDerived::ThisConstantIsPrivateInPlainObjectBase)
swaps *this with the expression other.
Definition: DenseBase.h:372
CoeffReturnType value() const
Definition: DenseBase.h:422
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:127
Expression of the reverse of a vector or matrix.
Definition: Reverse.h:70
Definition: ForwardDeclarations.h:17
Definition: XprHelper.h:203
Index outerSize() const
Definition: DenseBase.h:192
Definition: XprHelper.h:161
Definition: CoreIterators.h:26
double Scalar
Common scalar type.
Definition: FlexibleKalmanBase.h:48
void swap(PlainObjectBase< OtherDerived > &other)
swaps *this with the matrix or array other.
Definition: DenseBase.h:382
Expression of a coefficient wise version of the C++ ternary operator ?:
Definition: Select.h:55