get rid of using namespace Eigen in sample code

This commit is contained in:
Erik Schultheis
2021-12-07 19:57:38 +00:00
committed by Rasmus Munk Larsen
parent e4c40b092a
commit 39a6aff16c
58 changed files with 274 additions and 399 deletions

View File

@@ -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;
}