mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 19:59:05 +08:00
Adapted Geometry includes.
Adapted the decomposition documentation regarding the solve signature.
This commit is contained in:
parent
ecc71abdda
commit
7bf5930496
@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
#include "src/Core/util/DisableMSVCWarnings.h"
|
#include "src/Core/util/DisableMSVCWarnings.h"
|
||||||
|
|
||||||
#include "Array"
|
|
||||||
#include "SVD"
|
#include "SVD"
|
||||||
#include "LU"
|
#include "LU"
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
@ -148,9 +148,8 @@ The API is the same as when using the %LU decomposition.
|
|||||||
MatrixXf D = MatrixXf::Random(8,4);
|
MatrixXf D = MatrixXf::Random(8,4);
|
||||||
MatrixXf A = D.transpose() * D;
|
MatrixXf A = D.transpose() * D;
|
||||||
VectorXf b = A * VectorXf::Random(4);
|
VectorXf b = A * VectorXf::Random(4);
|
||||||
VectorXf x;
|
VectorXf x_llt = A.llt().solve(b); // using a LLT factorization
|
||||||
A.llt().solve(b,&x); // using a LLT factorization
|
VectorXf x_ldlt = A.ldlt().solve(b); // using a LDLT factorization
|
||||||
A.ldlt().solve(b,&x); // using a LDLT factorization
|
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
The LLT and LDLT classes also provide an \em in \em place API for the case where the value of the
|
The LLT and LDLT classes also provide an \em in \em place API for the case where the value of the
|
||||||
@ -238,10 +237,9 @@ of its use:
|
|||||||
// ...
|
// ...
|
||||||
MatrixXf A = MatrixXf::Random(20,20);
|
MatrixXf A = MatrixXf::Random(20,20);
|
||||||
VectorXf b = VectorXf::Random(20);
|
VectorXf b = VectorXf::Random(20);
|
||||||
VectorXf x;
|
VectorXf x = A.svd().solve(b);
|
||||||
A.svd().solve(b, &x);
|
|
||||||
SVD<MatrixXf> svdOfA(A);
|
SVD<MatrixXf> svdOfA(A);
|
||||||
svdOfA.solve(b, &x);
|
x = svdOfA.solve(b);
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
%LU decomposition with full pivoting has better numerical stability than %LU decomposition with
|
%LU decomposition with full pivoting has better numerical stability than %LU decomposition with
|
||||||
@ -252,10 +250,9 @@ partial pivoting. It is defined in the class FullPivLU. The solver can also hand
|
|||||||
// ...
|
// ...
|
||||||
MatrixXf A = MatrixXf::Random(20,20);
|
MatrixXf A = MatrixXf::Random(20,20);
|
||||||
VectorXf b = VectorXf::Random(20);
|
VectorXf b = VectorXf::Random(20);
|
||||||
VectorXf x;
|
VectorXf x = A.lu().solve(b);
|
||||||
A.lu().solve(b, &x);
|
|
||||||
FullPivLU<MatrixXf> luOfA(A);
|
FullPivLU<MatrixXf> luOfA(A);
|
||||||
luOfA.solve(b, &x);
|
x = luOfA.solve(b);
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
See the section \ref TutorialAdvLU below.
|
See the section \ref TutorialAdvLU below.
|
||||||
@ -273,8 +270,7 @@ You can obtain the LU decomposition of a matrix by calling \link MatrixBase::lu(
|
|||||||
#include <Eigen/LU>
|
#include <Eigen/LU>
|
||||||
MatrixXf A = MatrixXf::Random(20,20);
|
MatrixXf A = MatrixXf::Random(20,20);
|
||||||
VectorXf b = VectorXf::Random(20);
|
VectorXf b = VectorXf::Random(20);
|
||||||
VectorXf x;
|
VectorXf x = A.lu().solve(b);
|
||||||
A.lu().solve(b, &x);
|
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
Alternatively, you can construct a named LU decomposition, which allows you to reuse it for more than one operation:
|
Alternatively, you can construct a named LU decomposition, which allows you to reuse it for more than one operation:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user