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,15 +1,13 @@
|
||||
#include <iostream>
|
||||
#include <Eigen/Dense>
|
||||
|
||||
using namespace Eigen;
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
Vector3d v(1,2,3);
|
||||
Vector3d w(0,1,2);
|
||||
Eigen::Vector3d v(1,2,3);
|
||||
Eigen::Vector3d w(0,1,2);
|
||||
|
||||
cout << "Dot product: " << v.dot(w) << endl;
|
||||
std::cout << "Dot product: " << v.dot(w) << std::endl;
|
||||
double dp = v.adjoint()*w; // automatic conversion of the inner product to a scalar
|
||||
cout << "Dot product via a matrix product: " << dp << endl;
|
||||
cout << "Cross product:\n" << v.cross(w) << endl;
|
||||
std::cout << "Dot product via a matrix product: " << dp << std::endl;
|
||||
std::cout << "Cross product:\n" << v.cross(w) << std::endl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user