Logo Search packages:      
Sourcecode: blender version File versions  Download package

MatrixBase< Derived > Class Template Reference

#include <MatrixBase.h>

Inheritance diagram for MatrixBase< Derived >:

MapBase< Derived >

List of all members.


Detailed Description

template<typename Derived>
class MatrixBase< Derived >

Base class for all matrices, vectors, and expressions.

This class is the base that is inherited by all matrix, vector, and expression types. Most of the Eigen API is contained in this class. Other important classes for the Eigen API are Matrix, Cwise, and PartialRedux.

Note that some methods are defined in the Array module.

Parameters:
Derived is the derived type, e.g. a matrix type, or an expression, etc.
When writing a function taking Eigen objects as argument, if you want your function to take as argument any matrix, vector, or expression, just let it take a MatrixBase argument. As an example, here is a function printFirstRow which, given a matrix, vector, or expression x, prints the first row of x.

    template<typename Derived>
    void printFirstRow(const Eigen::MatrixBase<Derived>& x)
    {
      cout << x.row(0) << endl;
    }

Definition at line 55 of file MatrixBase.h.


Public Types

enum  {
  RowsAtCompileTime = ei_traits<Derived>::RowsAtCompileTime, ColsAtCompileTime = ei_traits<Derived>::ColsAtCompileTime, SizeAtCompileTime, MaxRowsAtCompileTime = ei_traits<Derived>::MaxRowsAtCompileTime,
  MaxColsAtCompileTime = ei_traits<Derived>::MaxColsAtCompileTime, MaxSizeAtCompileTime, IsVectorAtCompileTime, Flags = ei_traits<Derived>::Flags,
  CoeffReadCost = ei_traits<Derived>::CoeffReadCost
}
typedef Eigen::Transpose
< NestByValue< typename
ei_cleantype
< ConjugateReturnType >::type > > 
AdjointReturnType
typedef Block< CwiseNullaryOp
< ei_scalar_identity_op
< Scalar >, SquareMatrixType >
, ei_traits< Derived >
::RowsAtCompileTime, ei_traits
< Derived >::ColsAtCompileTime > 
BasisReturnType
typedef Block< Derived,
ei_traits< Derived >
::RowsAtCompileTime, 1 > 
ColXpr
typedef ei_meta_if< NumTraits
< Scalar >::IsComplex, const
CwiseUnaryOp
< ei_scalar_conjugate_op
< Scalar >, Derived >, const
Derived & >::ret 
ConjugateReturnType
typedef CwiseNullaryOp
< ei_scalar_constant_op
< Scalar >, Derived > 
ConstantReturnType
typedef Matrix< typename
NumTraits< typename ei_traits
< Derived >::Scalar >::Real,
ei_traits< Derived >
::ColsAtCompileTime, 1 > 
EigenvaluesReturnType
typedef CwiseNullaryOp
< ei_scalar_identity_op
< Scalar >, Derived > 
IdentityReturnType
typedef CwiseUnaryOp
< ei_scalar_imag_op< Scalar >
, Derived > 
ImagReturnType
typedef ei_packet_traits
< Scalar >::type 
PacketScalar
typedef ei_plain_matrix_type
< Derived >::type 
PlainMatrixType
typedef ei_plain_matrix_type
< Derived >::type 
PlainMatrixType_ColMajor
typedef CwiseUnaryOp
< ei_scalar_real_op< Scalar >
, Derived > 
RealReturnType
typedef NumTraits< Scalar >::Real RealScalar
typedef Block< Derived,
1, ei_traits< Derived >
::ColsAtCompileTime > 
RowXpr
typedef ei_traits< Derived >
::Scalar 
Scalar
typedef CwiseUnaryOp
< ei_scalar_multiple_op
< Scalar >, Derived > 
ScalarMultipleReturnType
typedef CwiseUnaryOp
< ei_scalar_quotient1_op
< Scalar >, Derived > 
ScalarQuotient1ReturnType
typedef Matrix< Scalar,
EIGEN_ENUM_MAX(RowsAtCompileTime,
ColsAtCompileTime),
EIGEN_ENUM_MAX(RowsAtCompileTime,
ColsAtCompileTime)> 
SquareMatrixType

