TutorialLinAlgRankRevealing.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <Eigen/Dense>
3 
4 int main()
5 {
7  A << 1, 2, 5,
8  2, 1, 4,
9  3, 0, 3;
10  std::cout << "Here is the matrix A:\n" << A << std::endl;
12  std::cout << "The rank of A is " << lu_decomp.rank() << std::endl;
13  std::cout << "Here is a matrix whose columns form a basis of the null-space of A:\n"
14  << lu_decomp.kernel() << std::endl;
15  std::cout << "Here is a matrix whose columns form a basis of the column-space of A:\n"
16  << lu_decomp.image(A) << std::endl; // yes, have to pass the original A
17 }
MatrixXcf A
LU decomposition of a matrix with complete pivoting, and related features.
Definition: FullPivLU.h:64
Index rank() const
Definition: FullPivLU.h:333
const internal::image_retval< FullPivLU > image(const MatrixType &originalMatrix) const
Definition: FullPivLU.h:219
const internal::kernel_retval< FullPivLU > kernel() const
Definition: FullPivLU.h:193
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:182