This commit is contained in:
Gael Guennebaud 2010-07-07 16:44:05 +02:00
commit 861962c55f
54 changed files with 143 additions and 70 deletions

View File

@ -25,6 +25,20 @@
#ifndef EIGEN_ARRAY_H
#define EIGEN_ARRAY_H
/** \class Array
* \ingroup Core_Module
*
* \brief General-purpose arrays with easy API for coefficient-wise operations
*
* The %Array class is very similar to the Matrix class. It provides
* general-purpose one- and two-dimensional arrays. The difference between the
* %Array and the %Matrix class is primarily in the API: the API for the
* %Array class provides easy access to coefficient-wise operations, while the
* API for the %Matrix class provides easy access to linear-algebra
* operations.
*
* \sa \ref TutorialArrayClass
*/
template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
struct ei_traits<Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> > : ei_traits<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
{
@ -231,6 +245,7 @@ class Array
};
/** \defgroup arraytypedefs Global array typedefs
* \ingroup Core_Module
*
* Eigen defines several typedef shortcuts for most common 1D and 2D array types.
*

View File

@ -28,6 +28,7 @@
template<typename ExpressionType> class MatrixWrapper;
/** \class ArrayBase
* \ingroup Core_Module
*
* \brief Base class for all 1D and 2D array, and related expressions
*

View File

@ -26,6 +26,7 @@
#define EIGEN_ARRAYWRAPPER_H
/** \class ArrayWrapper
* \ingroup Core_Module
*
* \brief Expression of a mathematical vector or matrix as an array object
*
@ -110,6 +111,7 @@ class ArrayWrapper : public ArrayBase<ArrayWrapper<ExpressionType> >
};
/** \class MatrixWrapper
* \ingroup Core_Module
*
* \brief Expression of an array as a mathematical vector or matrix
*

View File

@ -27,6 +27,7 @@
/**
* \class BandMatrix
* \ingroup Core_Module
*
* \brief Represents a rectangular matrix with a banded storage
*
@ -205,6 +206,7 @@ class BandMatrix : public EigenBase<BandMatrix<_Scalar,Rows,Cols,Supers,Subs,Opt
/**
* \class TridiagonalMatrix
* \ingroup Core_Module
*
* \brief Represents a tridiagonal matrix
*

View File

@ -27,6 +27,7 @@
#define EIGEN_BLOCK_H
/** \class Block
* \ingroup Core_Module
*
* \brief Expression of a fixed-size or dynamic-size block
*

View File

@ -27,6 +27,7 @@
#define EIGEN_COMMAINITIALIZER_H
/** \class CommaInitializer
* \ingroup Core_Module
*
* \brief Helper class used by the comma initializer operator
*

View File

@ -27,6 +27,7 @@
#define EIGEN_CWISE_BINARY_OP_H
/** \class CwiseBinaryOp
* \ingroup Core_Module
*
* \brief Generic expression where a coefficient-wise binary operator is applied to two expressions
*

View File

@ -26,6 +26,7 @@
#define EIGEN_CWISE_NULLARY_OP_H
/** \class CwiseNullaryOp
* \ingroup Core_Module
*
* \brief Generic expression of a matrix where all coefficients are defined by a functor
*

View File

@ -27,6 +27,7 @@
#define EIGEN_CWISE_UNARY_OP_H
/** \class CwiseUnaryOp
* \ingroup Core_Module
*
* \brief Generic expression where a coefficient-wise unary operator is applied to an expression
*

View File

@ -26,6 +26,7 @@
#define EIGEN_CWISE_UNARY_VIEW_H
/** \class CwiseUnaryView
* \ingroup Core_Module
*
* \brief Generic lvalue expression of a coefficient-wise unary operator of a matrix or a vector
*

View File

@ -27,6 +27,7 @@
#define EIGEN_DENSEBASE_H
/** \class DenseBase
* \ingroup Core_Module
*
* \brief Base class for all dense matrices, vectors, and arrays
*

View File

@ -432,8 +432,9 @@ class DenseStorageBase : public ei_dense_xpr_base<Derived>::type
ei_assert((this->size()==0 || (IsVectorAtCompileTime ? (this->size() == other.size())
: (rows() == other.rows() && cols() == other.cols())))
&& "Size mismatch. Automatic resizing is disabled because EIGEN_NO_AUTOMATIC_RESIZING is defined");
#endif
#else
resizeLike(other);
#endif
}
/**

View File

@ -26,6 +26,7 @@
#define EIGEN_DIAGONAL_H
/** \class Diagonal
* \ingroup Core_Module
*
* \brief Expression of a diagonal/subdiagonal/superdiagonal in a matrix
*

View File

@ -87,6 +87,7 @@ void DiagonalBase<Derived>::evalTo(MatrixBase<DenseDerived> &other) const
#endif
/** \class DiagonalMatrix
* \ingroup Core_Module
*
* \brief Represents a diagonal matrix with its storage
*
@ -188,6 +189,7 @@ class DiagonalMatrix
};
/** \class DiagonalWrapper
* \ingroup Core_Module
*
* \brief Expression of a diagonal matrix
*

View File

@ -26,6 +26,7 @@
#define EIGEN_FLAGGED_H
/** \class Flagged
* \ingroup Core_Module
*
* \brief Expression with modified flags
*

View File

@ -26,6 +26,7 @@
#define EIGEN_FORCEALIGNEDACCESS_H
/** \class ForceAlignedAccess
* \ingroup Core_Module
*
* \brief Enforce aligned packet loads and stores regardless of what is requested
*

View File

@ -31,6 +31,7 @@ enum { StreamPrecision = -1,
FullPrecision = -2 };
/** \class IOFormat
* \ingroup Core_Module
*
* \brief Stores a set of parameters controlling the way matrices are printed
*
@ -80,6 +81,7 @@ struct IOFormat
};
/** \class WithFormat
* \ingroup Core_Module
*
* \brief Pseudo expression providing matrix output with given format
*

View File

@ -27,6 +27,7 @@
#define EIGEN_MAP_H
/** \class Map
* \ingroup Core_Module
*
* \brief A matrix or vector expression mapping an existing array of data.
*

View File

@ -27,6 +27,7 @@
#define EIGEN_MAPBASE_H
/** \class MapBase
* \ingroup Core_Module
*
* \brief Base class for Map and Block expression with direct access
*

View File

@ -27,6 +27,7 @@
#define EIGEN_MATRIX_H
/** \class Matrix
* \ingroup Core_Module
*
* \brief The matrix class, also used for vectors and row-vectors
*

View File

@ -27,6 +27,7 @@
#define EIGEN_MATRIXBASE_H
/** \class MatrixBase
* \ingroup Core_Module
*
* \brief Base class for all dense matrices, vectors, and expressions
*

View File

@ -79,6 +79,7 @@ struct ei_matrix_array<T, 0, MatrixOptions, Alignment>
/** \internal
*
* \class ei_matrix_storage
* \ingroup Core_Module
*
* \brief Stores the data of a matrix
*

View File

@ -27,6 +27,7 @@
#define EIGEN_NESTBYVALUE_H
/** \class NestByValue
* \ingroup Core_Module
*
* \brief Expression which must be nested by value
*

View File

@ -26,6 +26,7 @@
#define EIGEN_NOALIAS_H
/** \class NoAlias
* \ingroup Core_Module
*
* \brief Pseudo expression providing an operator = assuming no aliasing
*

View File

@ -26,6 +26,7 @@
#define EIGEN_NUMTRAITS_H
/** \class NumTraits
* \ingroup Core_Module
*
* \brief Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
*

View File

@ -27,6 +27,7 @@
#define EIGEN_PERMUTATIONMATRIX_H
/** \class PermutationMatrix
* \ingroup Core_Module
*
* \brief Permutation matrix
*

View File

@ -27,6 +27,7 @@
#define EIGEN_PRODUCT_H
/** \class GeneralProduct
* \ingroup Core_Module
*
* \brief Expression of the product of two general matrices or vectors
*
@ -120,6 +121,7 @@ template<> struct ei_product_type_selector<Small,Large,Small> { en
template<> struct ei_product_type_selector<Large,Large,Small> { enum { ret = GemmProduct }; };
/** \class ProductReturnType
* \ingroup Core_Module
*
* \brief Helper class to get the correct and optimized returned type of operator*
*

View File

@ -26,6 +26,7 @@
#define EIGEN_PRODUCTBASE_H
/** \class ProductBase
* \ingroup Core_Module
*
*/
template<typename Derived, typename _Lhs, typename _Rhs>