Public Member Functions

const AdjointReturnType adjoint () const
bool all (void) const
bool any (void) const
const DiagonalMatrix< Derived > asDiagonal () const
template<typename CustomBinaryOp, typename OtherDerived>
const CwiseBinaryOp
< CustomBinaryOp, Derived,
OtherDerived > 
binaryExpr (const MatrixBase< OtherDerived > &other, const CustomBinaryOp &func=CustomBinaryOp()) const
template<int BlockRows, int BlockCols>
const BlockReturnType< Derived,
BlockRows, BlockCols >::Type 
block (int startRow, int startCol) const
template<int BlockRows, int BlockCols>
BlockReturnType< Derived,
BlockRows, BlockCols >::Type 
block (int startRow, int startCol)
const BlockReturnType< Derived >
::Type 
block (int startRow, int startCol, int blockRows, int blockCols) const
BlockReturnType< Derived >::Type block (int startRow, int startCol, int blockRows, int blockCols)
template<typename NewType>
const CwiseUnaryOp
< ei_scalar_cast_op< typename
ei_traits< Derived >::Scalar,
NewType >, Derived > 
cast () const
const Scalar coeff (int index) const
const Scalar coeff (int row, int col) const
Scalar & coeffRef (int index)
Scalar & coeffRef (int row, int col)
const ColXpr col (int i) const
ColXpr col (int i)
int cols () const
const PartialRedux< Derived,
Vertical > 
colwise () const
void computeInverse (PlainMatrixType *result) const
ConjugateReturnType conjugate () const
Derived & const_cast_derived () const
template<typename OtherDerived>
void copyCoeff (int index, const MatrixBase< OtherDerived > &other)
template<typename OtherDerived>
void copyCoeff (int row, int col, const MatrixBase< OtherDerived > &other)
template<typename OtherDerived, int StoreMode, int LoadMode>
void copyPacket (int index, const MatrixBase< OtherDerived > &other)
template<typename OtherDerived, int StoreMode, int LoadMode>
void copyPacket (int row, int col, const MatrixBase< OtherDerived > &other)
template<int CRows, int CCols>
const BlockReturnType< Derived,
CRows, CCols >::Type 
corner (CornerType type) const
template<int CRows, int CCols>
BlockReturnType< Derived,
CRows, CCols >::Type 
corner (CornerType type)
const BlockReturnType< Derived >
::Type 
corner (CornerType type, int cRows, int cCols) const
BlockReturnType< Derived >::Type corner (CornerType type, int cRows, int cCols)
int count () const
template<typename OtherDerived>
PlainMatrixType cross (const MatrixBase< OtherDerived > &other) const
Cwise< Derived > cwise ()
const Cwise< Derived > cwise () const
Derived & derived ()
const Derived & derived () const
Scalar determinant () const
const DiagonalCoeffs< Derived > diagonal () const
DiagonalCoeffs< Derived > diagonal ()
template<typename OtherDerived>
Scalar dot (const MatrixBase< OtherDerived > &other) const
EigenvaluesReturnType eigenvalues () const
template<int Size>
const BlockReturnType< Derived,
Size >::SubVectorType 
end () const
template<int Size>
BlockReturnType< Derived, Size >
::SubVectorType 
end ()
const BlockReturnType< Derived,
Dynamic >::SubVectorType 
end (int size) const
BlockReturnType< Derived,
Dynamic >::SubVectorType 
end (int size)
Matrix< Scalar, 3, 1 > eulerAngles (int a0, int a1, int a2) const
EIGEN_STRONG_INLINE const
ei_eval< Derived >::type 
eval () const
void fill (const Scalar &value)
const WithFormat< Derived > format (const IOFormat &fmt) const
const ImagReturnType imag () const
int innerSize () const
const PlainMatrixType inverse () const
template<typename OtherDerived>
bool isApprox (const MatrixBase< OtherDerived > &other, typename NumTraits< Scalar >::Real prec) const
template<typename OtherDerived>
bool isApprox (const MatrixBase< OtherDerived > &other, RealScalar prec=precision< Scalar >()) const
bool isApproxToConstant (const Scalar &value, RealScalar prec=precision< Scalar >()) const
bool isConstant (const Scalar &value, RealScalar prec=precision< Scalar >()) const
bool isDiagonal (RealScalar prec=precision< Scalar >()) const
bool isIdentity (RealScalar prec=precision< Scalar >()) const
bool isLowerTriangular (RealScalar prec=precision< Scalar >()) const
template<typename OtherDerived>
bool isMuchSmallerThan (const MatrixBase< OtherDerived > &other, typename NumTraits< Scalar >::Real prec) const
template<typename Derived>
bool isMuchSmallerThan (const typename NumTraits< Scalar >::Real &other, typename NumTraits< Scalar >::Real prec) const
template<typename OtherDerived>
bool isMuchSmallerThan (const MatrixBase< OtherDerived > &other, RealScalar prec=precision< Scalar >()) const
bool isMuchSmallerThan (const RealScalar &other, RealScalar prec=precision< Scalar >()) const
bool isOnes (RealScalar prec=precision< Scalar >()) const
template<typename OtherDerived>
bool isOrthogonal (const MatrixBase< OtherDerived > &other, RealScalar prec=precision< Scalar >()) const
bool isUnitary (RealScalar prec=precision< Scalar >()) const
bool isUpperTriangular (RealScalar prec=precision< Scalar >()) const
bool isVector () const
bool isZero (RealScalar prec=precision< Scalar >()) const
const Flagged< Derived,
0, EvalBeforeNestingBit|EvalBeforeAssigningBit
lazy () const
template<typename Derived1, typename Derived2>
Derived & lazyAssign (const SparseProduct< Derived1, Derived2, DenseTimeSparseProduct > &product)
template<typename Derived1, typename Derived2>
Derived & lazyAssign (const SparseProduct< Derived1, Derived2, SparseTimeDenseProduct > &product)
template<typename OtherDerived>
Derived & lazyAssign (const Flagged< OtherDerived, 0, EvalBeforeNestingBit|EvalBeforeAssigningBit > &other)
template<typename Lhs, typename Rhs>
Derived & lazyAssign (const Product< Lhs, Rhs, CacheFriendlyProduct > &product)
template<typename OtherDerived>
Derived & lazyAssign (const MatrixBase< OtherDerived > &other)
const LDLT< PlainMatrixTypeldlt () const
const LLT< PlainMatrixTypellt () const
template<int p>
RealScalar lpNorm () const
const LU< PlainMatrixTypelu () const
template<unsigned int Added>
const Flagged< Derived, Added, 0 > marked () const
 MatrixBase ()
