mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +08:00
factorize CSS code, make use of the "manual" class when appropriate, clean the style of the big linear algebra table
This commit is contained in:
parent
9e3005d552
commit
6d8e7d68e4
@ -45,7 +45,7 @@ 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.
|
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="example">
|
<table class="manual">
|
||||||
<tr><th>Size set at run time:</th><th>Size set at compile time:</th></tr>
|
<tr><th>Size set at run time:</th><th>Size set at compile time:</th></tr>
|
||||||
<tr><td>
|
<tr><td>
|
||||||
\include QuickStart_example2_dynamic.cpp
|
\include QuickStart_example2_dynamic.cpp
|
||||||
|
@ -42,7 +42,7 @@ which exactly matches our GEMM routine.
|
|||||||
\subsection GEMM_Limitations Limitations
|
\subsection GEMM_Limitations Limitations
|
||||||
Unfortunately, this simplification mechanism is not perfect yet and not all expressions which could be
|
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.
|
handled by a single GEMM-like call are correctly detected.
|
||||||
<table class="example" style="width:100%">
|
<table class="manual" style="width:100%">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Not optimal expression</th>
|
<th>Not optimal expression</th>
|
||||||
<th>Evaluated as</th>
|
<th>Evaluated as</th>
|
||||||
@ -60,7 +60,7 @@ m1.noalias() += m2 * m3; \endcode</td>
|
|||||||
<td>Use .noalias() to tell Eigen the result and right-hand-sides do not alias.
|
<td>Use .noalias() to tell Eigen the result and right-hand-sides do not alias.
|
||||||
Otherwise the product m2 * m3 is evaluated into a temporary.</td>
|
Otherwise the product m2 * m3 is evaluated into a temporary.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr class="alt">
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>\code
|
<td>\code
|
||||||
@ -83,7 +83,7 @@ m1.noalias() += m3.adjoint()
|
|||||||
<td>This is because the product expression has the EvalBeforeNesting bit which
|
<td>This is because the product expression has the EvalBeforeNesting bit which
|
||||||
enforces the evaluation of the product by the Tranpose expression.</td>
|
enforces the evaluation of the product by the Tranpose expression.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr class="alt">
|
||||||
<td>\code
|
<td>\code
|
||||||
m1 = m1 + m2 * m3; \endcode</td>
|
m1 = m1 + m2 * m3; \endcode</td>
|
||||||
<td>\code
|
<td>\code
|
||||||
@ -107,7 +107,7 @@ m1.noalias() += m2 * m3; \endcode</td>
|
|||||||
so that no temporary is required. (tip: for very small fixed size matrix
|
so that no temporary is required. (tip: for very small fixed size matrix
|
||||||
it is slighlty better to rewrite it like this: m1.noalias() = m2 * m3; m1 += m4;</td>
|
it is slighlty better to rewrite it like this: m1.noalias() = m2 * m3; m1 += m4;</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr class="alt">
|
||||||
<td>\code
|
<td>\code
|
||||||
m1.noalias() += (s1*m2).block(..) * m3; \endcode</td>
|
m1.noalias() += (s1*m2).block(..) * m3; \endcode</td>
|
||||||
<td>\code
|
<td>\code
|
||||||
|
@ -115,14 +115,14 @@ If an xxxInPlace() function is available, then it is best to use it, because it
|
|||||||
are doing. This may also allow Eigen to optimize more aggressively. These are some of the xxxInPlace()
|
are doing. This may also allow Eigen to optimize more aggressively. These are some of the xxxInPlace()
|
||||||
functions provided:
|
functions provided:
|
||||||
|
|
||||||
<table class="example">
|
<table class="manual">
|
||||||
<tr><th>Original function</th><th>In-place function</th></tr>
|
<tr><th>Original function</th><th>In-place function</th></tr>
|
||||||
<tr> <td> MatrixBase::adjoint() </td> <td> MatrixBase::adjointInPlace() </td> </tr>
|
<tr> <td> MatrixBase::adjoint() </td> <td> MatrixBase::adjointInPlace() </td> </tr>
|
||||||
<tr> <td> DenseBase::reverse() </td> <td> DenseBase::reverseInPlace() </td> </tr>
|
<tr class="alt"> <td> DenseBase::reverse() </td> <td> DenseBase::reverseInPlace() </td> </tr>
|
||||||
<tr> <td> LDLT::solve() </td> <td> LDLT::solveInPlace() </td> </tr>
|
<tr> <td> LDLT::solve() </td> <td> LDLT::solveInPlace() </td> </tr>
|
||||||
<tr> <td> LLT::solve() </td> <td> LLT::solveInPlace() </td> </tr>
|
<tr class="alt"> <td> LLT::solve() </td> <td> LLT::solveInPlace() </td> </tr>
|
||||||
<tr> <td> TriangularView::solve() </td> <td> TriangularView::solveInPlace() </td> </tr>
|
<tr> <td> TriangularView::solve() </td> <td> TriangularView::solveInPlace() </td> </tr>
|
||||||
<tr> <td> DenseBase::transpose() </td> <td> DenseBase::transposeInPlace() </td> </tr>
|
<tr class="alt"> <td> DenseBase::transpose() </td> <td> DenseBase::transposeInPlace() </td> </tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,24 +5,24 @@ namespace Eigen {
|
|||||||
|
|
||||||
\section TopicLinAlgBigTable Catalogue of decompositions offered by Eigen
|
\section TopicLinAlgBigTable Catalogue of decompositions offered by Eigen
|
||||||
|
|
||||||
<table border="1">
|
<table class="manual-vl">
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td></td>
|
<th class="meta"></th>
|
||||||
<td colspan="5" align="center">Generic information, not Eigen-specific</td>
|
<th class="meta" colspan="5">Generic information, not Eigen-specific</th>
|
||||||
<td colspan="3" align="center">Eigen-specific</td>
|
<th class="meta" colspan="3">Eigen-specific</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>Decomposition</td>
|
<th>Decomposition</th>
|
||||||
<td>Requirements on the matrix</td>
|
<th>Requirements on the matrix</th>
|
||||||
<td>Speed</td>
|
<th>Speed</th>
|
||||||
<td>Algorithm reliability and accuracy</td>
|
<th>Algorithm reliability and accuracy</th>
|
||||||
<td>Rank-revealing</td>
|
<th>Rank-revealing</th>
|
||||||
<td>Allows to compute (besides linear solving)</td>
|
<th>Allows to compute (besides linear solving)</th>
|
||||||
<td>Linear solver provided by Eigen</td>
|
<th>Linear solver provided by Eigen</th>
|
||||||
<td>Maturity of Eigen's implementation</td>
|
<th>Maturity of Eigen's implementation</th>
|
||||||
<td>Optimizations</td>
|
<th>Optimizations</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
@ -37,7 +37,7 @@ namespace Eigen {
|
|||||||
<td>Blocking</td>
|
<td>Blocking</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr class="alt">
|
||||||
<td>FullPivLU</td>
|
<td>FullPivLU</td>
|
||||||
<td>-</td>
|
<td>-</td>
|
||||||
<td>Slow</td>
|
<td>Slow</td>
|
||||||
@ -61,7 +61,7 @@ namespace Eigen {
|
|||||||
<td>Blocking</td>
|
<td>Blocking</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr class="alt">
|
||||||
<td>ColPivHouseholderQR</td>
|
<td>ColPivHouseholderQR</td>
|
||||||
<td>-</td>
|
<td>-</td>
|
||||||
<td>Fast</td>
|
<td>Fast</td>
|
||||||
@ -85,7 +85,7 @@ namespace Eigen {
|
|||||||
<td>-</td>
|
<td>-</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr class="alt">
|
||||||
<td>LLT</td>
|
<td>LLT</td>
|
||||||
<td>Positive definite</td>
|
<td>Positive definite</td>
|
||||||
<td>Very fast</td>
|
<td>Very fast</td>
|
||||||
@ -109,7 +109,7 @@ namespace Eigen {
|
|||||||
<td><em>Soon: blocking</em></td>
|
<td><em>Soon: blocking</em></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr><td colspan="9">\n Singular values and eigenvalues decompositions</td></tr>
|
<tr><th class="inter" colspan="9">\n Singular values and eigenvalues decompositions</th></tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>JacobiSVD (two-sided)</td>
|
<td>JacobiSVD (two-sided)</td>
|
||||||
@ -171,7 +171,7 @@ namespace Eigen {
|
|||||||
<td>-</td>
|
<td>-</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr><td colspan="9">\n Helper decompositions</td></tr>
|
<tr><th class="inter" colspan="9">\n Helper decompositions</th></tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>RealSchur</td>
|
<td>RealSchur</td>
|
||||||
|
@ -700,13 +700,11 @@ img {
|
|||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* class for exemple / output tables */
|
|
||||||
|
|
||||||
table {
|
/* Common style for all Eigen's tables */
|
||||||
|
|
||||||
|
table.example, table.manual, table.manual-vl {
|
||||||
max-width:100%;
|
max-width:100%;
|
||||||
}
|
|
||||||
|
|
||||||
table.example {
|
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-width: 1px;
|
border-width: 1px;
|
||||||
@ -714,18 +712,51 @@ table.example {
|
|||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
|
|
||||||
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
|
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
|
||||||
-moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
|
-moz-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
|
||||||
-webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
|
-webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
|
||||||
}
|
}
|
||||||
|
|
||||||
table.example th {
|
table.example th, table.manual th, table.manual-vl th {
|
||||||
padding: 0.5em 0.5em 0.5em 0.5em;
|
padding: 0.5em 0.5em 0.5em 0.5em;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
padding-right: 1em;
|
padding-right: 1em;
|
||||||
background-color: #F2F1DC;
|
color: #555555;
|
||||||
|
background-color: #F4F4E5;
|
||||||
|
|
||||||
background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.3,#FFFFFF), color-stop(0.30,#FFFFFF), color-stop(0.98,#F4F4E5), to(#ECECDE));
|
background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.3,#FFFFFF), color-stop(0.30,#FFFFFF), color-stop(0.98,#F4F4E5), to(#ECECDE));
|
||||||
background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 30%, #F4F4E5 98%, #ECECDE);
|
background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 30%, #F4F4E5 98%, #ECECDE);
|
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF', endColorstr='#F4F4E5');
|
||||||
|
}
|
||||||
|
|
||||||
|
table.example td, table.manual td, table.manual-vl td {
|
||||||
|
vertical-align:top;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: #cccccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* header of headers */
|
||||||
|
table th.meta {
|
||||||
|
text-align:center;
|
||||||
|
font-size: 1.2em;
|
||||||
|
background-color:#FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* intermediate header */
|
||||||
|
table th.inter {
|
||||||
|
text-align:left;
|
||||||
|
background-color:#FFFFFF;
|
||||||
|
background-image:none;
|
||||||
|
border-style:solid solid solid solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: #cccccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** class for exemple / output tables **/
|
||||||
|
|
||||||
|
table.example {
|
||||||
|
}
|
||||||
|
|
||||||
|
table.example th {
|
||||||
}
|
}
|
||||||
|
|
||||||
table.example td {
|
table.example td {
|
||||||
@ -733,48 +764,35 @@ table.example td {
|
|||||||
vertical-align:top;
|
vertical-align:top;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* standard class for the manual */
|
/* standard class for the manual */
|
||||||
|
|
||||||
table.manual {
|
table.manual, table.manual-vl {
|
||||||
border-collapse: collapse;
|
|
||||||
border-style: solid;
|
|
||||||
border-width: 1px;
|
|
||||||
border-color: #cccccc;
|
|
||||||
font-size: 1em;
|
|
||||||
|
|
||||||
padding: 0.2em 0em 0.5em 0em;
|
padding: 0.2em 0em 0.5em 0em;
|
||||||
|
|
||||||
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
|
|
||||||
-moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
|
|
||||||
-webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
table.manual th {
|
table.manual th, table.manual-vl th {
|
||||||
padding: 0.5em 0.5em 0.5em 0.5em;
|
|
||||||
margin: 0em 0em 0.3em 0em;
|
margin: 0em 0em 0.3em 0em;
|
||||||
text-align: left;
|
|
||||||
color: #555555;
|
|
||||||
padding-right: 1em;
|
|
||||||
background-color: #F4F4E5;
|
|
||||||
|
|
||||||
background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.3,#FFFFFF), color-stop(0.30,#FFFFFF), color-stop(0.98,#F4F4E5), to(#ECECDE));
|
|
||||||
background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 30%, #F4F4E5 98%, #ECECDE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
table.manual td {
|
table.manual td, table.manual-vl 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-width: 1px;
|
||||||
border-color: #cccccc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
table.manual td.alt, table.manual tr.alt {
|
table.manual td.alt, table.manual tr.alt, table.manual-vl td.alt, table.manual-vl tr.alt {
|
||||||
/*padding: 0.3em 0.5em 0.3em 0.5em;
|
|
||||||
vertical-align:top;*/
|
|
||||||
background-color: #F4F4E5;
|
background-color: #F4F4E5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table.manual-vl th, table.manual-vl td, table.manual-vl td.alt {
|
||||||
|
border-color: #cccccc;
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: none solid none solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.manual-vl th.inter {
|
||||||
|
border-style: solid solid solid solid;
|
||||||
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
margin-top:2em;
|
margin-top:2em;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user