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
@@ -1,8 +1,7 @@
|
||||
#include <Eigen/Dense>
|
||||
#include <iostream>
|
||||
|
||||
using namespace Eigen;
|
||||
using namespace std;
|
||||
using Eigen::MatrixXf;
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -16,11 +15,11 @@ int main()
|
||||
7,8;
|
||||
|
||||
result = m * n;
|
||||
cout << "-- Matrix m*n: --" << endl << result << endl << endl;
|
||||
std::cout << "-- Matrix m*n: --\n" << result << "\n\n";
|
||||
result = m.array() * n.array();
|
||||
cout << "-- Array m*n: --" << endl << result << endl << endl;
|
||||
std::cout << "-- Array m*n: --\n" << result << "\n\n";
|
||||
result = m.cwiseProduct(n);
|
||||
cout << "-- With cwiseProduct: --" << endl << result << endl << endl;
|
||||
std::cout << "-- With cwiseProduct: --\n" << result << "\n\n";
|
||||
result = m.array() + 4;
|
||||
cout << "-- Array m + 4: --" << endl << result << endl << endl;
|
||||
std::cout << "-- Array m + 4: --\n" << result << "\n\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user