ei_traits< Derived >::Scalar maxCoeff (int *index) const
ei_traits< Derived >::Scalar maxCoeff (int *row, int *col) const
ei_traits< Derived >::Scalar maxCoeff () const
ei_traits< Derived >::Scalar minCoeff (int *index) const
ei_traits< Derived >::Scalar minCoeff (int *row, int *col) const
ei_traits< Derived >::Scalar minCoeff () const
const Minor< Derived > minor (int row, int col) const
Minor< Derived > minor (int row, int col)
const NestByValue< Derived > nestByValue () const
int nonZeros () const
RealScalar norm () const
void normalize ()
const PlainMatrixType normalized () const
template<typename OtherDerived>
bool operator!= (const MatrixBase< OtherDerived > &other) const
Scalar & operator() (int index)
const Scalar operator() (int index) const
Scalar & operator() (int row, int col)
const Scalar operator() (int row, int col) const
template<typename OtherDerived>
const ProductReturnType
< Derived, OtherDerived >
::Type 
operator* (const MatrixBase< OtherDerived > &other) const
const ScalarMultipleReturnType operator* (const Scalar &scalar) const
template<typename OtherDerived>
Derived & operator*= (const MatrixBase< OtherDerived > &other)
Derived & operator*= (const Scalar &other)
template<typename OtherDerived>
const CwiseBinaryOp
< ei_scalar_sum_op< typename
ei_traits< Derived >::Scalar >
, Derived, OtherDerived > 
operator+ (const MatrixBase< OtherDerived > &other) const
template<typename Lhs, typename Rhs>
Derived & operator+= (const Flagged< Product< Lhs, Rhs, CacheFriendlyProduct >, 0, EvalBeforeNestingBit|EvalBeforeAssigningBit > &other)
template<typename OtherDerived>
Derived & operator+= (const MatrixBase< OtherDerived > &other)
template<typename OtherDerived>
const CwiseBinaryOp
< ei_scalar_difference_op
< typename ei_traits< Derived >
::Scalar >, Derived,
OtherDerived > 
operator- (const MatrixBase< OtherDerived > &other) const
const CwiseUnaryOp
< ei_scalar_opposite_op
< typename ei_traits< Derived >
::Scalar >, Derived > 
operator- () const
template<typename OtherDerived>
Derived & operator-= (const MatrixBase< OtherDerived > &other)
const CwiseUnaryOp
< ei_scalar_quotient1_op
< typename ei_traits< Derived >
::Scalar >, Derived > 
operator/ (const Scalar &scalar) const
Derived & operator/= (const Scalar &other)
template<typename OtherDerived>
CommaInitializer< Derived > operator<< (const MatrixBase< OtherDerived > &other)
CommaInitializer< Derived > operator<< (const Scalar &s)
Derived & operator= (const MatrixBase &other)
template<typename OtherDerived>
Derived & operator= (const MatrixBase< OtherDerived > &other)
template<typename OtherDerived>
bool operator== (const MatrixBase< OtherDerived > &other) const
Scalar & operator[] (int index)
const Scalar operator[] (int index) const
RealScalar operatorNorm () const
int outerSize () const
template<int LoadMode>
PacketScalar packet (int index) const
template<int LoadMode>
PacketScalar packet (int row, int col) const
template<unsigned int Mode>
const Part< Derived, Mode > part () const
template<unsigned int Mode>
Part< Derived, Mode > part ()
const QR< PlainMatrixTypeqr () const
const RealReturnType real () const
const RowXpr row (int i) const
RowXpr row (int i)
int rows () const
const PartialRedux< Derived,
Horizontal > 
rowwise () const
template<int Size>
const BlockReturnType< Derived,
Size >::SubVectorType 
segment (int start) const
template<int Size>
BlockReturnType< Derived, Size >
::SubVectorType 
segment (int start)
const BlockReturnType< Derived >
::SubVectorType 
segment (int start, int size) const
BlockReturnType< Derived >
::SubVectorType 
segment (int start, int size)
template<typename ElseDerived>
const Select< Derived,
NestByValue< typename
ElseDerived::ConstantReturnType >
, ElseDerived > 
select (typename ElseDerived::Scalar thenScalar, const MatrixBase< ElseDerived > &elseMatrix) const
template<typename ThenDerived>
const Select< Derived,
ThenDerived, NestByValue
< typename
ThenDerived::ConstantReturnType > > 
select (const MatrixBase< ThenDerived > &thenMatrix, typename ThenDerived::Scalar elseScalar) const
template<typename ThenDerived, typename ElseDerived>
const Select< Derived,
ThenDerived, ElseDerived > 
select (const MatrixBase< ThenDerived > &thenMatrix, const MatrixBase< ElseDerived > &elseMatrix) const
Derived & setConstant (const Scalar &value)
Derived & setIdentity ()
Derived & setOnes ()
Derived & setRandom ()
Derived & setZero ()
int size () const
template<typename OtherDerived>
ei_plain_matrix_type_column_major
< OtherDerived >::type 
solveTriangular (const MatrixBase< OtherDerived > &other) const
template<typename OtherDerived>
void solveTriangularInPlace (const MatrixBase< OtherDerived > &other) const
RealScalar squaredNorm () const
template<int Size>
const BlockReturnType< Derived,
Size >::SubVectorType 
start () const
template<int Size>
BlockReturnType< Derived, Size >
::SubVectorType 
start (void)
const BlockReturnType< Derived,
Dynamic >::SubVectorType 
start (int size) const
BlockReturnType< Derived,
Dynamic >::SubVectorType 
start (int size)
int stride (void) const
Scalar sum () const
SVD< PlainMatrixTypesvd () const
template<typename OtherDerived>
void swap (const MatrixBase< OtherDerived > &other)
Scalar trace () const
const Eigen::Transpose< Derived > transpose () const
Eigen::Transpose< Derived > transpose ()
void transposeInPlace ()
template<typename CustomUnaryOp>
const CwiseUnaryOp
< CustomUnaryOp, Derived > 
unaryExpr (const CustomUnaryOp &func=CustomUnaryOp()) const
PlainMatrixType unitOrthogonal (void) const
template<typename Visitor>
void visit (Visitor &func) const
Scalar & w ()
const Scalar w () const
template<int StoreMode>
EIGEN_STRONG_INLINE void writePacket (int index, const typename ei_packet_traits< typename ei_traits< Derived >::Scalar >::type &x)
template<int StoreMode>
EIGEN_STRONG_INLINE void writePacket (int row, int col, const typename ei_packet_traits< typename ei_traits< Derived >::Scalar >::type &x)
template<int StoreMode>
void writePacket (int index, const PacketScalar &x)
template<int StoreMode>
void writePacket (int row, int col, const PacketScalar &x)
Scalar & x ()
const Scalar x () const
Scalar & y ()
const Scalar y () const
Scalar & z ()
const Scalar z () const

