Dense matrix and array manipulation » Reference » Core module module

This is the main module of Eigen providing dense matrix and vector support (both fixed and dynamic size) with all the features corresponding to a BLAS library and much more...

#include <Eigen/Core>

Modules

module Global array typedefs
module Global matrix typedefs
module Flags
module Enumerations

Namespaces

namespace Eigen::indexing
namespace Eigen::symbolic

Classes

template<class T>
class Eigen::aligned_allocator
STL compatible allocator to use with types requiring a non standrad alignment.
template<typename FirstType, typename SizeType, typename IncrType>
class Eigen::ArithmeticSequence
template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
class Eigen::Array
General-purpose arrays with easy API for coefficient-wise operations.
template<typename Derived>
class Eigen::ArrayBase
Base class for all 1D and 2D array, and related expressions.
template<typename ExpressionType>
class Eigen::ArrayWrapper
Expression of a mathematical vector or matrix as an array object.
template<typename Derived>
class Eigen::symbolic::BaseExpr
template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel>
class Eigen::Block
Expression of a fixed-size or dynamic-size block.
template<typename XprType>
class Eigen::CommaInitializer
Helper class used by the comma initializer operator.
template<typename BinaryOp, typename LhsType, typename RhsType>
class Eigen::CwiseBinaryOp
Generic expression where a coefficient-wise binary operator is applied to two expressions.
template<typename NullaryOp, typename PlainObjectType>
class Eigen::CwiseNullaryOp
Generic expression of a matrix where all coefficients are defined by a functor.
template<typename TernaryOp, typename Arg1Type, typename Arg2Type, typename Arg3Type>
class Eigen::CwiseTernaryOp
Generic expression where a coefficient-wise ternary operator is applied to two expressions.
template<typename UnaryOp, typename XprType>
class Eigen::CwiseUnaryOp
Generic expression where a coefficient-wise unary operator is applied to an expression.
template<typename ViewOp, typename MatrixType>
class Eigen::CwiseUnaryView
Generic lvalue expression of a coefficient-wise unary operator of a matrix or a vector.
template<typename Derived>
class Eigen::DenseBase
Base class for all dense matrices, vectors, and arrays.
template<typename Derived>
class Eigen::DenseCoeffsBase<Derived, DirectAccessors>
Base class providing direct read-only coefficient access to matrices and arrays.
template<typename Derived>
class Eigen::DenseCoeffsBase<Derived, DirectWriteAccessors>
Base class providing direct read/write coefficient access to matrices and arrays.
template<typename Derived>
class Eigen::DenseCoeffsBase<Derived, ReadOnlyAccessors>
Base class providing read-only coefficient access to matrices and arrays.
template<typename Derived>
class Eigen::DenseCoeffsBase<Derived, WriteAccessors>
Base class providing read/write coefficient access to matrices and arrays.
template<typename MatrixType, int _DiagIndex>
class Eigen::Diagonal
Expression of a diagonal/subdiagonal/superdiagonal in a matrix.
template<typename _Scalar, int SizeAtCompileTime, int MaxSizeAtCompileTime>
class Eigen::DiagonalMatrix
Represents a diagonal matrix with its storage.
template<typename _DiagonalVectorType>
class Eigen::DiagonalWrapper
Expression of a diagonal matrix.
template<typename Derived>
class Eigen::EigenBase
template<typename ExpressionType>
class Eigen::ForceAlignedAccess
Enforce aligned packet loads and stores regardless of what is requested.
template<typename XprType, typename RowIndices, typename ColIndices>
class Eigen::IndexedView
Expression of a non-sequential sub-matrix defined by arbitrary sequences of row and column indices.
class Eigen::IOFormat
Stores a set of parameters controlling the way matrices are printed.
template<typename PlainObjectType, int MapOptions, typename StrideType>
class Eigen::Map
A matrix or vector expression mapping an existing array of data.
template<typename Derived>
class Eigen::MapBase<Derived, ReadOnlyAccessors>
Base class for dense Map and Block expression with direct access.
template<typename Derived>
class Eigen::MapBase<Derived, WriteAccessors>
Base class for non-const dense Map and Block expression with direct access.
template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
class Eigen::Matrix
The matrix class, also used for vectors and row-vectors.
template<typename Derived>
class Eigen::MatrixBase
Base class for all dense matrices, vectors, and expressions.
template<typename ExpressionType>
class Eigen::MatrixWrapper
Expression of an array as a mathematical vector or matrix.
template<typename ExpressionType>
class Eigen::NestByValue
Expression which must be nested by value.
template<typename ExpressionType, template<typename> class StorageBase>
class Eigen::NoAlias
Pseudo expression providing an operator = assuming no aliasing.
template<typename T>
class Eigen::NumTraits
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
template<typename MatrixType, typename MemberOp, int Direction>
class Eigen::PartialReduxExpr
Generic expression of a partially reduxed matrix.
template<typename Derived>
class Eigen::PermutationBase
Base class for permutations.
template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex>
class Eigen::PermutationMatrix
Permutation matrix.
template<typename _IndicesType>
class Eigen::PermutationWrapper
Class to view a vector of integers as a permutation matrix.
template<typename Derived>
class Eigen::PlainObjectBase
Dense storage base class for matrices and arrays.
template<typename _Lhs, typename _Rhs, int Option>
class Eigen::Product
Expression of the product of two arbitrary matrices or vectors.
template<typename PlainObjectType, int Options, typename StrideType>
class Eigen::Ref
A matrix or vector expression mapping an existing expression.
template<typename MatrixType, int RowFactor, int ColFactor>
class Eigen::Replicate
Expression of the multiple replication of a matrix or vector.
template<typename XprType, int Rows, int Cols, int Order>
class Eigen::Reshaped
Expression of a fixed-size or dynamic-size reshape.
template<typename MatrixType, int Direction>
class Eigen::Reverse
Expression of the reverse of a vector or matrix.
template<typename ScalarA, typename ScalarB, typename BinaryOp = internal::scalar_product_op<ScalarA,ScalarB>>
class Eigen::ScalarBinaryOpTraits
Determines whether the given binary operation of two numeric types is allowed and what the scalar return type is.
template<typename ConditionMatrixType, typename ThenMatrixType, typename ElseMatrixType>
class Eigen::Select
Expression of a coefficient wise version of the C++ ternary operator ?:
template<typename _MatrixType, unsigned int UpLo>
class Eigen::SelfAdjointView
Expression of a selfadjoint matrix from a triangular part of a dense matrix.
template<typename Decomposition, typename RhsType>
class Eigen::Solve
Pseudo expression representing a solving operation.
template<int _OuterStrideAtCompileTime, int _InnerStrideAtCompileTime>
class Eigen::Stride
Holds strides information for Map.
template<typename MatrixType>
class Eigen::Transpose
Expression of the transpose of a matrix.
template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex>
class Eigen::Transpositions
Represents a sequence of transpositions (row/column interchange)
template<typename Derived>
class Eigen::TriangularBase
Base class for triangular part in a matrix.
template<typename _MatrixType, unsigned int _Mode>
class Eigen::TriangularView
Expression of a triangular part in a matrix.
template<typename _MatrixType, unsigned int _Mode>
class Eigen::TriangularViewImpl<_MatrixType, _Mode, Dense>
Base class for a triangular part in a dense matrix.
template<typename VectorType, int Size>
class Eigen::VectorBlock
Expression of a fixed-size or dynamic-size sub-vector.
template<typename ExpressionType, int Direction>
class Eigen::VectorwiseOp
Pseudo expression providing broadcasting and partial reduction operations.
template<typename ExpressionType>
class Eigen::WithFormat
Pseudo expression providing matrix output with given format.

