mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
update CSS to doxygen 1.7.2, new CSS and cleaning of the tutorial
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user