Static Public Member Functions

static const ConstantReturnType Constant (const Scalar &value)
static const ConstantReturnType Constant (int size, const Scalar &value)
static const ConstantReturnType Constant (int rows, int cols, const Scalar &value)
static const IdentityReturnType Identity (int rows, int cols)
static const IdentityReturnType Identity ()
template<typename CustomNullaryOp>
static const CwiseNullaryOp
< CustomNullaryOp, Derived > 
NullaryExpr (const CustomNullaryOp &func)
template<typename CustomNullaryOp>
static const CwiseNullaryOp
< CustomNullaryOp, Derived > 
NullaryExpr (int size, const CustomNullaryOp &func)
template<typename CustomNullaryOp>
static const CwiseNullaryOp
< CustomNullaryOp, Derived > 
NullaryExpr (int rows, int cols, const CustomNullaryOp &func)
static const ConstantReturnType Ones ()
static const ConstantReturnType Ones (int size)
static const ConstantReturnType Ones (int rows, int cols)
static const CwiseNullaryOp
< ei_scalar_random_op< Scalar >
, Derived > 
Random ()
static const CwiseNullaryOp
< ei_scalar_random_op< Scalar >
, Derived > 
Random (int size)
static const CwiseNullaryOp
< ei_scalar_random_op< Scalar >
, Derived > 
Random (int rows, int cols)
static const BasisReturnType Unit (int i)
static const BasisReturnType Unit (int size, int i)
static const BasisReturnType UnitW ()
static const BasisReturnType UnitX ()
static const BasisReturnType UnitY ()
static const BasisReturnType UnitZ ()
static const ConstantReturnType Zero ()
static const ConstantReturnType Zero (int size)
static const ConstantReturnType Zero (int rows, int cols)

Friends

const CwiseUnaryOp
< ei_scalar_multiple_op
< typename ei_traits< Derived >
::Scalar >, Derived > 
operator* (const Scalar &scalar, const MatrixBase &matrix)

Related Functions

(Note that these are not member functions.)

template<typename Derived>
std::ostream & operator<< (std::ostream &s, const MatrixBase< Derived > &m)

Classes

class  InnerIterator

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index