mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Implement mixed static/dynamic-size .block() (bug #579)
This commit is contained in:
27
doc/LinearLeastSquares.dox
Normal file
27
doc/LinearLeastSquares.dox
Normal file
@@ -0,0 +1,27 @@
|
||||
namespace Eigen {
|
||||
|
||||
/** \eigenManualPage LinearLeastSquares Solving linear least squares problems
|
||||
|
||||
lede
|
||||
|
||||
\eigenAutoToc
|
||||
|
||||
\section LinearLeastSquaresCopied Copied
|
||||
|
||||
The best way to do least squares solving is with a SVD decomposition. Eigen provides one as the JacobiSVD class, and its solve()
|
||||
is doing least-squares solving.
|
||||
|
||||
Here is an example:
|
||||
<table class="example">
|
||||
<tr><th>Example:</th><th>Output:</th></tr>
|
||||
<tr>
|
||||
<td>\include TutorialLinAlgSVDSolve.cpp </td>
|
||||
<td>\verbinclude TutorialLinAlgSVDSolve.out </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
For more information, including faster but less reliable methods, read our page concentrating on \ref LinearLeastSquares "linear least squares problems".
|
||||
|
||||
*/
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
Matrix4i m = Matrix4i::Random();
|
||||
cout << "Here is the matrix m:" << endl << m << endl;
|
||||
cout << "Here is the block:" << endl << m.block<2, Dynamic>(1, 1, 2, 3) << endl;
|
||||
m.block<2, Dynamic>(1, 1, 2, 3).setZero();
|
||||
cout << "Now the matrix m is:" << endl << m << endl;
|
||||
@@ -0,0 +1,6 @@
|
||||
Matrix4i m = Matrix4i::Random();
|
||||
cout << "Here is the matrix m:" << endl << m << endl;
|
||||
cout << "Here is m.bottomLeftCorner<2,Dynamic>(2,2):" << endl;
|
||||
cout << m.bottomLeftCorner<2,Dynamic>(2,2) << endl;
|
||||
m.bottomLeftCorner<2,Dynamic>(2,2).setZero();
|
||||
cout << "Now the matrix m is:" << endl << m << endl;
|
||||
@@ -0,0 +1,6 @@
|
||||
Matrix4i m = Matrix4i::Random();
|
||||
cout << "Here is the matrix m:" << endl << m << endl;
|
||||
cout << "Here is m.bottomRightCorner<2,Dynamic>(2,2):" << endl;
|
||||
cout << m.bottomRightCorner<2,Dynamic>(2,2) << endl;
|
||||
m.bottomRightCorner<2,Dynamic>(2,2).setZero();
|
||||
cout << "Now the matrix m is:" << endl << m << endl;
|
||||
@@ -0,0 +1,6 @@
|
||||
Matrix4i m = Matrix4i::Random();
|
||||
cout << "Here is the matrix m:" << endl << m << endl;
|
||||
cout << "Here is m.topLeftCorner<2,Dynamic>(2,2):" << endl;
|
||||
cout << m.topLeftCorner<2,Dynamic>(2,2) << endl;
|
||||
m.topLeftCorner<2,Dynamic>(2,2).setZero();
|
||||
cout << "Now the matrix m is:" << endl << m << endl;
|
||||
@@ -0,0 +1,6 @@
|
||||
Matrix4i m = Matrix4i::Random();
|
||||
cout << "Here is the matrix m:" << endl << m << endl;
|
||||
cout << "Here is m.topRightCorner<2,Dynamic>(2,2):" << endl;
|
||||
cout << m.topRightCorner<2,Dynamic>(2,2) << endl;
|
||||
m.topRightCorner<2,Dynamic>(2,2).setZero();
|
||||
cout << "Now the matrix m is:" << endl << m << endl;
|
||||
Reference in New Issue
Block a user