diff options
author | Gael Guennebaud <g.gael@free.fr> | 2009-07-27 18:50:39 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2009-07-27 18:50:39 +0200 |
commit | 7579360672c7e149eeed5a2f777ed36305885aea (patch) | |
tree | b8625b61945b8e9647093982f42f3df8fa42b73f | |
parent | 5f3606bce9c1283e9f2e8b489c4baccfa2916d42 (diff) |
fix compilation of the doc and started a page dedicated to high performance and or BLAS users
-rw-r--r-- | doc/I02_HiPerformance.dox | 101 | ||||
-rw-r--r-- | doc/snippets/HouseholderQR_solve.cpp | 2 | ||||
-rw-r--r-- | doc/snippets/MatrixBase_asDiagonal.cpp | 2 | ||||
-rw-r--r-- | doc/snippets/MatrixBase_extract.cpp | 3 | ||||
-rw-r--r-- | doc/snippets/MatrixBase_marked.cpp | 3 | ||||
-rw-r--r-- | doc/snippets/MatrixBase_part.cpp | 3 |
6 files changed, 112 insertions, 2 deletions
diff --git a/doc/I02_HiPerformance.dox b/doc/I02_HiPerformance.dox new file mode 100644 index 000000000..012e7d71b --- /dev/null +++ b/doc/I02_HiPerformance.dox @@ -0,0 +1,101 @@ + +namespace Eigen { + +/** \page HiPerformance Advanced - Using Eigen with high performance + +<table class="tutorial_code"> +<tr> +<td>BLAS equivalent routine</td> +<td>Efficient version <br> (compile to a single optimized evaluation)</td> +<td>Less efficient equivalent version <br> (requires multiple evaluations)</td> +<td>comments</td> +</tr> +<tr> +<td>GEMM</td> +<td>m1 = s1 * m2 * m3</td> +<td>m1 = s1 * (m2 * m3)</td> +<td>This is because m2 * m3 is evaluated by the scalar product.</td> +</tr> +<tr> +<td>GEMM</td> +<td>m1 += s1 * m2.adjoint() * m3</td> +<td>m1 += (s1 * m2).adjoint() * m3</td> +<td>This is because our expression analyser stops at the first transpose expression and cannot extract the nested scalar multiple.</td> +</tr> +<tr> +<td>GEMM</td> +<td>m1 += m2.adjoint() * m3</td> +<td>m1 += m2.conjugate().transpose() * m3</td> +<td>For the same reason. Use .adjoint() or .transpose().conjugate()</td> +</tr> +<tr> +<td>GEMM</td> +<td>m1 -= (-(s0*m2).conjugate()*s1) * (s2 * m3.adjoint() * s3)</td> +<td></td> +<td>Note that s0 is automatically conjugated during the simplification of the expression.</td> +</tr> +<tr> +<td>SYR</td> +<td>m.sefadjointView<LowerTriangular>().rankUpdate(v,s)</td> +<td></td> +<td>Computes m += s * v * v.adjoint()</td> +</tr> +<tr> +<td>SYR2</td> +<td>m.sefadjointView<LowerTriangular>().rankUpdate(u,v,s)</td> +<td></td> +<td>Computes m += s * u * v.adjoint() + s * v * u.adjoint()</td> +</tr> +<tr> +<td>SYRK</td> +<td>m1.sefadjointView<UpperTriangular>().rankUpdate(m2.adjoint(),s)</td> +<td></td> +<td>Computes m1 += s * m2.adjoint() * m2</td> +</tr> +<tr> +<td>SYMM/HEMM</td> +<td>m3 -= s1 * m1.sefadjointView<UpperTriangular>() * m2.adjoint()</td> +<td></td> +<td></td> +</tr> +<tr> +<td>SYMM/HEMM</td> +<td>m3 += s1 * m2.transpose() * m1.conjugate().sefadjointView<UpperTriangular>()</td> +<td></td> +<td></td> +</tr> +<tr> +<td>TRMM</td> +<td>m3 -= s1 * m1.triangularView<UnitUpperTriangular>() * m2.adjoint()</td> +<td></td> +<td></td> +</tr> +<tr> +<td>TRSV / TRSM</td> +<td>m1.adjoint().triangularView<UnitLowerTriangular>().solveInPlace(m2)</td> +<td></td> +<td></td> +</tr> +<tr> +<td></td> +<td></td> +<td></td> +<td></td> +</tr> +<tr> +<td></td> +<td></td> +<td></td> +<td></td> +</tr> +<tr> +<td></td> +<td></td> +<td></td> +<td></td> +</tr> +</table> + +*/ + +} diff --git a/doc/snippets/HouseholderQR_solve.cpp b/doc/snippets/HouseholderQR_solve.cpp index aa9404951..429bd81e3 100644 --- a/doc/snippets/HouseholderQR_solve.cpp +++ b/doc/snippets/HouseholderQR_solve.cpp @@ -4,6 +4,6 @@ Matrix3f y = Matrix3f::Random(); cout << "Here is the matrix m:" << endl << m << endl; cout << "Here is the matrix y:" << endl << y << endl; Matrix3f x; -m.householderQr().solve(y, &x)); +m.householderQr().solve(y, &x); assert(y.isApprox(m*x)); cout << "Here is a solution x to the equation mx=y:" << endl << x << endl; diff --git a/doc/snippets/MatrixBase_asDiagonal.cpp b/doc/snippets/MatrixBase_asDiagonal.cpp index 4cbff8231..b01082db1 100644 --- a/doc/snippets/MatrixBase_asDiagonal.cpp +++ b/doc/snippets/MatrixBase_asDiagonal.cpp @@ -1 +1 @@ -cout << Vector3i(2,5,6).asDiagonal() << endl; +cout << Matrix3i(Vector3i(2,5,6).asDiagonal()) << endl; diff --git a/doc/snippets/MatrixBase_extract.cpp b/doc/snippets/MatrixBase_extract.cpp index 02f44c83f..a5ccd7574 100644 --- a/doc/snippets/MatrixBase_extract.cpp +++ b/doc/snippets/MatrixBase_extract.cpp @@ -1,3 +1,5 @@ +#warning deprecated +/* deprecated Matrix3i m = Matrix3i::Random(); cout << "Here is the matrix m:" << endl << m << endl; cout << "Here is the upper-triangular matrix extracted from m:" << endl @@ -6,3 +8,4 @@ cout << "Here is the strictly-upper-triangular matrix extracted from m:" << endl << m.part<Eigen::StrictlyUpperTriangular>() << endl; cout << "Here is the unit-lower-triangular matrix extracted from m:" << endl << m.part<Eigen::UnitLowerTriangular>() << endl; +*/
\ No newline at end of file diff --git a/doc/snippets/MatrixBase_marked.cpp b/doc/snippets/MatrixBase_marked.cpp index 5c05ce81e..f536773c9 100644 --- a/doc/snippets/MatrixBase_marked.cpp +++ b/doc/snippets/MatrixBase_marked.cpp @@ -1,3 +1,5 @@ +#warning deprecated +/* Matrix3d m = Matrix3d::Zero(); m.part<Eigen::UpperTriangular>().setOnes(); cout << "Here is the matrix m:" << endl << m << endl; @@ -7,3 +9,4 @@ cout << "Here is the matrix n:" << endl << n << endl; cout << "And now here is m.inverse()*n, taking advantage of the fact that" " m is upper-triangular:" << endl << m.marked<Eigen::UpperTriangular>().solveTriangular(n); +*/
\ No newline at end of file diff --git a/doc/snippets/MatrixBase_part.cpp b/doc/snippets/MatrixBase_part.cpp index 6f393a14a..81e66c4cd 100644 --- a/doc/snippets/MatrixBase_part.cpp +++ b/doc/snippets/MatrixBase_part.cpp @@ -1,3 +1,5 @@ +#warning deprecated +/* Matrix3d m = Matrix3d::Zero(); m.part<Eigen::StrictlyUpperTriangular>().setOnes(); cout << "Here is the matrix m:" << endl << m << endl; @@ -6,3 +8,4 @@ cout << "And let us now compute m*m.adjoint() in a very optimized way" << endl Matrix3d n; n.part<Eigen::SelfAdjoint>() = (m*m.adjoint()).lazy(); cout << "The result is:" << endl << n << endl; +*/
\ No newline at end of file |