mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
get rid of using namespace Eigen in sample code
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
e4c40b092a
commit
39a6aff16c
@@ -2,17 +2,14 @@
|
||||
#include <Eigen/LU>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
using namespace Eigen;
|
||||
|
||||
int main()
|
||||
{
|
||||
Matrix3f A;
|
||||
Vector3f b;
|
||||
Eigen::Matrix3f A;
|
||||
Eigen::Vector3f b;
|
||||
A << 1,2,3, 4,5,6, 7,8,10;
|
||||
b << 3, 3, 4;
|
||||
cout << "Here is the matrix A:" << endl << A << endl;
|
||||
cout << "Here is the vector b:" << endl << b << endl;
|
||||
Vector3f x = A.lu().solve(b);
|
||||
cout << "The solution is:" << endl << x << endl;
|
||||
std::cout << "Here is the matrix A:" << std::endl << A << std::endl;
|
||||
std::cout << "Here is the vector b:" << std::endl << b << std::endl;
|
||||
Eigen::Vector3f x = A.lu().solve(b);
|
||||
std::cout << "The solution is:" << std::endl << x << std::endl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user