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,13 +1,10 @@
|
||||
#include <Eigen/Dense>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
using namespace Eigen;
|
||||
|
||||
int main()
|
||||
{
|
||||
VectorXf v(2);
|
||||
MatrixXf m(2,2), n(2,2);
|
||||
Eigen::VectorXf v(2);
|
||||
Eigen::MatrixXf m(2,2), n(2,2);
|
||||
|
||||
v << -1,
|
||||
2;
|
||||
@@ -15,14 +12,14 @@ int main()
|
||||
m << 1,-2,
|
||||
-3,4;
|
||||
|
||||
cout << "v.squaredNorm() = " << v.squaredNorm() << endl;
|
||||
cout << "v.norm() = " << v.norm() << endl;
|
||||
cout << "v.lpNorm<1>() = " << v.lpNorm<1>() << endl;
|
||||
cout << "v.lpNorm<Infinity>() = " << v.lpNorm<Infinity>() << endl;
|
||||
std::cout << "v.squaredNorm() = " << v.squaredNorm() << std::endl;
|
||||
std::cout << "v.norm() = " << v.norm() << std::endl;
|
||||
std::cout << "v.lpNorm<1>() = " << v.lpNorm<1>() << std::endl;
|
||||
std::cout << "v.lpNorm<Infinity>() = " << v.lpNorm<Eigen::Infinity>() << std::endl;
|
||||
|
||||
cout << endl;
|
||||
cout << "m.squaredNorm() = " << m.squaredNorm() << endl;
|
||||
cout << "m.norm() = " << m.norm() << endl;
|
||||
cout << "m.lpNorm<1>() = " << m.lpNorm<1>() << endl;
|
||||
cout << "m.lpNorm<Infinity>() = " << m.lpNorm<Infinity>() << endl;
|
||||
std::cout << std::endl;
|
||||
std::cout << "m.squaredNorm() = " << m.squaredNorm() << std::endl;
|
||||
std::cout << "m.norm() = " << m.norm() << std::endl;
|
||||
std::cout << "m.lpNorm<1>() = " << m.lpNorm<1>() << std::endl;
|
||||
std::cout << "m.lpNorm<Infinity>() = " << m.lpNorm<Eigen::Infinity>() << std::endl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user