diff options
author | 2009-09-22 20:58:29 -0400 | |
---|---|---|
committer | 2009-09-22 20:58:29 -0400 | |
commit | ab5cc8284aedae58885902f3764d19a8ff05f758 (patch) | |
tree | c4af7c4c5ba3801cb789c76ff875d8ad9934f9e9 /doc/snippets | |
parent | c1c780a94f148c618a74cfcccf40037442ae2d7c (diff) |
convert LU::solve() to the new API
Diffstat (limited to 'doc/snippets')
-rw-r--r-- | doc/snippets/LU_solve.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/doc/snippets/LU_solve.cpp b/doc/snippets/LU_solve.cpp index 7323338c3..301074305 100644 --- a/doc/snippets/LU_solve.cpp +++ b/doc/snippets/LU_solve.cpp @@ -1,13 +1,10 @@ -typedef Matrix<float,2,3> Matrix2x3; -typedef Matrix<float,3,2> Matrix3x2; -Matrix2x3 m = Matrix2x3::Random(); +Matrix<float,2,3> m = Matrix<float,2,3>::Random(); Matrix2f y = Matrix2f::Random(); cout << "Here is the matrix m:" << endl << m << endl; cout << "Here is the matrix y:" << endl << y << endl; -Matrix3x2 x; -if(m.lu().solve(y, &x)) +Matrix<float,3,2> x = m.lu().solve(y); +if((m*x).isApprox(y)) { - assert(y.isApprox(m*x)); cout << "Here is a solution x to the equation mx=y:" << endl << x << endl; } else |