mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-21 04:14:26 +08:00
update style of the quick ref guide
This commit is contained in:
parent
f66fe2663f
commit
ca4bd5851c
@ -20,19 +20,19 @@ namespace Eigen {
|
|||||||
|
|
||||||
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.
|
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">
|
<table class="manual">
|
||||||
<tr><td>Module</td><td>Header file</td><td>Contents</td></tr>
|
<tr><th>Module</th><th>Header file</th><th>Contents</th></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 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 class="alt"><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 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 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 class="alt"><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 least-squares solver (JacobiSVD)</td></tr>
|
<tr><td>\link SVD_Module SVD \endlink</td><td>\code#include <Eigen/SVD>\endcode</td><td>SVD decomposition with least-squares solver (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 class="alt"><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 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 class="alt"><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/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>
|
<tr class="alt"><td></td><td>\code#include <Eigen/Eigen>\endcode</td><td>Includes %Dense and %Sparse header files (the whole Eigen library)</td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<a href="#" class="top">top</a>
|
<a href="#" class="top">top</a>
|
||||||
@ -98,8 +98,8 @@ In the rest of this document we will use the following symbols to emphasize the
|
|||||||
|
|
||||||
\subsection QuickRef_Basics Basic matrix manipulation
|
\subsection QuickRef_Basics Basic matrix manipulation
|
||||||
|
|
||||||
<table class="tutorial_code">
|
<table class="manual">
|
||||||
<tr><td></td><td>1D objects</td><td>2D objects</td><td>Notes</td></tr>
|
<tr><th></th><th>1D objects</th><th>2D objects</th><th>Notes</th></tr>
|
||||||
<tr><td>Constructors</td>
|
<tr><td>Constructors</td>
|
||||||
<td>\code
|
<td>\code
|
||||||
Vector4d v4;
|
Vector4d v4;
|
||||||
@ -119,7 +119,7 @@ MatrixXf m5; // empty object
|
|||||||
MatrixXf m6(nb_rows, nb_columns);
|
MatrixXf m6(nb_rows, nb_columns);
|
||||||
\endcode</td><td class="note">
|
\endcode</td><td class="note">
|
||||||
By default, the coefficients \n are left uninitialized</td></tr>
|
By default, the coefficients \n are left uninitialized</td></tr>
|
||||||
<tr><td>Comma initializer</td>
|
<tr class="alt"><td>Comma initializer</td>
|
||||||
<td>\code
|
<td>\code
|
||||||
Vector3f v1; v1 << x, y, z;
|
Vector3f v1; v1 << x, y, z;
|
||||||
ArrayXf v2(4); v2 << 1, 2, 3, 4;
|
ArrayXf v2(4); v2 << 1, 2, 3, 4;
|
||||||
@ -140,7 +140,7 @@ output:
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr><td>Runtime info</td>
|
<tr class="alt"><td>Runtime info</td>
|
||||||
<td>\code
|
<td>\code
|
||||||
vector.size();
|
vector.size();
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ ObjectType::Scalar ObjectType::RowsAtCompileTime
|
|||||||
ObjectType::RealScalar ObjectType::ColsAtCompileTime
|
ObjectType::RealScalar ObjectType::ColsAtCompileTime
|
||||||
ObjectType::Index ObjectType::SizeAtCompileTime
|
ObjectType::Index ObjectType::SizeAtCompileTime
|
||||||
\endcode</td><td></td></tr>
|
\endcode</td><td></td></tr>
|
||||||
<tr><td>Resizing</td>
|
<tr class="alt"><td>Resizing</td>
|
||||||
<td>\code
|
<td>\code
|
||||||
vector.resize(size);
|
vector.resize(size);
|
||||||
|
|
||||||
@ -183,7 +183,7 @@ vector[i] vector.y()
|
|||||||
matrix(i,j)
|
matrix(i,j)
|
||||||
\endcode</td><td class="note">Range checking is disabled if \n NDEBUG or #EIGEN_NO_DEBUG is defined</td></tr>
|
\endcode</td><td class="note">Range checking is disabled if \n NDEBUG or #EIGEN_NO_DEBUG is defined</td></tr>
|
||||||
|
|
||||||
<tr><td>Coeff access without \n range checking</td>
|
<tr class="alt"><td>Coeff access without \n range checking</td>
|
||||||
<td>\code
|
<td>\code
|
||||||
vector.coeff(i)
|
vector.coeff(i)
|
||||||
vector.coeffRef(i)
|
vector.coeffRef(i)
|
||||||
@ -202,11 +202,11 @@ object_of_float = expression_of_double.cast<float>();
|
|||||||
|
|
||||||
\subsection QuickRef_PredefMat Predefined Matrices
|
\subsection QuickRef_PredefMat Predefined Matrices
|
||||||
|
|
||||||
<table class="tutorial_code">
|
<table class="manual">
|
||||||
<tr>
|
<tr>
|
||||||
<td>Fixed-size matrix or vector</td>
|
<th>Fixed-size matrix or vector</th>
|
||||||
<td>Dynamic-size matrix</td>
|
<th>Dynamic-size matrix</th>
|
||||||
<td>Dynamic-size vector</td>
|
<th>Dynamic-size vector</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr style="border-bottom-style: none;">
|
<tr style="border-bottom-style: none;">
|
||||||
<td>
|
<td>
|
||||||
@ -303,7 +303,7 @@ VectorXf::Unit(4,1) == Vector4f(0,1,0,0)
|
|||||||
|
|
||||||
\subsection QuickRef_Map Mapping external arrays
|
\subsection QuickRef_Map Mapping external arrays
|
||||||
|
|
||||||
<table class="tutorial_code">
|
<table class="manual">
|
||||||
<tr>
|
<tr>
|
||||||
<td>Contiguous \n memory</td>
|
<td>Contiguous \n memory</td>
|
||||||
<td>\code
|
<td>\code
|
||||||
@ -330,13 +330,13 @@ Map<MatrixXf,0,OuterStride<> > m1(data,2,3,OuterStride<>(3)); // are equal t
|
|||||||
<a href="#" class="top">top</a>
|
<a href="#" class="top">top</a>
|
||||||
\section QuickRef_ArithmeticOperators Arithmetic Operators
|
\section QuickRef_ArithmeticOperators Arithmetic Operators
|
||||||
|
|
||||||
<table class="tutorial_code">
|
<table class="manual">
|
||||||
<tr><td>
|
<tr><td>
|
||||||
add \n subtract</td><td>\code
|
add \n subtract</td><td>\code
|
||||||
mat3 = mat1 + mat2; mat3 += mat1;
|
mat3 = mat1 + mat2; mat3 += mat1;
|
||||||
mat3 = mat1 - mat2; mat3 -= mat1;\endcode
|
mat3 = mat1 - mat2; mat3 -= mat1;\endcode
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr><td>
|
<tr class="alt"><td>
|
||||||
scalar product</td><td>\code
|
scalar product</td><td>\code
|
||||||
mat3 = mat1 * s1; mat3 *= s1; mat3 = s1 * mat1;
|
mat3 = mat1 * s1; mat3 *= s1; mat3 = s1 * mat1;
|
||||||
mat3 = mat1 / s1; mat3 /= s1;\endcode
|
mat3 = mat1 / s1; mat3 /= s1;\endcode
|
||||||
@ -347,7 +347,7 @@ col2 = mat1 * col1;
|
|||||||
row2 = row1 * mat1; row1 *= mat1;
|
row2 = row1 * mat1; row1 *= mat1;
|
||||||
mat3 = mat1 * mat2; mat3 *= mat1; \endcode
|
mat3 = mat1 * mat2; mat3 *= mat1; \endcode
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr><td>
|
<tr class="alt"><td>
|
||||||
transposition \n adjoint \matrixworld</td><td>\code
|
transposition \n adjoint \matrixworld</td><td>\code
|
||||||
mat1 = mat2.transpose(); mat1.transposeInPlace();
|
mat1 = mat2.transpose(); mat1.transposeInPlace();
|
||||||
mat1 = mat2.adjoint(); mat1.adjointInPlace();
|
mat1 = mat2.adjoint(); mat1.adjointInPlace();
|
||||||
@ -359,7 +359,7 @@ scalar = vec1.dot(vec2);
|
|||||||
scalar = col1.adjoint() * col2;
|
scalar = col1.adjoint() * col2;
|
||||||
scalar = (col1.adjoint() * col2).value();\endcode
|
scalar = (col1.adjoint() * col2).value();\endcode
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr><td>
|
<tr class="alt"><td>
|
||||||
outer product \matrixworld</td><td>\code
|
outer product \matrixworld</td><td>\code
|
||||||
mat = col1 * col2.transpose();\endcode
|
mat = col1 * col2.transpose();\endcode
|
||||||
</td></tr>
|
</td></tr>
|
||||||
@ -370,7 +370,7 @@ scalar = vec1.norm(); scalar = vec1.squaredNorm()
|
|||||||
vec2 = vec1.normalized(); vec1.normalize(); // inplace \endcode
|
vec2 = vec1.normalized(); vec1.normalize(); // inplace \endcode
|
||||||
</td></tr>
|
</td></tr>
|
||||||
|
|
||||||
<tr><td>
|
<tr class="alt"><td>
|
||||||
\link MatrixBase::cross() cross product \endlink \matrixworld</td><td>\code
|
\link MatrixBase::cross() cross product \endlink \matrixworld</td><td>\code
|
||||||
#include <Eigen/Geometry>
|
#include <Eigen/Geometry>
|
||||||
vec3 = vec1.cross(vec2);\endcode</td></tr>
|
vec3 = vec1.cross(vec2);\endcode</td></tr>
|
||||||
@ -379,8 +379,8 @@ vec3 = vec1.cross(vec2);\endcode</td></tr>
|
|||||||
<a href="#" class="top">top</a>
|
<a href="#" class="top">top</a>
|
||||||
\section QuickRef_Coeffwise Coefficient-wise \& Array operators
|
\section QuickRef_Coeffwise Coefficient-wise \& Array operators
|
||||||
Coefficient-wise operators for matrices and vectors:
|
Coefficient-wise operators for matrices and vectors:
|
||||||
<table class="tutorial_code">
|
<table class="manual">
|
||||||
<tr><td>Matrix API \matrixworld</td><td>Via Array conversions</td></tr>
|
<tr><th>Matrix API \matrixworld</th><th>Via Array conversions</th></tr>
|
||||||
<tr><td>\code
|
<tr><td>\code
|
||||||
mat1.cwiseMin(mat2)
|
mat1.cwiseMin(mat2)
|
||||||
mat1.cwiseMax(mat2)
|
mat1.cwiseMax(mat2)
|
||||||
@ -402,7 +402,7 @@ mat1.array() / mat2.array()
|
|||||||
|
|
||||||
Array operators:\arrayworld
|
Array operators:\arrayworld
|
||||||
|
|
||||||
<table class="tutorial_code">
|
<table class="manual">
|
||||||
<tr><td>Arithmetic operators</td><td>\code
|
<tr><td>Arithmetic operators</td><td>\code
|
||||||
array1 * array2 array1 / array2 array1 *= array2 array1 /= array2
|
array1 * array2 array1 / array2 array1 *= array2 array1 /= array2
|
||||||
array1 + scalar array1 - scalar array1 += scalar array1 -= scalar
|
array1 + scalar array1 - scalar array1 += scalar array1 -= scalar
|
||||||
@ -443,14 +443,14 @@ Eigen provides several reduction methods such as:
|
|||||||
All reduction operations can be done matrix-wise,
|
All reduction operations can be done matrix-wise,
|
||||||
\link DenseBase::colwise() column-wise \endlink \redstar or
|
\link DenseBase::colwise() column-wise \endlink \redstar or
|
||||||
\link DenseBase::rowwise() row-wise \endlink \redstar. Usage example:
|
\link DenseBase::rowwise() row-wise \endlink \redstar. Usage example:
|
||||||
<table class="tutorial_code">
|
<table class="manual">
|
||||||
<tr><td rowspan="3" style="border-right-style:dashed">\code
|
<tr><td rowspan="3" style="border-right-style:dashed;vertical-align:middle">\code
|
||||||
5 3 1
|
5 3 1
|
||||||
mat = 2 7 8
|
mat = 2 7 8
|
||||||
9 4 6 \endcode
|
9 4 6 \endcode
|
||||||
</td> <td>\code mat.minCoeff(); \endcode</td><td>\code 1 \endcode</td></tr>
|
</td> <td>\code mat.minCoeff(); \endcode</td><td>\code 1 \endcode</td></tr>
|
||||||
<tr><td>\code mat.colwise().minCoeff(); \endcode</td><td>\code 2 3 1 \endcode</td></tr>
|
<tr class="alt"><td>\code mat.colwise().minCoeff(); \endcode</td><td>\code 2 3 1 \endcode</td></tr>
|
||||||
<tr><td>\code mat.rowwise().minCoeff(); \endcode</td><td>\code
|
<tr style="vertical-align:middle"><td>\code mat.rowwise().minCoeff(); \endcode</td><td>\code
|
||||||
1
|
1
|
||||||
2
|
2
|
||||||
4
|
4
|
||||||
@ -486,19 +486,19 @@ mat1.col(j1).swap(mat1.col(j2));
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
Read-write access to sub-vectors:
|
Read-write access to sub-vectors:
|
||||||
<table class="tutorial_code">
|
<table class="manual">
|
||||||
<tr>
|
<tr>
|
||||||
<td>Default versions</td>
|
<th>Default versions</th>
|
||||||
<td>Optimized versions when the size \n is known at compile time</td></tr>
|
<th>Optimized versions when the size \n is known at compile time</th></tr>
|
||||||
<td></td>
|
<th></th>
|
||||||
|
|
||||||
<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.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.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>
|
<tr><td>\code vec1.segment(pos,n)\endcode</td><td>\code vec1.segment<n>(pos)\endcode</td>
|
||||||
<td>the \c n 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>
|
<tr class="alt"><td colspan="3">
|
||||||
|
|
||||||
Read-write access to sub-matrices:</td><td></td><td></td></tr>
|
Read-write access to sub-matrices:</td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>\code mat1.block(i,j,rows,cols)\endcode
|
<td>\code mat1.block(i,j,rows,cols)\endcode
|
||||||
\link DenseBase::block(Index,Index,Index,Index) (more) \endlink</td>
|
\link DenseBase::block(Index,Index,Index,Index) (more) \endlink</td>
|
||||||
|
@ -754,6 +754,8 @@ table.manual th {
|
|||||||
table.manual td {
|
table.manual td {
|
||||||
padding: 0.3em 0.5em 0.3em 0.5em;
|
padding: 0.3em 0.5em 0.3em 0.5em;
|
||||||
vertical-align:top;
|
vertical-align:top;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: #cccccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
table.manual td.alt, table.manual tr.alt {
|
table.manual td.alt, table.manual tr.alt {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user