Functions

template<int N>
static auto fix() -> const auto
template<int N>
static auto fix(int val) -> const auto

Variables

static const Eigen::internal::all_t all
static const symbolic::SymbolExpr<internal::symbolic_last_tag> last
static const auto lastp1

Function documentation

template<int N>
static const auto fix()

Template parameters
N the compile-time integer value

This identifier permits to construct an object embedding a compile-time integer N.

It is typically used in conjunction with the Eigen::seq and Eigen::seqN functions to pass compile-time values to them: seqN(10,fix<4>,fix<-3>) // <=> [10 7 4 1]

See also the function fix(int) to pass both a compile-time and runtime value.

In c++14, it is implemented as: template<int N> static const internal::FixedInt<N> fix{}; where internal::FixedInt<N> is an internal template class similar to std::integral_constant<int,N> Here, fix<N> is thus an object of type internal::FixedInt<N>.

In c++98/11, it is implemented as a function: template<int N> inline internal::FixedInt<N> fix(); Here internal::FixedInt<N> is thus a pointer to function.

If for some reason you want a true object in c++98 then you can write: fix<N>() which is also valid in c++14.

template<int N>
static const auto fix(int val)

Template parameters
N the compile-time integer value
Parameters
val the fallback runtime integer value

This function returns an object embedding both a compile-time integer N, and a fallback runtime value val.

This function is a more general version of the fix identifier/function that can be used in template code where the compile-time value could turn out to actually mean "undefined at compile-time". For positive integers such as a size or a dimension, this case is identified by Eigen::Dynamic, whereas runtime signed integers (e.g., an increment/stride) are identified as Eigen::DynamicIndex. In such a case, the runtime value val will be used as a fallback.

A typical use case would be:

template<typename Derived> void foo(const MatrixBase<Derived> &mat) {
  const int N = Derived::RowsAtCompileTime==Dynamic ? Dynamic : Derived::RowsAtCompileTime/2;
  const int n = mat.rows()/2;
  ... mat( seqN(0,fix<N>(n) ) ...;
}

In this example, the function Eigen::seqN knows that the second argument is expected to be a size. If the passed compile-time value N equals Eigen::Dynamic, then the proxy object returned by fix will be dissmissed, and converted to an Eigen::Index of value n. Otherwise, the runtime-value n will be dissmissed, and the returned ArithmeticSequence will be of the exact same type as seqN(0,fix<N>).

Variable documentation

static const Eigen::internal::all_t all

Can be used as a parameter to DenseBase::operator()(const RowIndices&, const ColIndices&) to index all rows or columns

static const symbolic::SymbolExpr<internal::symbolic_last_tag> last

Can be used as a parameter to Eigen::seq and Eigen::seqN functions to symbolically reference the last element/row/columns of the underlying vector or matrix once passed to DenseBase::operator()(const RowIndices&, const ColIndices&).

This symbolic placeholder supports standard arithmetic operations.

A typical usage example would be:

using namespace Eigen;
using Eigen::last;
VectorXd v(n);
v(seq(2,last-2)).setOnes();

static const auto lastp1

Can be used as a parameter to Eigen::seq and Eigen::seqN functions to symbolically reference the last+1 element/row/columns of the underlying vector or matrix once passed to DenseBase::operator()(const RowIndices&, const ColIndices&).

This symbolic placeholder supports standard arithmetic operations. It is essentially an alias to last+fix<1>.