ADD: added other eigen lib
This commit is contained in:
@@ -1,20 +1,17 @@
|
||||
#include <iostream>
|
||||
#include <Eigen/Dense>
|
||||
|
||||
using namespace std;
|
||||
using namespace Eigen;
|
||||
|
||||
int main()
|
||||
{
|
||||
Matrix3f A;
|
||||
Eigen::Matrix3f A;
|
||||
A << 1, 2, 5,
|
||||
2, 1, 4,
|
||||
3, 0, 3;
|
||||
cout << "Here is the matrix A:\n" << A << endl;
|
||||
FullPivLU<Matrix3f> lu_decomp(A);
|
||||
cout << "The rank of A is " << lu_decomp.rank() << endl;
|
||||
cout << "Here is a matrix whose columns form a basis of the null-space of A:\n"
|
||||
<< lu_decomp.kernel() << endl;
|
||||
cout << "Here is a matrix whose columns form a basis of the column-space of A:\n"
|
||||
<< lu_decomp.image(A) << endl; // yes, have to pass the original A
|
||||
std::cout << "Here is the matrix A:\n" << A << std::endl;
|
||||
Eigen::FullPivLU<Eigen::Matrix3f> lu_decomp(A);
|
||||
std::cout << "The rank of A is " << lu_decomp.rank() << std::endl;
|
||||
std::cout << "Here is a matrix whose columns form a basis of the null-space of A:\n"
|
||||
<< lu_decomp.kernel() << std::endl;
|
||||
std::cout << "Here is a matrix whose columns form a basis of the column-space of A:\n"
|
||||
<< lu_decomp.image(A) << std::endl; // yes, have to pass the original A
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user