View File

@ -27,6 +27,7 @@
/**
* \class Replicate
* \ingroup Core_Module
*
* \brief Expression of the multiple replication of a matrix or vector
*

View File

@ -27,6 +27,7 @@
#define EIGEN_RETURNBYVALUE_H
/** \class ReturnByValue
* \ingroup Core_Module
*
*/
template<typename Derived>

View File

@ -28,6 +28,7 @@
#define EIGEN_REVERSE_H
/** \class Reverse
* \ingroup Core_Module
*
* \brief Expression of the reverse of a vector or matrix
*

View File

@ -26,6 +26,7 @@
#define EIGEN_SELECT_H
/** \class Select
* \ingroup Core_Module
*
* \brief Expression of a coefficient wise version of the C++ ternary operator ?:
*

View File

@ -26,6 +26,7 @@
#define EIGEN_SELFADJOINTMATRIX_H
/** \class SelfAdjointView
* \ingroup Core_Module
*
*
* \brief Expression of a selfadjoint matrix from a triangular part of a dense matrix

View File

@ -26,6 +26,7 @@
#define EIGEN_SELFCWISEBINARYOP_H
/** \class SelfCwiseBinaryOp
* \ingroup Core_Module
*
* \internal
*

View File

@ -26,6 +26,7 @@
#define EIGEN_STRIDE_H
/** \class Stride
* \ingroup Core_Module
*
* \brief Holds strides information for Map
*

View File

@ -26,6 +26,7 @@
#define EIGEN_SWAP_H
/** \class SwapWrapper
* \ingroup Core_Module
*
* \internal
*

View File

@ -27,6 +27,7 @@
#define EIGEN_TRANSPOSE_H
/** \class Transpose
* \ingroup Core_Module
*
* \brief Expression of the transpose of a matrix
*

View File

@ -26,6 +26,7 @@
#define EIGEN_TRANSPOSITIONS_H
/** \class Transpositions
* \ingroup Core_Module
*
* \brief Represents a sequence of transpositions (row/column interchange)
*

View File

@ -29,6 +29,7 @@
/** \internal
*
* \class TriangularBase
* \ingroup Core_Module
*
* \brief Base class for triangular part in a matrix
*/
@ -112,6 +113,7 @@ template<typename Derived> class TriangularBase : public EigenBase<Derived>
};
/** \class TriangularView
* \ingroup Core_Module
*
* \brief Base class for triangular part in a matrix
*

View File

@ -27,6 +27,7 @@
#define EIGEN_VECTORBLOCK_H
/** \class VectorBlock
* \ingroup Core_Module
*
* \brief Expression of a fixed-size or dynamic-size sub-vector
*

View File

@ -27,6 +27,7 @@
#define EIGEN_PARTIAL_REDUX_H
/** \class PartialReduxExpr
* \ingroup Core_Module
*
* \brief Generic expression of a partially reduxed matrix
*
@ -154,6 +155,7 @@ struct ei_member_redux {
};
/** \class VectorwiseOp
* \ingroup Core_Module
*
* \brief Pseudo expression providing partial reduction operations
*

View File

@ -38,7 +38,7 @@ const int Dynamic = -1;
*/
const int Infinity = -1;
/** \defgroup flags flags
/** \defgroup flags Flags
* \ingroup Core_Module
*
* These are the possible bits which can be OR'ed to constitute the flags of a matrix or

View File

@ -495,6 +495,7 @@ inline static Index ei_first_aligned(const Scalar* array, Index size)
/****************************************************************************/
/** \class aligned_allocator
* \ingroup Core_Module
*
* \brief STL compatible allocator to use with with 16 byte aligned types
*
@ -588,17 +589,17 @@ public:
//---------- Cache sizes ----------
#if defined(__GNUC__)
# if defined(__PIC__) && defined(__i386__)
# if defined(__PIC__) && defined(__i386__)
# define EIGEN_CPUID(abcd,func,id) \
__asm__ __volatile__ ("xchgl %%ebx, %%esi;cpuid; xchgl %%ebx,%%esi": "=a" (abcd[0]), "=S" (abcd[1]), "=c" (abcd[2]), "=d" (abcd[3]) : "a" (func), "c" (id));
# else
# elif !defined(__arm__) && !defined(__powerpc__)
# define EIGEN_CPUID(abcd,func,id) \
__asm__ __volatile__ ("cpuid": "=a" (abcd[0]), "=b" (abcd[1]), "=c" (abcd[2]), "=d" (abcd[3]) : "a" (func), "c" (id) );
# endif
# endif
#elif defined(_MSC_VER)
#if (_MSC_VER > 1500) /* newer than MSVC++ 9.0 */ || (_MSC_VER == 1500 && _MSC_FULL_VER >= 150030729) /* MSVC++ 9.0 with SP1*/
# if (_MSC_VER > 1500) /* newer than MSVC++ 9.0 */ || (_MSC_VER == 1500 && _MSC_FULL_VER >= 150030729) /* MSVC++ 9.0 with SP1*/
# define EIGEN_CPUID(abcd,func,id) __cpuidex((int*)abcd,func,id)
#endif
# endif
#endif
#ifdef EIGEN_CPUID
@ -771,6 +772,8 @@ inline void ei_queryCacheSizes(int& l1, int& l2, int& l3)
// ||ei_cpuid_is_vendor(abcd,"NexGenDriven")
// ||ei_cpuid_is_vendor(abcd,"CentaurHauls")
// ||ei_cpuid_is_vendor(abcd,"CentaurHauls")
#else
l1 = l2 = l3 = -1;
#endif
}

