move tables from class "tutorial_code" to "example"

also remove a align="center" in the Aliasing page -- it doesn't make sense to have 1 centered table page when all others are left aligned.
This commit is contained in:
Benoit Jacob 2010-10-19 08:42:49 -04:00
parent ca4bd5851c
commit 9fa54d4cc9
6 changed files with 45 additions and 31 deletions

View File

@ -45,12 +45,12 @@ The following three statements sets the other three entries. The final line outp
Here is another example, which combines matrices with vectors. Concentrate on the left-hand program for now; we will talk about the right-hand program later.
<table class="tutorial_code"><tr><td>
Size set at run time:
<table class="example">
<tr><th>Size set at run time:</th><th>Size set at compile time:</th></tr>
<tr><td>
\include QuickStart_example2_dynamic.cpp
</td>
<td>
Size set at compile time:
\include QuickStart_example2_fixed.cpp
</td></tr></table>

View File

@ -196,7 +196,7 @@ but the following code is legal:
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">
<table class="example">
<tr><th>Example:</th><th>Output:</th></tr>
<tr>
<td>\include tut_matrix_assignment_resizing.cpp </td>

View File

@ -42,12 +42,12 @@ which exactly matches our GEMM routine.
\subsection GEMM_Limitations Limitations
Unfortunately, this simplification mechanism is not perfect yet and not all expressions which could be
handled by a single GEMM-like call are correctly detected.
<table class="tutorial_code" style="width:100%">
<table class="example" style="width:100%">
<tr>
<td>Not optimal expression</td>
<td>Evaluated as</td>
<td>Optimal version (single evaluation)</td>
<td>Comments</td>
<th>Not optimal expression</th>
<th>Evaluated as</th>
<th>Optimal version (single evaluation)</th>
<th>Comments</th>
</tr>
<tr>
<td>\code

View File

@ -20,11 +20,13 @@ to do about it.
Here is a simple example exhibiting aliasing:
<table class="tutorial_code"><tr><td>
Example: \include TopicAliasing_block.cpp
<table class="example">
<tr><th>Example</th><th>Output</th></tr>
<tr><td>
\include TopicAliasing_block.cpp
</td>
<td>
Output: \verbinclude TopicAliasing_block.out
\verbinclude TopicAliasing_block.out
</td></tr></table>
The output is not what one would expect. The problem is the assignment
@ -51,11 +53,13 @@ problem. This means that in general aliasing cannot be detected at compile time.
some instances of aliasing, albeit at run time. The following example exhibiting aliasing was mentioned in
\ref TutorialMatrixArithmetic :
<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>
Again, the output shows the aliasing issue. However, by default Eigen uses a run-time assertion to detect this
@ -81,11 +85,13 @@ side. The function \link DenseBase::eval() eval() \endlink does precisely that.
For example, here is the corrected version of the first example above:
<table class="tutorial_code"><tr><td>
Example: \include TopicAliasing_block_correct.cpp
<table class="example">
<tr><th>Example</th><th>Output</th></tr>
<tr><td>
\include TopicAliasing_block_correct.cpp
</td>
<td>
Output: \verbinclude TopicAliasing_block_correct.out
\verbinclude TopicAliasing_block_correct.out
</td></tr></table>
Now, \c mat(2,2) equals 5 after the assignment, as it should be.
@ -96,19 +102,21 @@ better solution. Eigen provides the special-purpose function
\link DenseBase::transposeInPlace() transposeInPlace() \endlink which replaces a matrix by its transpose.
This is shown below:
<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>
If an xxxInPlace() function is available, then it is best to use it, because it indicate more clearly what you
If an xxxInPlace() function is available, then it is best to use it, because it indicates more clearly what you
are doing. This may also allow Eigen to optimize more aggressively. These are some of the xxxInPlace()
functions provided:
<table class="tutorial_code" align="center">
<tr> <td> <b>Original function</b> </td> <td> <b>In-place function</b> </td> </tr>
<table class="example">
<tr><th>Original function</th><th>In-place function</th></tr>
<tr> <td> MatrixBase::adjoint() </td> <td> MatrixBase::adjointInPlace() </td> </tr>
<tr> <td> DenseBase::reverse() </td> <td> DenseBase::reverseInPlace() </td> </tr>
<tr> <td> LDLT::solve() </td> <td> LDLT::solveInPlace() </td> </tr>

View File

@ -26,11 +26,13 @@ This section will provide simple examples for different types of objects Eigen i
<b> %EigenBase Example </b><br/><br/>
Prints the dimensions of the most generic object present in Eigen. It coulde be any matrix expressions, any dense or sparse matrix and any array.
<table class="tutorial_code"><tr><td>
Example: \include function_taking_eigenbase.cpp
<table class="example">
<tr><th>Example:</th><th>Output:</th></tr>
<tr><td>
\include function_taking_eigenbase.cpp
</td>
<td>
Output: \verbinclude function_taking_eigenbase.out
\verbinclude function_taking_eigenbase.out
</td></tr></table>
<b> %DenseBase Example </b><br/><br/>
Prints a sub-block of the dense expression. Accepts any dense matrix or array expression, but no sparse objects and no special matrix classes such as DiagonalMatrix.

View File

@ -62,7 +62,8 @@ Matrix<double, 13, 3> // Fully fixed (static allocation)
</div>
In most cases, you can simply use one of the convenience typedefs for \ref matrixtypedefs "matrices" and \ref arraytypedefs "arrays". Some examples:
<table class="tutorial_code">
<table class="example">
<tr><th>Matrices</th><th>Arrays</th></tr>
<tr><td>\code
Matrix<float,Dynamic,Dynamic> <=> MatrixXf
Matrix<double,Dynamic,1> <=> VectorXd
@ -537,7 +538,8 @@ Read-write access to sub-matrices:</td></tr>
\subsection QuickRef_Diagonal Diagonal matrices
<table class="tutorial_code">
<table class="example">
<tr><th>Operation</th><th>Code</th></tr>
<tr><td>
view a vector \link MatrixBase::asDiagonal() as a diagonal matrix \endlink \n </td><td>\code
mat1 = vec1.asDiagonal();\endcode
@ -572,7 +574,8 @@ mat3 = mat1 * diag1.inverse()
TriangularView gives a view on a triangular part of a dense matrix and allows to perform optimized operations on it. The opposite triangular part is never referenced and can be used to store other information.
<table class="tutorial_code">
<table class="example">
<tr><th>Operation</th><th>Code</th></tr>
<tr><td>
Reference to a triangular with optional \n
unit or null diagonal (read/write):
@ -615,7 +618,8 @@ Just as for triangular matrix, you can reference any triangular part of a square
matrix and perform special and optimized operations. Again the opposite triangular part is never referenced and can be
used to store other information.
<table class="tutorial_code">
<table class="example">
<tr><th>Operation</th><th>Code</th></tr>
<tr><td>
Conversion to a dense matrix:
</td><td>\code