TutorialLinAlgSVDSolve.cpp File Reference
#include <iostream>
#include <Eigen/Dense>

Functions

int main ()
 

Function Documentation

◆ main()

int main ( )
4  {
5  Eigen::MatrixXf A = Eigen::MatrixXf::Random(3, 2);
6  std::cout << "Here is the matrix A:\n" << A << std::endl;
7  Eigen::VectorXf b = Eigen::VectorXf::Random(3);
8  std::cout << "Here is the right hand side b:\n" << b << std::endl;
9  std::cout << "The least-squares solution is:\n"
10  << A.bdcSvd(Eigen::ComputeThinU | Eigen::ComputeThinV).solve(b) << std::endl;
11 }
Scalar * b
Definition: benchVecAdd.cpp:17
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Definition: bench_gemm.cpp:47
@ ComputeThinV
Definition: Constants.h:395
@ ComputeThinU
Definition: Constants.h:391

References b, Eigen::ComputeThinU, and Eigen::ComputeThinV.