mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-01-18 14:34:17 +08:00
update CSS to doxygen 1.7.2, new CSS and cleaning of the tutorial
This commit is contained in:
parent
9f8b6ad43e
commit
f66fe2663f
@ -25,8 +25,8 @@ In order to ease the switch from Eigen2 to Eigen3, Eigen3 features a compatibili
|
||||
|
||||
\section VectorBlocks Vector blocks
|
||||
|
||||
<table>
|
||||
<tr><td>Eigen 2</td><td>Eigen 3</td></tr>
|
||||
<table class="manual">
|
||||
<tr><th>Eigen 2</th><th>Eigen 3</th></th>
|
||||
<tr><td>\code
|
||||
vector.start(length)
|
||||
vector.start<length>()
|
||||
@ -43,8 +43,8 @@ vector.tail<length>()
|
||||
|
||||
\section Corners Matrix Corners
|
||||
|
||||
<table>
|
||||
<tr><td>Eigen 2</td><td>Eigen 3</td></tr>
|
||||
<table class="manual">
|
||||
<tr><th>Eigen 2</th><th>Eigen 3</th></th>
|
||||
<tr><td>\code
|
||||
matrix.corner(TopLeft,r,c)
|
||||
matrix.corner(TopRight,r,c)
|
||||
@ -99,8 +99,8 @@ c = (a.cwise().abs().cwise().pow(3)).cwise() * (b.cwise().abs().cwise().sin());
|
||||
|
||||
In Eigen 2 you had to play with the part, extract, and marked functions to deal with triangular and selfadjoint matrices. In Eigen 3, all these functions have been removed in favor of the concept of \em views:
|
||||
|
||||
<table>
|
||||
<tr><td>Eigen 2</td><td>Eigen 3</td></tr>
|
||||
<table class="manual">
|
||||
<tr><th>Eigen 2</th><th>Eigen 3</th></tr>
|
||||
<tr><td>\code
|
||||
A.part<UpperTriangular>();
|
||||
A.part<StrictlyLowerTriangular>(); \endcode</td>
|
||||
@ -149,8 +149,8 @@ StrictlyLower
|
||||
|
||||
\section TriangularSolveInPlace Triangular in-place solving
|
||||
|
||||
<table>
|
||||
<tr><td>Eigen 2</td><td>Eigen 3</td></tr>
|
||||
<table class="manual">
|
||||
<tr><th>Eigen 2</th><th>Eigen 3</th></tr>
|
||||
<tr><td>\code A.triangularSolveInPlace<XxxTriangular>(Y);\endcode</td><td>\code A.triangularView<Xxx>().solveInPlace(Y);\endcode</td></tr>
|
||||
</table>
|
||||
|
||||
@ -159,62 +159,62 @@ StrictlyLower
|
||||
|
||||
Some of Eigen 2's matrix decompositions have been renamed in Eigen 3, while some others have been removed and are replaced by other decompositions in Eigen 3.
|
||||
|
||||
<table>
|
||||
<table class="manual">
|
||||
<tr>
|
||||
<td>Eigen 2</td>
|
||||
<td>Eigen 3</td>
|
||||
<td>Notes</td>
|
||||
<th>Eigen 2</th>
|
||||
<th>Eigen 3</th>
|
||||
<th>Notes</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>LU</td>
|
||||
<td>FullPivLU</td>
|
||||
<td>See also the new PartialPivLU, it's much faster</td>
|
||||
<td class="alt">See also the new PartialPivLU, it's much faster</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>QR</td>
|
||||
<td>HouseholderQR</td>
|
||||
<td>See also the new ColPivHouseholderQR, it's more reliable</td>
|
||||
<td class="alt">See also the new ColPivHouseholderQR, it's more reliable</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>SVD</td>
|
||||
<td>JacobiSVD</td>
|
||||
<td>We currently don't have a bidiagonalizing SVD; of course this is planned.</td>
|
||||
<td class="alt">We currently don't have a bidiagonalizing SVD; of course this is planned.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>EigenSolver and friends</td>
|
||||
<td>\code #include<Eigen/Eigenvalues> \endcode </td>
|
||||
<td>Moved to separate module</td>
|
||||
<td class="alt">Moved to separate module</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
\section LinearSolvers Linear solvers
|
||||
|
||||
<table>
|
||||
<tr><td>Eigen 2</td><td>Eigen 3</td><td>Notes</td></tr>
|
||||
<table class="manual">
|
||||
<tr><th>Eigen 2</th><th>Eigen 3</th><th>Notes</th></tr>
|
||||
<tr><td>\code A.lu();\endcode</td>
|
||||
<td>\code A.fullPivLu();\endcode</td>
|
||||
<td>Now A.lu() returns a PartialPivLU</td></tr>
|
||||
<td class="alt">Now A.lu() returns a PartialPivLU</td></tr>
|
||||
<tr><td>\code A.lu().solve(B,&X);\endcode</td>
|
||||
<td>\code X = A.lu().solve(B);
|
||||
X = A.fullPivLu().solve(B);\endcode</td>
|
||||
<td>The returned by value is fully optimized</td></tr>
|
||||
<td class="alt">The returned by value is fully optimized</td></tr>
|
||||
<tr><td>\code A.llt().solve(B,&X);\endcode</td>
|
||||
<td>\code X = A.llt().solve(B);
|
||||
X = A.selfadjointView<Lower>.llt().solve(B);
|
||||
X = A.selfadjointView<Upper>.llt().solve(B);\endcode</td>
|
||||
<td>The returned by value is fully optimized and \n
|
||||
<td class="alt">The returned by value is fully optimized and \n
|
||||
the selfadjointView API allows you to select the \n
|
||||
triangular part to work on (default is lower part)</td></tr>
|
||||
<tr><td>\code A.llt().solveInPlace(B);\endcode</td>
|
||||
<td>\code B = A.llt().solve(B);
|
||||
B = A.selfadjointView<Lower>.llt().solve(B);
|
||||
B = A.selfadjointView<Upper>.llt().solve(B);\endcode</td>
|
||||
<td>In place solving</td></tr>
|
||||
<td class="alt">In place solving</td></tr>
|
||||
<tr><td>\code A.ldlt().solve(B,&X);\endcode</td>
|
||||
<td>\code X = A.ldlt().solve(B);
|
||||
X = A.selfadjointView<Lower>.ldlt().solve(B);
|
||||
X = A.selfadjointView<Upper>.ldlt().solve(B);\endcode</td>
|
||||
<td>The returned by value is fully optimized and \n
|
||||
<td class="alt">The returned by value is fully optimized and \n
|
||||
the selfadjointView API allows you to select the \n
|
||||
triangular part to work on</td></tr>
|
||||
</table>
|
||||
|
@ -133,11 +133,13 @@ The primary coefficient accessors and mutators in Eigen are the overloaded paren
|
||||
For matrices, the row index is always passed first. For vectors, just pass one index.
|
||||
The numbering starts at 0. This example is self-explanatory:
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include tut_matrix_coefficient_accessors.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include tut_matrix_coefficient_accessors.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude tut_matrix_coefficient_accessors.out
|
||||
\verbinclude tut_matrix_coefficient_accessors.out
|
||||
</td></tr></table>
|
||||
|
||||
Note that the syntax <tt> m(index) </tt>
|
||||
@ -154,12 +156,12 @@ would make matrix[i,j] compile to the same thing as matrix[j] !
|
||||
%Matrix and vector coefficients can be conveniently set using the so-called \em comma-initializer syntax.
|
||||
For now, it is enough to know this example:
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include Tutorial_commainit_01.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude Tutorial_commainit_01.out
|
||||
</td></tr></table>
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr>
|
||||
<td>\include Tutorial_commainit_01.cpp </td>
|
||||
<td>\verbinclude Tutorial_commainit_01.out </td>
|
||||
</tr></table>
|
||||
|
||||
|
||||
The right-hand side can also contain matrix expressions as discussed in \ref TutorialAdvancedInitialization "this page".
|
||||
@ -168,12 +170,12 @@ The right-hand side can also contain matrix expressions as discussed in \ref Tut
|
||||
|
||||
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.
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include tut_matrix_resize.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude tut_matrix_resize.out
|
||||
</td></tr></table>
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr>
|
||||
<td>\include tut_matrix_resize.cpp </td>
|
||||
<td>\verbinclude tut_matrix_resize.out </td>
|
||||
</tr></table>
|
||||
|
||||
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.
|
||||
@ -182,24 +184,24 @@ All these methods are still available on fixed-size matrices, for the sake of AP
|
||||
resize a fixed-size matrix. Trying to change a fixed size to an actually different value will trigger an assertion failure;
|
||||
but the following code is legal:
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include tut_matrix_resize_fixed_size.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude tut_matrix_resize_fixed_size.out
|
||||
</td></tr></table>
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr>
|
||||
<td>\include tut_matrix_resize_fixed_size.cpp </td>
|
||||
<td>\verbinclude tut_matrix_resize_fixed_size.out </td>
|
||||
</tr></table>
|
||||
|
||||
|
||||
\section TutorialMatrixAssignment Assignment and resizing
|
||||
|
||||
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:
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include tut_matrix_assignment_resizing.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude tut_matrix_assignment_resizing.out
|
||||
</td></tr></table>
|
||||
<table class="tutorial_code">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr>
|
||||
<td>\include tut_matrix_assignment_resizing.cpp </td>
|
||||
<td>\verbinclude tut_matrix_assignment_resizing.out </td>
|
||||
</tr></table>
|
||||
|
||||
Of course, if the left-hand side is of fixed size, resizing it is not allowed.
|
||||
|
||||
|
@ -39,11 +39,13 @@ also have the same \c Scalar type, as Eigen doesn't do automatic type promotion.
|
||||
\li compound operator += as in \c a+=b
|
||||
\li compound operator -= as in \c a-=b
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include tut_arithmetic_add_sub.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include tut_arithmetic_add_sub.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude tut_arithmetic_add_sub.out
|
||||
\verbinclude tut_arithmetic_add_sub.out
|
||||
</td></tr></table>
|
||||
|
||||
\section TutorialArithmeticScalarMulDiv Scalar multiplication and division
|
||||
@ -55,11 +57,13 @@ Multiplication and division by a scalar is very simple too. The operators at han
|
||||
\li compound operator *= as in \c matrix*=scalar
|
||||
\li compound operator /= as in \c matrix/=scalar
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include tut_arithmetic_scalar_mul_div.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include tut_arithmetic_scalar_mul_div.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude tut_arithmetic_scalar_mul_div.out
|
||||
\verbinclude tut_arithmetic_scalar_mul_div.out
|
||||
</td></tr></table>
|
||||
|
||||
|
||||
@ -89,30 +93,36 @@ more opportunities for optimization.
|
||||
|
||||
The transpose \f$ a^T \f$, conjugate \f$ \bar{a} \f$, and adjoint (i.e., conjugate transpose) \f$ a^* \f$ of a matrix or vector \f$ a \f$ are obtained by the member functions \link DenseBase::transpose() transpose()\endlink, \link MatrixBase::conjugate() conjugate()\endlink, and \link MatrixBase::adjoint() adjoint()\endlink, respectively.
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include tut_arithmetic_transpose_conjugate.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include tut_arithmetic_transpose_conjugate.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude tut_arithmetic_transpose_conjugate.out
|
||||
\verbinclude tut_arithmetic_transpose_conjugate.out
|
||||
</td></tr></table>
|
||||
|
||||
For real matrices, \c conjugate() is a no-operation, and so \c adjoint() is 100% equivalent to \c transpose().
|
||||
|
||||
As for basic arithmetic operators, \c transpose() and \c adjoint() simply return a proxy object without doing the actual transposition. If you do <tt>b = a.transpose()</tt>, then the transpose is evaluated at the same time as the result is written into \c b. However, there is a complication here. If you do <tt>a = a.transpose()</tt>, then Eigen starts writing the result into \c a before the evaluation of the transpose is finished. Therefore, the instruction <tt>a = a.transpose()</tt> does not replace \c a with its transpose, as one would expect:
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include tut_arithmetic_transpose_aliasing.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include tut_arithmetic_transpose_aliasing.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude tut_arithmetic_transpose_aliasing.out
|
||||
\verbinclude tut_arithmetic_transpose_aliasing.out
|
||||
</td></tr></table>
|
||||
This is the so-called \ref TopicAliasing "aliasing issue". In "debug mode", i.e., when \ref TopicAssertions "assertions" have not been disabled, such common pitfalls are automatically detected.
|
||||
|
||||
For \em in-place transposition, as for instance in <tt>a = a.transpose()</tt>, simply use the \link DenseBase::transposeInPlace() transposeInPlace()\endlink function:
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include tut_arithmetic_transpose_inplace.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include tut_arithmetic_transpose_inplace.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude tut_arithmetic_transpose_inplace.out
|
||||
\verbinclude tut_arithmetic_transpose_inplace.out
|
||||
</td></tr></table>
|
||||
There is also the \link MatrixBase::adjointInPlace() adjointInPlace()\endlink function for complex matrices.
|
||||
|
||||
@ -125,11 +135,13 @@ two operators:
|
||||
\li binary operator * as in \c a*b
|
||||
\li compound operator *= as in \c a*=b (this multiplies on the right: \c a*=b is equivalent to <tt>a = a*b</tt>)
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include tut_arithmetic_matrix_mul.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include tut_arithmetic_matrix_mul.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude tut_arithmetic_matrix_mul.out
|
||||
\verbinclude tut_arithmetic_matrix_mul.out
|
||||
</td></tr></table>
|
||||
|
||||
Note: if you read the above paragraph on expression templates and are worried that doing \c m=m*m might cause
|
||||
@ -150,11 +162,13 @@ For more details on this topic, see \ref TopicEigenExpressionTemplates "this pag
|
||||
\section TutorialArithmeticDotAndCross Dot product and cross product
|
||||
|
||||
The above-discussed \c operator* cannot be used to compute dot and cross products directly. For that, you need the \link MatrixBase::dot() dot()\endlink and \link MatrixBase::cross() cross()\endlink methods.
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include tut_arithmetic_dot_cross.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include tut_arithmetic_dot_cross.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude tut_arithmetic_dot_cross.out
|
||||
\verbinclude tut_arithmetic_dot_cross.out
|
||||
</td></tr></table>
|
||||
|
||||
Remember that cross product is only for vectors of size 3. Dot product is for vectors of any sizes.
|
||||
@ -164,22 +178,26 @@ second variable.
|
||||
\section TutorialArithmeticRedux Basic arithmetic reduction operations
|
||||
Eigen also provides some reduction operations to reduce a given matrix or vector to a single value such as the sum (computed by \link DenseBase::sum() sum()\endlink), product (\link DenseBase::prod() prod()\endlink), or the maximum (\link DenseBase::maxCoeff() maxCoeff()\endlink) and minimum (\link DenseBase::minCoeff() minCoeff()\endlink) of all its coefficients.
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include tut_arithmetic_redux_basic.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include tut_arithmetic_redux_basic.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude tut_arithmetic_redux_basic.out
|
||||
\verbinclude tut_arithmetic_redux_basic.out
|
||||
</td></tr></table>
|
||||
|
||||
The \em trace of a matrix, as returned by the function \link MatrixBase::trace() trace()\endlink, is the sum of the diagonal coefficients and can also be computed as efficiently using <tt>a.diagonal().sum()</tt>, as we will see later on.
|
||||
|
||||
There also exist variants of the \c minCoeff and \c maxCoeff functions returning the coordinates of the respective coefficient via the arguments:
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include tut_arithmetic_redux_minmax.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include tut_arithmetic_redux_minmax.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude tut_arithmetic_redux_minmax.out
|
||||
\verbinclude tut_arithmetic_redux_minmax.out
|
||||
</td></tr></table>
|
||||
|
||||
|
||||
|
@ -41,33 +41,27 @@ We adopt that convention that typedefs of the form ArrayNt stand for 1-dimension
|
||||
the size and the scalar type, as in the Matrix typedefs explained on \ref TutorialMatrixClass "this page". For 2-dimensional arrays, we
|
||||
use typedefs of the form ArrayNNt. Some examples are shown in the following table:
|
||||
|
||||
<table class="tutorial_code" align="center">
|
||||
|
||||
<table class="manual">
|
||||
<tr>
|
||||
<td align="center">\b Type </td>
|
||||
<td align="center">\b Typedef </td>
|
||||
<th>Type </th>
|
||||
<th>Typedef </th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> \code Array<float,Dynamic,1> \endcode </td>
|
||||
<td> \code ArrayXf \endcode </td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> \code Array<float,3,1> \endcode </td>
|
||||
<td> \code Array3f \endcode </td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> \code Array<double,Dynamic,Dynamic> \endcode </td>
|
||||
<td> \code ArrayXXd \endcode </td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> \code Array<double,3,3> \endcode </td>
|
||||
<td> \code Array33d \endcode </td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
@ -76,11 +70,13 @@ use typedefs of the form ArrayNNt. Some examples are shown in the following tabl
|
||||
The parenthesis operator is overloaded to provide write and read access to the coefficients of an array, just as with matrices.
|
||||
Furthermore, the \c << operator can be used to initialize arrays (via the comma initializer) or to print them.
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include Tutorial_ArrayClass_accessors.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_ArrayClass_accessors.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude Tutorial_ArrayClass_accessors.out
|
||||
\verbinclude Tutorial_ArrayClass_accessors.out
|
||||
</td></tr></table>
|
||||
|
||||
For more information about the comma initializer, see \ref TutorialAdvancedInitialization.
|
||||
@ -94,11 +90,13 @@ The operation is valid if both arrays have the same size, and the addition or su
|
||||
Arrays also support expressions of the form <tt>array + scalar</tt> which add a scalar to each coefficient in the array.
|
||||
This provides a functionality that is not directly available for Matrix objects.
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include Tutorial_ArrayClass_addition.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_ArrayClass_addition.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude Tutorial_ArrayClass_addition.out
|
||||
\verbinclude Tutorial_ArrayClass_addition.out
|
||||
</td></tr></table>
|
||||
|
||||
|
||||
@ -109,11 +107,13 @@ are fundamentally different from matrices, is when you multiply two together. Ma
|
||||
multiplication as the matrix product and arrays interpret multiplication as the coefficient-wise product. Thus, two
|
||||
arrays can be multiplied if they have the same size.
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include Tutorial_ArrayClass_mult.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_ArrayClass_mult.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude Tutorial_ArrayClass_mult.out
|
||||
\verbinclude Tutorial_ArrayClass_mult.out
|
||||
</td></tr></table>
|
||||
|
||||
|
||||
@ -126,11 +126,13 @@ coefficients. If you have two arrays of the same size, you can call \link ArrayB
|
||||
construct the array whose coefficients are the minimum of the corresponding coefficients of the two given
|
||||
arrays. These operations are illustrated in the following example.
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include Tutorial_ArrayClass_cwise_other.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_ArrayClass_cwise_other.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude Tutorial_ArrayClass_cwise_other.out
|
||||
\verbinclude Tutorial_ArrayClass_cwise_other.out
|
||||
</td></tr></table>
|
||||
|
||||
More coefficient-wise operations can be found in the \ref QuickRefPage.
|
||||
@ -170,11 +172,12 @@ As a matter of fact, this usage case is so common that Eigen provides a \link Ma
|
||||
.cwiseProduct() \endlink method for matrices to compute the coefficient-wise product. This is also shown in
|
||||
the example program.
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_ArrayClass_interop_matrix.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output:
|
||||
\verbinclude Tutorial_ArrayClass_interop_matrix.out
|
||||
</td></tr></table>
|
||||
|
||||
@ -186,11 +189,12 @@ coefficient in the matrix \c m and then computes the matrix product of the resul
|
||||
expression <tt>(m.array() * n.array()).matrix() * m</tt> computes the coefficient-wise product of the matrices
|
||||
\c m and \c n and then the matrix product of the result with \c m.
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_ArrayClass_interop.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output:
|
||||
\verbinclude Tutorial_ArrayClass_interop.out
|
||||
</td></tr></table>
|
||||
|
||||
|
@ -23,10 +23,10 @@ provided that you let your compiler optimize.
|
||||
The most general block operation in Eigen is called \link DenseBase::block() .block() \endlink.
|
||||
There are two versions, whose syntax is as follows:
|
||||
|
||||
<table class="tutorial_code" align="center">
|
||||
<tr><td align="center">\b %Block \b operation</td>
|
||||
<td align="center">Version constructing a dynamic-size block expression</td>
|
||||
<td align="center">Version constructing a fixed-size block expression</td></tr>
|
||||
<table class="manual">
|
||||
<tr><th>\b %Block \b operation</td>
|
||||
<th>Version constructing a \n dynamic-size block expression</th>
|
||||
<th>Version constructing a \n fixed-size block expression</th></tr>
|
||||
<tr><td>%Block of size <tt>(p,q)</tt>, starting at <tt>(i,j)</tt></td>
|
||||
<td>\code
|
||||
matrix.block(i,j,p,q);\endcode </td>
|
||||
@ -45,11 +45,12 @@ but requires this size to be known at compile time.
|
||||
The following program uses the dynamic-size and fixed-size versions to print the values of several blocks inside a
|
||||
matrix.
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_BlockOperations_print_block.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output:
|
||||
\verbinclude Tutorial_BlockOperations_print_block.out
|
||||
</td></tr></table>
|
||||
|
||||
@ -58,11 +59,12 @@ it was only read from. However, blocks can also be used as \em lvalues, meaning
|
||||
|
||||
This is illustrated in the following example. This example also demonstrates blocks in arrays, which works exactly like the above-demonstrated blocks in matrices.
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_BlockOperations_block_assignment.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output:
|
||||
\verbinclude Tutorial_BlockOperations_block_assignment.out
|
||||
</td></tr></table>
|
||||
|
||||
@ -78,9 +80,9 @@ The rest of this page describes these specialized methods.
|
||||
Individual columns and rows are special cases of blocks. Eigen provides methods to easily address them:
|
||||
\link DenseBase::col() .col() \endlink and \link DenseBase::row() .row()\endlink.
|
||||
|
||||
<table class="tutorial_code" align="center">
|
||||
<tr><td align="center">\b %Block \b operation</td>
|
||||
<td align="center">Method</td>
|
||||
<table class="manual">
|
||||
<tr><th>%Block operation</th>
|
||||
<th>Method</th>
|
||||
<tr><td>i<sup>th</sup> row
|
||||
\link DenseBase::row() * \endlink</td>
|
||||
<td>\code
|
||||
@ -95,12 +97,12 @@ matrix.col(j);\endcode </td>
|
||||
|
||||
The argument for \p col() and \p row() is the index of the column or row to be accessed. As always in Eigen, indices start at 0.
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
C++ code:
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_BlockOperations_colrow.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output:
|
||||
\verbinclude Tutorial_BlockOperations_colrow.out
|
||||
</td></tr></table>
|
||||
|
||||
@ -115,10 +117,10 @@ to a block in the top-left corner of a matrix.
|
||||
|
||||
The different possibilities are summarized in the following table:
|
||||
|
||||
<table class="tutorial_code" align="center">
|
||||
<tr><td align="center">\b %Block \b operation</td>
|
||||
<td align="center">Version constructing a dynamic-size block expression</td>
|
||||
<td align="center">Version constructing a fixed-size block expression</td></tr>
|
||||
<table class="manual">
|
||||
<tr><th>%Block \b operation</td>
|
||||
<th>Version constructing a \n dynamic-size block expression</th>
|
||||
<th>Version constructing a \n fixed-size block expression</th></tr>
|
||||
<tr><td>Top-left p by q block \link DenseBase::topLeftCorner() * \endlink</td>
|
||||
<td>\code
|
||||
matrix.topLeftCorner(p,q);\endcode </td>
|
||||
@ -178,12 +180,12 @@ matrix.rightCols<q>();\endcode </td>
|
||||
|
||||
Here is a simple example illustrating the use of the operations presented above:
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
C++ code:
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_BlockOperations_corner.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output:
|
||||
\verbinclude Tutorial_BlockOperations_corner.out
|
||||
</td></tr></table>
|
||||
|
||||
@ -192,10 +194,10 @@ Output:
|
||||
|
||||
Eigen also provides a set of block operations designed specifically for the special case of vectors and one-dimensional arrays:
|
||||
|
||||
<table class="tutorial_code" align="center">
|
||||
<tr><td align="center">\b %Block \b operation</td>
|
||||
<td align="center">Version constructing a dynamic-size block expression</td>
|
||||
<td align="center">Version constructing a fixed-size block expression</td></tr>
|
||||
<table class="manual">
|
||||
<tr><th> %Block operation</th>
|
||||
<th>Version constructing a \n dynamic-size block expression</th>
|
||||
<th>Version constructing a \n fixed-size block expression</th></tr>
|
||||
<tr><td>%Block containing the first \p n elements
|
||||
\link DenseBase::head() * \endlink</td>
|
||||
<td>\code
|
||||
@ -221,12 +223,12 @@ vector.segment<n>(i);\endcode </td>
|
||||
|
||||
|
||||
An example is presented below:
|
||||
<table class="tutorial_code"><tr><td>
|
||||
C++ code:
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_BlockOperations_vector.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output:
|
||||
\verbinclude Tutorial_BlockOperations_vector.out
|
||||
</td></tr></table>
|
||||
|
||||
|
@ -23,31 +23,37 @@ vector or array. Simply list the coefficients, starting at the top-left corner a
|
||||
and from the top to the bottom. The size of the object needs to be specified beforehand. If you list too few
|
||||
or too many coefficients, Eigen will complain.
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include Tutorial_commainit_01.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_commainit_01.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude Tutorial_commainit_01.out
|
||||
\verbinclude Tutorial_commainit_01.out
|
||||
</td></tr></table>
|
||||
|
||||
The comma initializer can also be used to fill block expressions such as <tt>m.row(i)</tt>. Here is a more
|
||||
complicated way to get the same result as above:
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include Tutorial_commainit_01b.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_commainit_01b.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude Tutorial_commainit_01b.out
|
||||
\verbinclude Tutorial_commainit_01b.out
|
||||
</td></tr></table>
|
||||
|
||||
Moreover, the elements of the initialization list may themselves be matrices. Thus, we can use them to
|
||||
initialize matrices with a block structure.
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include Tutorial_AdvancedInitialization_Block.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_AdvancedInitialization_Block.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude Tutorial_AdvancedInitialization_Block.out
|
||||
\verbinclude Tutorial_AdvancedInitialization_Block.out
|
||||
</td></tr></table>
|
||||
|
||||
|
||||
@ -60,11 +66,13 @@ to specify the size. Thus, the second variant requires one argument and can be u
|
||||
dynamic-size objects, while the third variant requires two arguments and can be used for two-dimensional
|
||||
objects. All three variants are illustrated in the following example:
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include Tutorial_AdvancedInitialization_Zero.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_AdvancedInitialization_Zero.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude Tutorial_AdvancedInitialization_Zero.out
|
||||
\verbinclude Tutorial_AdvancedInitialization_Zero.out
|
||||
</td></tr></table>
|
||||
|
||||
Similarly, the static method \link DenseBase::Constant() Constant\endlink(value) sets all coefficients to \c value.
|
||||
@ -78,11 +86,13 @@ one-dimensional arrays; it yields a vector of the specified size whose coefficie
|
||||
\c low and \c high. The method \c LinSpaced() is illustrated in the following example, which prints a table
|
||||
with angles in degrees, the corresponding angle in radians, and their sine and cosine.
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include Tutorial_AdvancedInitialization_LinSpaced.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_AdvancedInitialization_LinSpaced.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude Tutorial_AdvancedInitialization_LinSpaced.out
|
||||
\verbinclude Tutorial_AdvancedInitialization_LinSpaced.out
|
||||
</td></tr></table>
|
||||
|
||||
This example shows that objects like the ones returned by LinSpaced() can be assigned to variables (and
|
||||
@ -92,11 +102,13 @@ conveniently. The following example contrasts three ways to construct the matrix
|
||||
\f$ J = \bigl[ \begin{smallmatrix} O & I \\ I & O \end{smallmatrix} \bigr] \f$: using static methods and
|
||||
assignment, using static methods and the comma-initializer, or using the setXxx() methods.
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include Tutorial_AdvancedInitialization_ThreeWays.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_AdvancedInitialization_ThreeWays.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude Tutorial_AdvancedInitialization_ThreeWays.out
|
||||
\verbinclude Tutorial_AdvancedInitialization_ThreeWays.out
|
||||
</td></tr></table>
|
||||
|
||||
A summary of all pre-defined matrix, vector and array objects can be found in the \ref QuickRefPage.
|
||||
@ -112,11 +124,13 @@ evaluate to a matrix or array when needed, so that this syntax does not incur an
|
||||
These expressions can also be used as a temporary object. The second example in
|
||||
the \ref GettingStarted guide, which we reproduce here, already illustrates this.
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include QuickStart_example2_dynamic.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include QuickStart_example2_dynamic.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude QuickStart_example2_dynamic.out
|
||||
\verbinclude QuickStart_example2_dynamic.out
|
||||
</td></tr></table>
|
||||
|
||||
The expression <tt>m + MatrixXf::Constant(3,3,1.2)</tt> constructs the 3-by-3 matrix expression with all its coefficients
|
||||
@ -126,11 +140,13 @@ The comma-initializer, too, can also be used to construct temporary objects. The
|
||||
matrix of size 2-by-3, and then multiplies this matrix on the left with
|
||||
\f$ \bigl[ \begin{smallmatrix} 0 & 1 \\ 1 & 0 \end{smallmatrix} \bigr] \f$.
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include Tutorial_AdvancedInitialization_CommaTemporary.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_AdvancedInitialization_CommaTemporary.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude Tutorial_AdvancedInitialization_CommaTemporary.out
|
||||
\verbinclude Tutorial_AdvancedInitialization_CommaTemporary.out
|
||||
</td></tr></table>
|
||||
|
||||
The \link CommaInitializer::finished() finished() \endlink method is necessary here to get the actual matrix
|
||||
|
@ -29,10 +29,11 @@ Where \a A and \a b are matrices (\a b could be a vector, as a special case). Yo
|
||||
\b The \b solution: You can choose between various decompositions, depending on what your matrix \a A looks like,
|
||||
and depending on whether you favor speed or accuracy. However, let's start with an example that works in all cases,
|
||||
and is a good compromise:
|
||||
<table class="tutorial_code">
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr>
|
||||
<td>\include TutorialLinAlgExSolveColPivHouseholderQR.cpp </td>
|
||||
<td>output: \verbinclude TutorialLinAlgExSolveColPivHouseholderQR.out </td>
|
||||
<td>\verbinclude TutorialLinAlgExSolveColPivHouseholderQR.out </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -47,16 +48,14 @@ Here, ColPivHouseholderQR is a QR decomposition with column pivoting. It's a goo
|
||||
works for all matrices while being quite fast. Here is a table of some other decompositions that you can choose from,
|
||||
depending on your matrix and the trade-off you want to make:
|
||||
|
||||
<table border="1">
|
||||
|
||||
<table class="manual">
|
||||
<tr>
|
||||
<td>Decomposition</td>
|
||||
<td>Method</td>
|
||||
<td>Requirements on the matrix</td>
|
||||
<td>Speed</td>
|
||||
<td>Accuracy</td>
|
||||
<th>Decomposition</th>
|
||||
<th>Method</th>
|
||||
<th>Requirements on the matrix</th>
|
||||
<th>Speed</th>
|
||||
<th>Accuracy</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>PartialPivLU</td>
|
||||
<td>partialPivLu()</td>
|
||||
@ -64,15 +63,13 @@ depending on your matrix and the trade-off you want to make:
|
||||
<td>++</td>
|
||||
<td>+</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<tr class="alt">
|
||||
<td>FullPivLU</td>
|
||||
<td>fullPivLu()</td>
|
||||
<td>None</td>
|
||||
<td>-</td>
|
||||
<td>+++</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>HouseholderQR</td>
|
||||
<td>householderQr()</td>
|
||||
@ -80,15 +77,13 @@ depending on your matrix and the trade-off you want to make:
|
||||
<td>++</td>
|
||||
<td>+</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<tr class="alt">
|
||||
<td>ColPivHouseholderQR</td>
|
||||
<td>colPivHouseholderQr()</td>
|
||||
<td>None</td>
|
||||
<td>+</td>
|
||||
<td>++</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>FullPivHouseholderQR</td>
|
||||
<td>fullPivHouseholderQr()</td>
|
||||
@ -96,15 +91,13 @@ depending on your matrix and the trade-off you want to make:
|
||||
<td>-</td>
|
||||
<td>+++</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<tr class="alt">
|
||||
<td>LLT</td>
|
||||
<td>llt()</td>
|
||||
<td>Positive definite</td>
|
||||
<td>+++</td>
|
||||
<td>+</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>LDLT</td>
|
||||
<td>ldlt()</td>
|
||||
@ -112,7 +105,6 @@ depending on your matrix and the trade-off you want to make:
|
||||
<td>+++</td>
|
||||
<td>++</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
All of these decompositions offer a solve() method that works as in the above example.
|
||||
@ -121,10 +113,11 @@ For example, if your matrix is positive definite, the above table says that a ve
|
||||
choice is then the LDLT decomposition. Here's an example, also demonstrating that using a general
|
||||
matrix (not a vector) as right hand side is possible.
|
||||
|
||||
<table class="tutorial_code">
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr>
|
||||
<td>\include TutorialLinAlgExSolveLDLT.cpp </td>
|
||||
<td>output: \verbinclude TutorialLinAlgExSolveLDLT.out </td>
|
||||
<td>\verbinclude TutorialLinAlgExSolveLDLT.out </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -137,10 +130,11 @@ supports many other decompositions), see our special page on
|
||||
Only you know what error margin you want to allow for a solution to be considered valid.
|
||||
So Eigen lets you do this computation for yourself, if you want to, as in this example:
|
||||
|
||||
<table class="tutorial_code">
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr>
|
||||
<td>\include TutorialLinAlgExComputeSolveError.cpp </td>
|
||||
<td>output: \verbinclude TutorialLinAlgExComputeSolveError.out </td>
|
||||
<td>\verbinclude TutorialLinAlgExComputeSolveError.out </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -150,10 +144,11 @@ You need an eigendecomposition here, see available such decompositions on \ref T
|
||||
Make sure to check if your matrix is self-adjoint, as is often the case in these problems. Here's an example using
|
||||
SelfAdjointEigenSolver, it could easily be adapted to general matrices using EigenSolver or ComplexEigenSolver.
|
||||
|
||||
<table class="tutorial_code">
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr>
|
||||
<td>\include TutorialLinAlgSelfAdjointEigenSolver.cpp </td>
|
||||
<td>output: \verbinclude TutorialLinAlgSelfAdjointEigenSolver.out </td>
|
||||
<td>\verbinclude TutorialLinAlgSelfAdjointEigenSolver.out </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -171,10 +166,11 @@ call inverse() and determinant() directly on a matrix. If your matrix is of a ve
|
||||
allows Eigen to avoid performing a LU decomposition, and instead use formulas that are more efficient on such small matrices.
|
||||
|
||||
Here is an example:
|
||||
<table class="tutorial_code">
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr>
|
||||
<td>\include TutorialLinAlgInverseDeterminant.cpp </td>
|
||||
<td>output: \verbinclude TutorialLinAlgInverseDeterminant.out </td>
|
||||
<td>\verbinclude TutorialLinAlgInverseDeterminant.out </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -184,10 +180,11 @@ The best way to do least squares solving is with a SVD decomposition. Eigen prov
|
||||
is doing least-squares solving.
|
||||
|
||||
Here is an example:
|
||||
<table class="tutorial_code">
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr>
|
||||
<td>\include TutorialLinAlgSVDSolve.cpp </td>
|
||||
<td>output: \verbinclude TutorialLinAlgSVDSolve.out </td>
|
||||
<td>\verbinclude TutorialLinAlgSVDSolve.out </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -209,10 +206,11 @@ What makes this possible is that:
|
||||
|
||||
For example:
|
||||
|
||||
<table class="tutorial_code">
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr>
|
||||
<td>\include TutorialLinAlgComputeTwice.cpp </td>
|
||||
<td>output: \verbinclude TutorialLinAlgComputeTwice.out </td>
|
||||
<td>\verbinclude TutorialLinAlgComputeTwice.out </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -237,10 +235,11 @@ Rank-revealing decompositions offer at least a rank() method. They can also offe
|
||||
and some are also providing methods to compute the kernel (null-space) and image (column-space) of the matrix, as is the
|
||||
case with FullPivLU:
|
||||
|
||||
<table class="tutorial_code">
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr>
|
||||
<td>\include TutorialLinAlgRankRevealing.cpp </td>
|
||||
<td>output: \verbinclude TutorialLinAlgRankRevealing.out </td>
|
||||
<td>\verbinclude TutorialLinAlgRankRevealing.out </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -252,10 +251,11 @@ on your decomposition object before calling rank() or any other method that need
|
||||
The decomposition itself, i.e. the compute() method, is independent of the threshold. You don't need to recompute the
|
||||
decomposition after you've changed the threshold.
|
||||
|
||||
<table class="tutorial_code">
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr>
|
||||
<td>\include TutorialLinAlgSetThreshold.cpp </td>
|
||||
<td>output: \verbinclude TutorialLinAlgSetThreshold.out </td>
|
||||
<td>\verbinclude TutorialLinAlgSetThreshold.out </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
@ -13,7 +13,7 @@ This tutorial explains Eigen's reductions, visitors and broadcasting and how the
|
||||
- \ref TutorialReductionsVisitorsBroadcastingReductions
|
||||
- \ref TutorialReductionsVisitorsBroadcastingReductionsNorm
|
||||
- \ref TutorialReductionsVisitorsBroadcastingReductionsBool
|
||||
- FIXME: .redux()
|
||||
- \ref TutorialReductionsVisitorsBroadcastingReductionsUserdefined
|
||||
- \ref TutorialReductionsVisitorsBroadcastingVisitors
|
||||
- \ref TutorialReductionsVisitorsBroadcastingPartialReductions
|
||||
- \ref TutorialReductionsVisitorsBroadcastingPartialReductionsCombined
|
||||
@ -26,11 +26,13 @@ In Eigen, a reduction is a function taking a matrix or array, and returning a si
|
||||
scalar value. One of the most used reductions is \link DenseBase::sum() .sum() \endlink,
|
||||
returning the sum of all the coefficients inside a given matrix or array.
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include tut_arithmetic_redux_basic.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include tut_arithmetic_redux_basic.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output: \verbinclude tut_arithmetic_redux_basic.out
|
||||
\verbinclude tut_arithmetic_redux_basic.out
|
||||
</td></tr></table>
|
||||
|
||||
The \em trace of a matrix, as returned by the function \c trace(), is the sum of the diagonal coefficients and can equivalently be computed <tt>a.diagonal().sum()</tt>.
|
||||
@ -48,11 +50,12 @@ If you want other \f$\ell^p\f$ norms, use the \link MatrixBase::lpNorm() lpNnorm
|
||||
|
||||
The following example demonstrates these methods.
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include Tutorial_ReductionsVisitorsBroadcasting_reductions_norm.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_ReductionsVisitorsBroadcasting_reductions_norm.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output:
|
||||
\verbinclude Tutorial_ReductionsVisitorsBroadcasting_reductions_norm.out
|
||||
</td></tr></table>
|
||||
|
||||
@ -65,14 +68,20 @@ The following reductions operate on boolean values:
|
||||
|
||||
These are typically used in conjunction with the coefficient-wise comparison and equality operators provided by Array. For instance, <tt>array > 0</tt> is an %Array of the same size as \c array , with \b true at those positions where the corresponding coefficient of \c array is positive. Thus, <tt>(array > 0).all()</tt> tests whether all coefficients of \c array are positive. This can be seen in the following example:
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output:
|
||||
\verbinclude Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.out
|
||||
</td></tr></table>
|
||||
|
||||
\subsection TutorialReductionsVisitorsBroadcastingReductionsUserdefined User defined reductions
|
||||
|
||||
TODO
|
||||
|
||||
In the meantime you can have a look at the DenseBase::redux() function.
|
||||
|
||||
\section TutorialReductionsVisitorsBroadcastingVisitors Visitors
|
||||
Visitors are useful when one wants to obtain the location of a coefficient inside
|
||||
@ -86,11 +95,12 @@ The arguments passed to a visitor are pointers to the variables where the
|
||||
row and column position are to be stored. These variables should be of type
|
||||
\link DenseBase::Index Index \endlink (FIXME: link ok?), as shown below:
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include Tutorial_ReductionsVisitorsBroadcasting_visitors.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_ReductionsVisitorsBroadcasting_visitors.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output:
|
||||
\verbinclude Tutorial_ReductionsVisitorsBroadcasting_visitors.out
|
||||
</td></tr></table>
|
||||
|
||||
@ -106,21 +116,23 @@ with \link DenseBase::colwise() colwise() \endlink or \link DenseBase::rowwise()
|
||||
A simple example is obtaining the maximum of the elements
|
||||
in each column in a given matrix, storing the result in a row-vector:
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include Tutorial_ReductionsVisitorsBroadcasting_colwise.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_ReductionsVisitorsBroadcasting_colwise.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output:
|
||||
\verbinclude Tutorial_ReductionsVisitorsBroadcasting_colwise.out
|
||||
</td></tr></table>
|
||||
|
||||
The same operation can be performed row-wise:
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include Tutorial_ReductionsVisitorsBroadcasting_rowwise.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_ReductionsVisitorsBroadcasting_rowwise.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output:
|
||||
\verbinclude Tutorial_ReductionsVisitorsBroadcasting_rowwise.out
|
||||
</td></tr></table>
|
||||
|
||||
@ -132,11 +144,12 @@ It is also possible to use the result of a partial reduction to do further proce
|
||||
Here is another example that aims to find the column whose sum of elements is the maximum
|
||||
within a matrix. With column-wise partial reductions this can be coded as:
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include Tutorial_ReductionsVisitorsBroadcasting_maxnorm.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_ReductionsVisitorsBroadcasting_maxnorm.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output:
|
||||
\verbinclude Tutorial_ReductionsVisitorsBroadcasting_maxnorm.out
|
||||
</td></tr></table>
|
||||
|
||||
@ -169,11 +182,12 @@ one direction.
|
||||
A simple example is to add a certain column-vector to each column in a matrix.
|
||||
This can be accomplished with:
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output:
|
||||
\verbinclude Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple.out
|
||||
</td></tr></table>
|
||||
|
||||
@ -184,11 +198,12 @@ The same applies for the Array class, where the equivalent for VectorXf is Array
|
||||
|
||||
Therefore, to perform the same operation row-wise we can do:
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple_rowwise.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple_rowwise.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output:
|
||||
\verbinclude Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple_rowwise.out
|
||||
</td></tr></table>
|
||||
|
||||
@ -200,11 +215,12 @@ Now that broadcasting, reductions and partial reductions have been introduced, w
|
||||
the nearest neighbour of a vector <tt>v</tt> within the columns of matrix <tt>m</tt>. The Euclidean distance will be used in this example,
|
||||
computing the squared Euclidean distance with the partial reduction named \link MatrixBase::squaredNorm() squaredNorm() \endlink:
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include Tutorial_ReductionsVisitorsBroadcasting_broadcast_1nn.cpp
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr><td>
|
||||
\include Tutorial_ReductionsVisitorsBroadcasting_broadcast_1nn.cpp
|
||||
</td>
|
||||
<td>
|
||||
Output:
|
||||
\verbinclude Tutorial_ReductionsVisitorsBroadcasting_broadcast_1nn.out
|
||||
</td></tr></table>
|
||||
|
||||
|
@ -38,18 +38,18 @@ But note that unfortunately, because of how C++ works, you can \b not do this:
|
||||
|
||||
\section TutorialGeoElementaryTransformations Transformation types
|
||||
|
||||
<table class="tutorial_code">
|
||||
<tr><td>Transformation type</td><td>Typical initialization code</td></tr>
|
||||
<table class="manual">
|
||||
<tr><th>Transformation type</th><th>Typical initialization code</th></tr>
|
||||
<tr><td>
|
||||
\ref Rotation2D "2D rotation" from an angle</td><td>\code
|
||||
Rotation2D<float> rot2(angle_in_radian);\endcode</td></tr>
|
||||
<tr><td>
|
||||
<tr class="alt"><td>
|
||||
3D rotation as an \ref AngleAxis "angle + axis"</td><td>\code
|
||||
AngleAxis<float> aa(angle_in_radian, Vector3f(ax,ay,az));\endcode</td></tr>
|
||||
<tr><td>
|
||||
3D rotation as a \ref Quaternion "quaternion"</td><td>\code
|
||||
Quaternion<float> q = AngleAxis<float>(angle_in_radian, axis);\endcode</td></tr>
|
||||
<tr><td>
|
||||
<tr class="alt"><td>
|
||||
N-D Scaling</td><td>\code
|
||||
Scaling<float,2>(sx, sy)
|
||||
Scaling<float,3>(sx, sy, sz)
|
||||
@ -61,7 +61,7 @@ Translation<float,2>(tx, ty)
|
||||
Translation<float,3>(tx, ty, tz)
|
||||
Translation<float,N>(s)
|
||||
Translation<float,N>(vecN)\endcode</td></tr>
|
||||
<tr><td>
|
||||
<tr class="alt"><td>
|
||||
N-D \ref TutorialGeoTransform "Affine transformation"</td><td>\code
|
||||
Transform<float,N,Affine> t = concatenation_of_any_transformations;
|
||||
Transform<float,3,Affine> t = Translation3f(p) * AngleAxisf(a,axis) * Scaling3f(s);\endcode</td></tr>
|
||||
@ -86,7 +86,7 @@ kind of transformations.
|
||||
|
||||
Any of the above transformation types can be converted to any other types of the same nature,
|
||||
or to a more generic type. Here are some additional examples:
|
||||
<table class="tutorial_code">
|
||||
<table class="manual">
|
||||
<tr><td>\code
|
||||
Rotation2Df r = Matrix2f(..); // assumes a pure rotation matrix
|
||||
AngleAxisf aa = Quaternionf(..);
|
||||
@ -103,15 +103,15 @@ Affine3f m = Translation3f(..); Affine3f m = Matrix3f(..);
|
||||
|
||||
To some extent, Eigen's \ref Geometry_Module "geometry module" allows you to write
|
||||
generic algorithms working on any kind of transformation representations:
|
||||
<table class="tutorial_code">
|
||||
<table class="manual">
|
||||
<tr><td>
|
||||
Concatenation of two transformations</td><td>\code
|
||||
gen1 * gen2;\endcode</td></tr>
|
||||
<tr><td>Apply the transformation to a vector</td><td>\code
|
||||
<tr class="alt"><td>Apply the transformation to a vector</td><td>\code
|
||||
vec2 = gen1 * vec1;\endcode</td></tr>
|
||||
<tr><td>Get the inverse of the transformation</td><td>\code
|
||||
gen2 = gen1.inverse();\endcode</td></tr>
|
||||
<tr><td>Spherical interpolation \n (Rotation2D and Quaternion only)</td><td>\code
|
||||
<tr class="alt"><td>Spherical interpolation \n (Rotation2D and Quaternion only)</td><td>\code
|
||||
rot3 = rot1.slerp(alpha,rot2);\endcode</td></tr>
|
||||
</table>
|
||||
|
||||
@ -123,12 +123,12 @@ is a (Dim+1)^2 matrix. In Eigen we have chosen to not distinghish between points
|
||||
vectors such that all points are actually represented by displacement vectors from the
|
||||
origin ( \f$ \mathbf{p} \equiv \mathbf{p}-0 \f$ ). With that in mind, real points and
|
||||
vector distinguish when the transformation is applied.
|
||||
<table class="tutorial_code">
|
||||
<table class="manual">
|
||||
<tr><td>
|
||||
Apply the transformation to a \b point </td><td>\code
|
||||
VectorNf p1, p2;
|
||||
p2 = t * p1;\endcode</td></tr>
|
||||
<tr><td>
|
||||
<tr class="alt"><td>
|
||||
Apply the transformation to a \b vector </td><td>\code
|
||||
VectorNf vec1, vec2;
|
||||
vec2 = t.linear() * vec1;\endcode</td></tr>
|
||||
@ -138,14 +138,14 @@ Apply a \em general transformation \n to a \b normal \b vector
|
||||
VectorNf n1, n2;
|
||||
MatrixNf normalMatrix = t.linear().inverse().transpose();
|
||||
n2 = (normalMatrix * n1).normalized();\endcode</td></tr>
|
||||
<tr><td>
|
||||
<tr class="alt"><td>
|
||||
Apply a transformation with \em pure \em rotation \n to a \b normal \b vector
|
||||
(no scaling, no shear)</td><td>\code
|
||||
n2 = t.linear() * n1;\endcode</td></tr>
|
||||
<tr><td>
|
||||
OpenGL compatibility \b 3D </td><td>\code
|
||||
glLoadMatrixf(t.data());\endcode</td></tr>
|
||||
<tr><td>
|
||||
<tr class="alt"><td>
|
||||
OpenGL compatibility \b 2D </td><td>\code
|
||||
Affine3f aux(Affine3f::Identity);
|
||||
aux.linear().topLeftCorner<2,2>() = t.linear();
|
||||
@ -153,14 +153,14 @@ aux.translation().start<2>() = t.translation();
|
||||
glLoadMatrixf(aux.data());\endcode</td></tr>
|
||||
</table>
|
||||
|
||||
\b Component \b accessors</td></tr>
|
||||
<table class="tutorial_code">
|
||||
\b Component \b accessors
|
||||
<table class="manual">
|
||||
<tr><td>
|
||||
full read-write access to the internal matrix</td><td>\code
|
||||
t.matrix() = matN1xN1; // N1 means N+1
|
||||
matN1xN1 = t.matrix();
|
||||
\endcode</td></tr>
|
||||
<tr><td>
|
||||
<tr class="alt"><td>
|
||||
coefficient accessors</td><td>\code
|
||||
t(i,j) = scalar; <=> t.matrix()(i,j) = scalar;
|
||||
scalar = t(i,j); <=> scalar = t.matrix()(i,j);
|
||||
@ -170,7 +170,7 @@ translation part</td><td>\code
|
||||
t.translation() = vecN;
|
||||
vecN = t.translation();
|
||||
\endcode</td></tr>
|
||||
<tr><td>
|
||||
<tr class="alt"><td>
|
||||
linear part</td><td>\code
|
||||
t.linear() = matNxN;
|
||||
matNxN = t.linear();
|
||||
@ -185,8 +185,8 @@ matNxN = t.extractRotation();
|
||||
\b Transformation \b creation \n
|
||||
While transformation objects can be created and updated concatenating elementary transformations,
|
||||
the Transform class also features a procedural API:
|
||||
<table class="tutorial_code">
|
||||
<tr><td></td><td>\b procedurale \b API </td><td>\b equivalent \b natural \b API </td></tr>
|
||||
<table class="manual">
|
||||
<tr><th></th><th>procedurale API</th><th>equivalent natural API </th></tr>
|
||||
<tr><td>Translation</td><td>\code
|
||||
t.translate(Vector_(tx,ty,..));
|
||||
t.pretranslate(Vector_(tx,ty,..));
|
||||
@ -194,7 +194,7 @@ t.pretranslate(Vector_(tx,ty,..));
|
||||
t *= Translation_(tx,ty,..);
|
||||
t = Translation_(tx,ty,..) * t;
|
||||
\endcode</td></tr>
|
||||
<tr><td>\b Rotation \n <em class="note">In 2D and for the procedural API, any_rotation can also \n be an angle in radian</em></td><td>\code
|
||||
<tr class="alt"><td>\b Rotation \n <em class="note">In 2D and for the procedural API, any_rotation can also \n be an angle in radian</em></td><td>\code
|
||||
t.rotate(any_rotation);
|
||||
t.prerotate(any_rotation);
|
||||
\endcode</td><td>\code
|
||||
@ -212,14 +212,14 @@ t *= Scaling_(s);
|
||||
t = Scaling_(sx,sy,..) * t;
|
||||
t = Scaling_(s) * t;
|
||||
\endcode</td></tr>
|
||||
<tr><td>Shear transformation \n ( \b 2D \b only ! )</td><td>\code
|
||||
<tr class="alt"><td>Shear transformation \n ( \b 2D \b only ! )</td><td>\code
|
||||
t.shear(sx,sy);
|
||||
t.preshear(sx,sy);
|
||||
\endcode</td><td></td></tr>
|
||||
</table>
|
||||
|
||||
Note that in both API, any many transformations can be concatenated in a single expression as shown in the two following equivalent examples:
|
||||
<table class="tutorial_code">
|
||||
<table class="manual">
|
||||
<tr><td>\code
|
||||
t.pretranslate(..).rotate(..).translate(..).scale(..);
|
||||
\endcode</td></tr>
|
||||
@ -231,7 +231,7 @@ t = Translation_(..) * t * RotationType(..) * Translation_(..) * Scaling_(..);
|
||||
|
||||
|
||||
<a href="#" class="top">top</a>\section TutorialGeoEulerAngles Euler angles
|
||||
<table class="tutorial_code">
|
||||
<table class="manual">
|
||||
<tr><td style="max-width:30em;">
|
||||
Euler angles might be convenient to create rotation objects.
|
||||
On the other hand, since there exist 24 differents convension,they are pretty confusing to use. This example shows how
|
||||
|
@ -40,7 +40,7 @@ Note that here the size of a vector denotes its dimension and not the number of
|
||||
In order to get the best of the Eigen's sparse objects, it is important to have a rough idea of the way they are internally stored. The SparseMatrix class implements the common and generic Compressed Column/Row Storage scheme. It consists of three compact arrays storing the values with their respective inner coordinates, and pointer indices to the begining of each outer vector. For instance, let \c m be a column-major sparse matrix. Then its nonzero coefficients are sequentially stored in memory in a column-major order (\em values). A second array of integer stores the respective row index of each coefficient (\em inner \em indices). Finally, a third array of integer, having the same length than the number of columns, stores the index in the previous arrays of the first element of each column (\em outer \em indices).
|
||||
|
||||
Here is an example, with the matrix:
|
||||
<table>
|
||||
<table class="manual">
|
||||
<tr><td>0</td><td>3</td><td>0</td><td>0</td><td>0</td></tr>
|
||||
<tr><td>22</td><td>0</td><td>0</td><td>0</td><td>17</td></tr>
|
||||
<tr><td>7</td><td>5</td><td>0</td><td>1</td><td>0</td></tr>
|
||||
@ -49,11 +49,11 @@ Here is an example, with the matrix:
|
||||
</table>
|
||||
|
||||
and its internal representation using the Compressed Column Storage format:
|
||||
<table>
|
||||
<table class="manual">
|
||||
<tr><td>Values:</td> <td>22</td><td>7</td><td>3</td><td>5</td><td>14</td><td>1</td><td>17</td><td>8</td></tr>
|
||||
<tr><td>Inner indices:</td> <td> 1</td><td>2</td><td>0</td><td>2</td><td> 4</td><td>2</td><td> 1</td><td>4</td></tr>
|
||||
</table>
|
||||
Outer indices:<table><tr><td>0</td><td>2</td><td>4</td><td>5</td><td>6</td><td>\em 7 </td></tr></table>
|
||||
Outer indices:<table class="manual"><tr><td>0</td><td>2</td><td>4</td><td>5</td><td>6</td><td>\em 7 </td></tr></table>
|
||||
|
||||
As you can guess, here the storage order is even more important than with dense matrix. We will therefore often make a clear difference between the \em inner and \em outer dimensions. For instance, it is easy to loop over the coefficients of an \em inner \em vector (e.g., a column of a column-major matrix), but completely inefficient to do the same for an \em outer \em vector (e.g., a row of a col-major matrix).
|
||||
|
||||
@ -63,7 +63,7 @@ Since all nonzero coefficients of such a matrix are sequentially stored in memor
|
||||
|
||||
To summarize, it is recommanded to use a SparseMatrix whenever this is possible, and reserve the use of DynamicSparseMatrix for matrix assembly purpose when a SparseMatrix is not flexible enough. The respective pro/cons of both representations are summarized in the following table:
|
||||
|
||||
<table>
|
||||
<table class="manual">
|
||||
<tr><td></td> <td>SparseMatrix</td><td>DynamicSparseMatrix</td></tr>
|
||||
<tr><td>memory usage</td><td>***</td><td>**</td></tr>
|
||||
<tr><td>sorted insertion</td><td>***</td><td>***</td></tr>
|
||||
@ -84,7 +84,7 @@ To summarize, it is recommanded to use a SparseMatrix whenever this is possible,
|
||||
|
||||
Here mat and vec represents any sparse-matrix and sparse-vector types respectively.
|
||||
|
||||
<table>
|
||||
<table class="manual">
|
||||
<tr><td>Standard \n dimensions</td><td>\code
|
||||
mat.rows()
|
||||
mat.cols()\endcode</td>
|
||||
@ -106,7 +106,7 @@ vec.nonZeros() \endcode</td></tr>
|
||||
\b Iterating \b over \b the \b nonzero \b coefficients \n
|
||||
|
||||
Iterating over the coefficients of a sparse matrix can be done only in the same order than the storage order. Here is an example:
|
||||
<table>
|
||||
<table class="manual">
|
||||
<tr><td>
|
||||
\code
|
||||
SparseMatrixType mat(rows,cols);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Aug 24 23:40:21 2008 for Eigen by
|
||||
<a href="http://www.doxygen.org/index.html">
|
||||
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
||||
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
<a href="http://www.doxygen.org/index.html"><img class="footer" src="$relpath$doxygen.png" alt="doxygen"/></a></small></address>
|
||||
</body>
|
||||
</html>
|
@ -1,10 +1,15 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<title>$title</title>
|
||||
<link href="eigendoxy.css" rel="stylesheet" type="text/css">
|
||||
<link href="eigendoxy_tabs.css" rel="stylesheet" type="text/css">
|
||||
</head><body>
|
||||
<link href="$relpath$eigendoxy_tabs.css" rel="stylesheet" type="text/css">
|
||||
<link href="$relpath$search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javaScript" src="$relpath$search/search.js"></script>
|
||||
<link href="$relpath$eigendoxy.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body onload='searchBox.OnSelectItem(0);'>
|
||||
<a name="top"></a>
|
||||
<a class="logo" href="http://eigen.tuxfamily.org/">
|
||||
<img src="Eigen_Silly_Professor_64x64.png" width=64 height=64 alt="Eigen's silly professor"
|
||||
style="position:absolute; border:none" /></a>
|
||||
style="position:absolute; border:none; right:10px; top:10px" /></a>
|
||||
|
@ -1,101 +1,59 @@
|
||||
/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */
|
||||
|
||||
DIV.tabs
|
||||
{
|
||||
float: left;
|
||||
width:100%;
|
||||
background : url("tab_b.gif") repeat-x bottom;
|
||||
.tabs, .tabs2, .tabs3 {
|
||||
background-image: url('tab_b.png');
|
||||
width: 100%;
|
||||
z-index: 101;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
DIV.tabs UL
|
||||
{
|
||||
margin : 0px;
|
||||
padding-left : 10px;
|
||||
list-style : none;
|
||||
.tabs2 {
|
||||
font-size: 10px;
|
||||
}
|
||||
.tabs3 {
|
||||
font-size: 9px;
|
||||
}
|
||||
|
||||
DIV.tabs LI, DIV.tabs FORM
|
||||
{
|
||||
display : inline;
|
||||
margin : 0px;
|
||||
padding : 0px;
|
||||
.tablist {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: table;
|
||||
}
|
||||
|
||||
DIV.tabs FORM
|
||||
{
|
||||
float : right;
|
||||
.tablist li {
|
||||
float: left;
|
||||
display: table-cell;
|
||||
background-image: url('tab_b.png');
|
||||
line-height: 36px;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
DIV.tabs A
|
||||
{
|
||||
float : left;
|
||||
background : url("tab_r.gif") no-repeat right top;
|
||||
border-bottom : 1px solid #84B0C7;
|
||||
font-size : x-small;
|
||||
font-weight : bold;
|
||||
text-decoration : none;
|
||||
.tablist a {
|
||||
display: block;
|
||||
padding: 0 20px;
|
||||
font-weight: bold;
|
||||
background-image:url('tab_s.png');
|
||||
background-repeat:no-repeat;
|
||||
background-position:right;
|
||||
color: #283A5D;
|
||||
text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
|
||||
text-decoration: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
DIV.tabs A:hover
|
||||
{
|
||||
background-position: 100% -150px;
|
||||
.tabs3 .tablist a {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
DIV.tabs A:link, DIV.tabs A:visited,
|
||||
DIV.tabs A:active, DIV.tabs A:hover
|
||||
{
|
||||
color: #1A419D;
|
||||
.tablist a:hover {
|
||||
background-image: url('tab_h.png');
|
||||
background-repeat:repeat-x;
|
||||
color: #fff;
|
||||
text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
DIV.tabs SPAN
|
||||
{
|
||||
float : left;
|
||||
display : block;
|
||||
background : url("tab_l.gif") no-repeat left top;
|
||||
padding : 5px 9px;
|
||||
white-space : nowrap;
|
||||
}
|
||||
|
||||
DIV.tabs INPUT
|
||||
{
|
||||
float : right;
|
||||
display : inline;
|
||||
font-size : 1em;
|
||||
}
|
||||
|
||||
DIV.tabs TD
|
||||
{
|
||||
font-size : x-small;
|
||||
font-weight : bold;
|
||||
text-decoration : none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Commented Backslash Hack hides rule from IE5-Mac \*/
|
||||
DIV.tabs SPAN {float : none;}
|
||||
/* End IE5-Mac hack */
|
||||
|
||||
DIV.tabs A:hover SPAN
|
||||
{
|
||||
background-position: 0% -150px;
|
||||
}
|
||||
|
||||
DIV.tabs LI.current A
|
||||
{
|
||||
background-position: 100% -150px;
|
||||
border-width : 0px;
|
||||
}
|
||||
|
||||
DIV.tabs LI.current SPAN
|
||||
{
|
||||
background-position: 0% -150px;
|
||||
padding-bottom : 6px;
|
||||
}
|
||||
|
||||
DIV.navpath
|
||||
{
|
||||
background : none;
|
||||
border : none;
|
||||
border-bottom : 1px solid #84B0C7;
|
||||
.tablist li.current a {
|
||||
background-image: url('tab_a.png');
|
||||
background-repeat:repeat-x;
|
||||
color: #fff;
|
||||
text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user