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

@@ -1,13 +1,10 @@
#include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
ArrayXXf a(3,3);
ArrayXXf b(3,3);
Eigen::ArrayXXf a(3,3);
Eigen::ArrayXXf b(3,3);
a << 1,2,3,
4,5,6,
7,8,9;
@@ -16,8 +13,8 @@ int main()
1,2,3;
// Adding two arrays
cout << "a + b = " << endl << a + b << endl << endl;
std::cout << "a + b = " << std::endl << a + b << std::endl << std::endl;
// Subtracting a scalar from an array
cout << "a - 2 = " << endl << a - 2 << endl;
std::cout << "a - 2 = " << std::endl << a - 2 << std::endl;
}