View File

@ -44,7 +44,7 @@
#define BTL_ASM_COMMENT(X)
#endif
#if (defined __GNUC__) && (!defined __INTEL_COMPILER)
#if (defined __GNUC__) && (!defined __INTEL_COMPILER) && !defined(__arm__) && !defined(__powerpc__)
#define BTL_DISABLE_SSE_EXCEPTIONS() { \
int aux; \
asm( \

View File

@ -3,11 +3,11 @@ namespace Eigen {
/** \page GettingStarted Getting started
\ingroup Tutorial
This is a very short guide on how to get started with Eigen. It is intended for people who do not like to read long documents and want to start coding as soon as possible. The \ref TutorialMatrixClass "Tutorial" is a longer document wich goes in more detail.
This is a very short guide on how to get started with Eigen. It has a dual purpose. It serves as a minimal introduction to the Eigen library for people who want to start coding as soon as possible. You can also read this page as the first part of the Tutorial, which explains the library in more detail; in this case you will continue with \ref TutorialMatrixClass.
\section GettingStartedInstallation How to "install" Eigen?
In order to use Eigen, you just need to download and extract Eigen's source code. In fact, the header files in the \c Eigen subdirectory are the only files required to compile programs using Eigen. The header files are the same for all platforms. It is not necessary to use CMake or install anything.
In order to use Eigen, you just need to download and extract Eigen's source code (see <a href="http://eigen.tuxfamily.org/index.php?title=Main_Page#Download">the wiki</a> for download instructions). In fact, the header files in the \c Eigen subdirectory are the only files required to compile programs using Eigen. The header files are the same for all platforms. It is not necessary to use CMake or install anything.
\section GettingStartedFirstProgram A simple first program
@ -32,9 +32,9 @@ When you run the program, it produces the following output:
\section GettingStartedExplanation Explanation of the first program
The Eigen header files define many types, but for simple applications it may be enough to use only the \c MatrixXd type. This represents a matrix of arbitrary size (hence the \c X in \c MatrixXd), in which every entry is a \c double (hence the \c d in \c MatrixXd). See \ref Somewhere for a table of the different types you can use to represent a matrix.
The Eigen header files define many types, but for simple applications it may be enough to use only the \c MatrixXd type. This represents a matrix of arbitrary size (hence the \c X in \c MatrixXd), in which every entry is a \c double (hence the \c d in \c MatrixXd). See the \ref QuickRef_Types "quick reference guide" for an overview of the different types you can use to represent a matrix.
The \c Eigen/Dense header file defines all member functions for the MatrixXd type and related types. All classes and functions defined in this header file (and other Eigen header files) are in the \c Eigen namespace.
The \c Eigen/Dense header file defines all member functions for the MatrixXd type and related types (see also the \ref QuickRef_Headers "table of header files"). All classes and functions defined in this header file (and other Eigen header files) are in the \c Eigen namespace.
The first line of the \c main function declares a variable of type \c MatrixXd and specifies that it is a matrix with 2 rows and 2 columns (the entries are not initialized). The statement <tt>m(0,0) = 3</tt> sets the entry in the top-left corner to 3. You need to use round parentheses to refer to entries in the matrix. As usual in computer science, the index of the first index is 0, as opposed to the convention in mathematics that the first index is 1.
@ -61,9 +61,9 @@ The output is as follows:
\section GettingStartedExplanation2 Explanation of the second example
The second example starts by declaring a 3-by-3 matrix \c m which is initialized with random values in the range [-1:1]. The next line applies a linear mapping such that the values fit in the range [10:110]. The function call MatrixXd::Constant(3,3,1.2) returns \c 3x3 matrix expression having all coefficient equal to 1.2. The rest is standard arithmetics.
The second example starts by declaring a 3-by-3 matrix \c m which is initialized using the \link DenseBase::Random(Index,Index) Random() \endlink method with random values between -1 and 1. The next line applies a linear mapping such that the values are between 10 and 110. The function call \link DenseBase::Constant(Index,Index,const Scalar&) MatrixXd::Constant\endlink(3,3,1.2) returns a 3-by-3 matrix expression having all coefficients equal to 1.2. The rest is standard arithmetics.
The next line of the \c main function introduces a new type: \c VectorXd. This represents a (column) vector of arbitrary size. Here, the vector \c v is created to contains \c 3 coefficients which are left unitialized. The one but last line sets all coefficients of the vector \c v to be as follow:
The next line of the \c main function introduces a new type: \c VectorXd. This represents a (column) vector of arbitrary size. Here, the vector \c v is created to contains \c 3 coefficients which are left unitialized. The one but last line uses the so-called comma-initializer, explained in \ref TutorialAdvancedInitialization, to set all coefficients of the vector \c v to be as follows:
\f[
v =
@ -83,7 +83,7 @@ The use of fixed-size matrices and vectors has two advantages. The compiler emit
\section GettingStartedConclusion Where to go from here?
You could directly use our reference tables and class documentation, or if you do not yet feel ready for that, you could
You could directly use our \ref QuickRefPage and class documentation, or if you do not yet feel ready for that, you could
read the longer \ref TutorialMatrixClass "Tutorial" in which the Eigen library is explained in more detail.
\li \b Next: \ref TutorialMatrixClass

View File

@ -1,6 +1,6 @@
namespace Eigen {
/** \page TutorialMatrixClass Tutorial page 1 - the %Matrix class
/** \page TutorialMatrixClass Tutorial page 1 - The %Matrix class
\ingroup Tutorial
@ -23,17 +23,17 @@ This page is the first one in a much longer multi-page tutorial.
- \ref TutorialMatrixOptTemplParams
- \ref TutorialMatrixTypedefs
In Eigen, all matrices and vectors are object of the Matrix class.
In Eigen, all matrices and vectors are objects of the Matrix template class.
Vectors are just a special case of matrices, with either 1 row or 1 column.
\section TutorialMatrixFirst3Params The first 3 template parameters of Matrix
\section TutorialMatrixFirst3Params The first three template parameters of Matrix
The Matrix class takes 6 template parameters, but for now it's enough to
learn about the 3 first parameters. The 3 remaining parameters have default
The Matrix class takes six template parameters, but for now it's enough to
learn about the first three first parameters. The three remaining parameters have default
values, which for now we will leave untouched, and which we
\ref TutorialMatrixOptTemplParams "discuss below".
The 3 mandatory template parameters of Matrix are:
The three mandatory template parameters of Matrix are:
\code
Matrix<typename Scalar, int RowsAtCompileTime, int ColsAtCompileTime>
\endcode
@ -42,12 +42,14 @@ Matrix<typename Scalar, int RowsAtCompileTime, int ColsAtCompileTime>
See \ref TopicScalarTypes "Scalar types" for a list of all supported
scalar types and for how to extend support to new types.
\li \c RowsAtCompileTime and \c ColsAtCompileTime are the number of rows
and columns of the matrix as known at compile-time.
and columns of the matrix as known at compile time (see
\ref TutorialMatrixDynamic "below" for what to do if the number is not
known at compile time).
We offer a lot of convenience typedefs to cover the usual cases. For example, \c Matrix4f is
a 4x4 matrix of floats. Here is how it is defined by Eigen:
\code
typedef Matrix<float,4,4> Matrix4f;
typedef Matrix<float, 4, 4> Matrix4f;
\endcode
We discuss \ref TutorialMatrixTypedefs "below" these convenience typedefs.
@ -58,11 +60,11 @@ matrices, with either 1 row or 1 column. The case where they have 1 column is th
such vectors are called column-vectors, often abbreviated as just vectors. In the other case
where they have 1 row, they are called row-vectors.
For example, the convenience typedef \c Vector3f is defined as follows by Eigen:
For example, the convenience typedef \c Vector3f is a (column) vector of 3 floats. It is defined as follows by Eigen:
\code
typedef Matrix<float, 3, 1> Vector3f;
\endcode
and we also offer convenience typedefs for row-vectors, for example:
We also offer convenience typedefs for row-vectors, for example:
\code
typedef Matrix<int, 1, 2> RowVector2i;
\endcode
@ -70,18 +72,18 @@ typedef Matrix<int, 1, 2> RowVector2i;
\section TutorialMatrixDynamic The special value Dynamic
Of course, Eigen is not limited to matrices whose dimensions are known at compile time.
The above-discussed \c RowsAtCompileTime and \c ColsAtCompileTime can take the special
The \c RowsAtCompileTime and \c ColsAtCompileTime template parameters can take the special
value \c Dynamic which indicates that the size is unknown at compile time, so must
be handled as a run time variable. In Eigen terminology, such a size is referred to as a
be handled as a run-time variable. In Eigen terminology, such a size is referred to as a
\em dynamic \em size; while a size that is known at compile time is called a
\em fixed \em size. For example, the convenience typedef \c MatrixXd, meaning
a matrix of doubles with dynamic size, is defined as follows:
\code
typedef Matrix<double,Dynamic,Dynamic> MatrixXd;
typedef Matrix<double, Dynamic, Dynamic> MatrixXd;
\endcode
And similarly, we define a self-explanatory typedef \c VectorXi as follows:
\code
typedef Matrix<int,Dynamic,1> VectorXi;
typedef Matrix<int, Dynamic, 1> VectorXi;
\endcode
You can perfectly have e.g. a fixed number of rows with a dynamic number of columns, as in:
\code
@ -151,16 +153,16 @@ Matrix and vector coefficients can be conveniently set using the so-called \em c
For now, it is enough to know this example:
\include Tutorial_commainit_01.cpp
Output: \verbinclude Tutorial_commainit_01.out
The right hand side can also contains matrix expressions as discussed in \ref TutorialAdvancedInitialization "this page".
The right-hand side can also contain matrix expressions as discussed in \ref TutorialAdvancedInitialization "this page".
\section TutorialMatrixSizesResizing Resizing
The current sizes can be retrieved by rows(), cols() and size(). Resizing a dynamic-size matrix is done by the resize() method.
The current size of a matrix can be retrieved by \link EigenBase::rows() rows()\endlink, \link EigenBase::cols() cols() \endlink and \link EigenBase::size() size()\endlink. These methods return the number of rows, the number of columns and the number of coefficients, respectively. Resizing a dynamic-size matrix is done by the \link DenseStorageBase::resize(Index,Index) resize() \endlink method.
For example: \include tut_matrix_resize.cpp
Output: \verbinclude tut_matrix_resize.out
The resize() method is a no-operation if the actual array size doesn't change; otherwise it is destructive.
If you want a conservative variant of resize(), use conservativeResize(), see \ref TopicResizing "this page" for more details.
The resize() method is a no-operation if the actual matrix size doesn't change; otherwise it is destructive: the values of the coefficients may change.
If you want a conservative variant of resize() which does not change the coefficients, use \link DenseStorageBase::conservativeResize() conservativeResize()\endlink, see \ref TopicResizing "this page" for more details.
All these methods are still available on fixed-size matrices, for the sake of API uniformity. Of course, you can't actually
resize a fixed-size matrix. Trying to change a fixed size to an actually different value will trigger an assertion failure;
@ -170,12 +172,11 @@ Output: \verbinclude tut_matrix_resize_fixed_size.out
\section TutorialMatrixAssignment Assignment and resizing
Assignment is the action of copying a matrix into another, using \c operator=. The only non-obvious thing to know here, is that
Eigen does automatic resizing of the left hand side to match the right hand side's size. For example:
Assignment is the action of copying a matrix into another, using \c operator=. Eigen resizes the matrix on the left-hand side automatically so that it matches the size of the matrix on the right-hand size. For example:
\include tut_matrix_assignment_resizing.cpp
Output: \verbinclude tut_matrix_assignment_resizing.out
Of course, if the left hand side is of fixed size, resizing it is not allowed.
Of course, if the left-hand side is of fixed size, resizing it is not allowed.
If you do not want this automatic resizing to happen (for example for debugging purposes), you can disable it, see
\ref TopicResizing "this page".
@ -210,8 +211,8 @@ Finally, depending on circumstances, Eigen can also be more aggressive trying to
\section TutorialMatrixOptTemplParams Optional template parameters
We mentioned at the beginning of this page that the Matrix class takes 6 template parameters,
but so far we only discussed the first 3. The remaining 3 parameters are optional. Here is
We mentioned at the beginning of this page that the Matrix class takes six template parameters,
but so far we only discussed the first three. The remaining three parameters are optional. Here is
the complete list of template parameters:
\code
Matrix<typename Scalar,
@ -221,18 +222,18 @@ Matrix<typename Scalar,
int MaxRowsAtCompileTime = RowsAtCompileTime,
int MaxColsAtCompileTime = ColsAtCompileTime>
\endcode
\li \c Options is a bit field; let us only mention here one bit: \c RowMajor. It specifies that the matrices
of this type use row-major storage order; the default is column-major. See the page on
\li \c Options is a bit field. Here, we discuss only one bit: \c RowMajor. It specifies that the matrices
of this type use row-major storage order; by default, the storage order is column-major. See the page on
\ref TopicStorageOrders "storage orders". For example, this type means row-major 3x3 matrices:
\code
Matrix<float,3,3,RowMajor>
Matrix<float, 3, 3, RowMajor>
\endcode
\li \c MaxRowsAtCompileTime and \c MaxColsAtCompileTime are useful when you want to specify that, even though
the exact sizes of your matrices are unknown at compile time, a fixed upper bound is known at
the exact sizes of your matrices are not known at compile time, a fixed upper bound is known at
compile time. The biggest reason why you might want to do that is to avoid dynamic memory allocation.
For example the following matrix type uses a static array of 12 floats, without dynamic memory allocation:
\code
Matrix<float,Dynamic,Dynamic,0,3,4>
Matrix<float, Dynamic, Dynamic, 0, 3, 4>
\endcode
\section TutorialMatrixTypedefs Convenience typedefs
@ -243,10 +244,10 @@ Eigen defines the following Matrix typedefs:
\li RowVectorNt for Matrix<type, 1, N>. For example, RowVector3d for Matrix<double, 1, 3>.
Where:
\li N can be any one of \c 2,\c 3,\c 4, or \c d (meaning \c Dynamic).
\li N can be any one of \c 2, \c 3, \c 4, or \c X (meaning \c Dynamic).
\li t can be any one of \c i (meaning int), \c f (meaning float), \c d (meaning double),
\c cf (meaning complex<float>), or \c cd (meaning complex<double>). The fact that typedefs are only
defined for these 5 types doesn't mean that they are the only supported scalar types. For example,
defined for these five types doesn't mean that they are the only supported scalar types. For example,
all standard integer types are supported, see \ref TopicScalarTypes "Scalar types".
\li \b Next: \ref TutorialMatrixArithmetic

View File

@ -2,6 +2,9 @@ namespace Eigen {
/** \page TopicWrongStackAlignment Compiler making a wrong assumption on stack alignment
<h4>It appears that this was a GCC bug that has been fixed in GCC 4.5.
If you hit this issue, please upgrade to GCC 4.5 and report to us, so we can update this page.</h4>
This is an issue that, so far, we met only with GCC on Windows: for instance, MinGW and TDM-GCC.
By default, in a function like this,

View File

@ -12,7 +12,7 @@ This is the API documentation for Eigen3.
Eigen2 users: here is a \ref Eigen2ToEigen3 guide to help porting your application.
For a first contact with Eigen, the best place is to have a look at the \ref GettingStarted "tutorial". The \ref QuickRefPage "short reference" page gives you a quite complete description of the API in a very condensed format that is specially useful to recall the syntax of a particular features, or to have a quick look at the API. For Matlab users, there is also a <a href="AsciiQuickReference.txt">ASCII quick reference</a> with Matlab translations.
For a first contact with Eigen, the best place is to have a look at the \ref GettingStarted "tutorial". The \ref QuickRefPage "short reference" page gives you a quite complete description of the API in a very condensed format that is specially useful to recall the syntax of a particular feature, or to have a quick look at the API. For Matlab users, there is also a <a href="AsciiQuickReference.txt">ASCII quick reference</a> with Matlab translations. The \e Modules and \e Classes tabs at the top of this page give you access to the API documentation of individual classes and functions.
\b Table \b of \b contents
- \ref Eigen2ToEigen3
@ -23,18 +23,16 @@ For a first contact with Eigen, the best place is to have a look at the \ref Get
- \ref TutorialArrayClass
- \ref TutorialBlockOperations
- \ref TutorialAdvancedInitialization
- Comming soon: "Reductions, visitors, and broadcasting"
- \ref TutorialLinearAlgebra
- Coming soon: "Reductions, visitors, and broadcasting"
- \ref TutorialGeometry
- \ref TutorialSparseMatrix
- \ref TutorialSparse
- \ref QuickRefPage
- <b>Advanced topics</b>
- \ref TopicLazyEvaluation
- \ref TopicLinearAlgebraDecompositions
- \ref TopicCustomizingEigen
- \ref TopicInsideEigenExample
- \ref TopicHiPerformance
- <b>Topics on getting high performances</b>
- \ref TopicWritingEfficientProductExpression
- <b>Topics related to alignment issues</b>
- \ref TopicUnalignedArrayAssert

View File

@ -18,18 +18,21 @@ namespace Eigen {
<a href="#" class="top">top</a>
\section QuickRef_Headers Modules and Header files
The Eigen library is divided in a Core module and several additional modules. Each module has a corresponding header file which has to be included in order to use the module. The \c %Dense and \c Eigen header files are provided to conveniently gain access to several modules at once.
<table class="tutorial_code">
<tr><td>Module</td><td>Header file</td><td>Contents</td></tr>
<tr><td>Core</td><td>\code#include <Eigen/Core>\endcode</td><td>Matrix and Array classes, basic linear algebra (including triangular and selfadjoint products), array manipulation</td></tr>
<tr><td>Geometry</td><td>\code#include <Eigen/Geometry>\endcode</td><td>Transformation, Translation, Scaling, 2D and 3D rotations (Quaternion, AngleAxis)</td></tr>
<tr><td>LU</td><td>\code#include <Eigen/LU>\endcode</td><td>Inverse, determinant, LU decompositions (FullPivLU, PartialPivLU) with solver</td></tr>
<tr><td>Cholesky</td><td>\code#include <Eigen/Cholesky>\endcode</td><td>LLT and LDLT Cholesky factorization with solver</td></tr>
<tr><td>SVD</td><td>\code#include <Eigen/SVD>\endcode</td><td>SVD decomposition with solver (HouseholderSVD, JacobiSVD)</td></tr>
<tr><td>QR</td><td>\code#include <Eigen/QR>\endcode</td><td>QR decomposition with solver (HouseholderQR, ColPivHouseholerQR, FullPivHouseholderQR)</td></tr>
<tr><td>Eigenvalues</td><td>\code#include <Eigen/Eigenvalues>\endcode</td><td>Eigenvalue, eigenvector decompositions for selfadjoint and non selfadjoint real or complex matrices.</td></tr>
<tr><td>Sparse</td><td>\code#include <Eigen/Sparse>\endcode</td><td>Sparse matrix storage and related basic linear algebra.</td></tr>
<tr><td></td><td>\code#include <Eigen/Dense>\endcode</td><td>Includes Core, Geometry, LU, Cholesky, SVD, QR, and Eigenvalues</td></tr>
<tr><td></td><td>\code#include <Eigen/Eigen>\endcode</td><td>Includes Dense and Sparse</td></tr>
<tr><td>\link Core_Module Core \endlink</td><td>\code#include <Eigen/Core>\endcode</td><td>Matrix and Array classes, basic linear algebra (including triangular and selfadjoint products), array manipulation</td></tr>
<tr><td>\link Geometry_Module Geometry \endlink</td><td>\code#include <Eigen/Geometry>\endcode</td><td>Transform, Translation, Scaling, Rotation2D and 3D rotations (Quaternion, AngleAxis)</td></tr>
<tr><td>\link LU_Module LU \endlink</td><td>\code#include <Eigen/LU>\endcode</td><td>Inverse, determinant, LU decompositions with solver (FullPivLU, PartialPivLU)</td></tr>
<tr><td>\link Cholesky_Module Cholesky \endlink</td><td>\code#include <Eigen/Cholesky>\endcode</td><td>LLT and LDLT Cholesky factorization with solver</td></tr>
<tr><td>\link Householder_Module Householder \endlink</td><td>\code#include <Eigen/Householder>\endcode</td><td>Householder transformations; this module is used by several linear algebra modules</td></tr>
<tr><td>\link SVD_Module SVD \endlink</td><td>\code#include <Eigen/SVD>\endcode</td><td>%SVD decomposition with solver (SVD, JacobiSVD)</td></tr>
<tr><td>\link QR_Module QR \endlink</td><td>\code#include <Eigen/QR>\endcode</td><td>QR decomposition with solver (HouseholderQR, ColPivHouseholderQR, FullPivHouseholderQR)</td></tr>
<tr><td>\link Eigenvalues_Module Eigenvalues \endlink</td><td>\code#include <Eigen/Eigenvalues>\endcode</td><td>Eigenvalue, eigenvector decompositions (EigenSolver, SelfAdjointEigenSolver, ComplexEigenSolver)</td></tr>
<tr><td>\link Sparse_Module Sparse \endlink</td><td>\code#include <Eigen/Sparse>\endcode</td><td>%Sparse matrix storage and related basic linear algebra (SparseMatrix, DynamicSparseMatrix, SparseVector)</td></tr>
<tr><td></td><td>\code#include <Eigen/Dense>\endcode</td><td>Includes Core, Geometry, LU, Cholesky, %SVD, QR, and Eigenvalues header files</td></tr>
<tr><td></td><td>\code#include <Eigen/Eigen>\endcode</td><td>Includes %Dense and %Sparse header files (the whole Eigen library)</td></tr>
</table>
<a href="#" class="top">top</a>
@ -486,7 +489,7 @@ Read-write access to sub-vectors:
<tr><td>\code vec1.head(n)\endcode</td><td>\code vec1.head<n>()\endcode</td><td>the first \c n coeffs </td></tr>
<tr><td>\code vec1.tail(n)\endcode</td><td>\code vec1.tail<n>()\endcode</td><td>the last \c n coeffs </td></tr>
<tr><td>\code vec1.segment(pos,n)\endcode</td><td>\code vec1.segment<n>(pos)\endcode</td>
<td>the \c size coeffs in \n the range [\c pos : \c pos + \c n [</td></tr>
<td>the \c n coeffs in \n the range [\c pos : \c pos + \c n [</td></tr>
<tr style="border-style: dashed none dashed none;"><td>
Read-write access to sub-matrices:</td><td></td><td></td></tr>

View File

@ -2,4 +2,4 @@ Matrix3f m;
m << 1, 2, 3,
4, 5, 6,
7, 8, 9;
cout << m;
std::cout << m;

View File

@ -1,5 +1,5 @@
MatrixXf a(2,2);
cout << "a is of size " << a.rows() << "x" << a.cols() << std::endl;
std::cout << "a is of size " << a.rows() << "x" << a.cols() << std::endl;
MatrixXf b(3,3);
a = b;
cout << "a is now of size " << a.rows() << "x" << a.cols() << std::endl;
std::cout << "a is now of size " << a.rows() << "x" << a.cols() << std::endl;

View File

@ -1,4 +1,7 @@
set(Eigen_HEADERS AdolcForward BVH IterativeSolvers MatrixFunctions MoreVectorization AutoDiff AlignedVector3 Polynomials)
set(Eigen_HEADERS AdolcForward BVH IterativeSolvers MatrixFunctions MoreVectorization AutoDiff AlignedVector3 Polynomials
CholmodSupport FFT NonLinearOptimization SparseExtra SuperLUSupport UmfPackSupport IterativeSolvers
NumericalDiff Skyline TaucsSupport
)
install(FILES
${Eigen_HEADERS}

View File

@ -30,7 +30,7 @@
namespace Eigen {
/** \ingroup Unsupported_modules
* \defgroup NumericalDiff_Module Numerical differenciation module
* \defgroup NumericalDiff_Module Numerical differentiation module
*
* \code
* #include <unsupported/Eigen/NumericalDiff>
@ -51,7 +51,7 @@ namespace Eigen {
* want to achieve with Eigen.
*
* This is why we will not provide wrappers for every great numerical
* differenciation software that exist, but should rather stick with those
* differentiation software that exist, but should rather stick with those
* basic ones, that still are useful for testing.
*
* Also, the \ref NonLinearOptimization_Module needs this in order to

View File

@ -1,9 +1,9 @@
#ifndef EIGEN_SPARSE_EXTRA_MODULE_H
#define EIGEN_SPARSE_EXTRA_MODULE_H
#include "../Eigen/Sparse"
#include "../../Eigen/Sparse"
#include "src/Core/util/DisableMSVCWarnings.h"
#include "../../Eigen/src/Core/util/DisableMSVCWarnings.h"
#include <vector>
#include <map>
@ -63,6 +63,6 @@ enum {
} // namespace Eigen
#include "src/Core/util/EnableMSVCWarnings.h"
#include "../../Eigen/src/Core/util/EnableMSVCWarnings.h"
#endif // EIGEN_SPARSE_EXTRA_MODULE_H