← Back to team overview

yade-dev team mailing list archive

eigen2: question about a commented line in Math.hpp

 

Hi all,

I am wondering why the following line (in Math.hpp) is commented.
template<class Scalar> VECTOR3_TEMPLATE(Scalar) operator*(Scalar s, const VECTOR3_TEMPLATE(Scalar)& v) {return v*s;}

If I write:
Vector3r myvec(1,2,3);
cerr<<"myvec : "<<myvec<<endl;
cerr<<"2*myvec :"<<2.0*myvec<<endl;

The output is :
myvec : 1 2 3
2*myvec :2
4
6


These linebreaks are not convenient when saving data into a file.
To overcome this, I can write :
cerr<<"2*myvec :"<<2.0*myvec.x()<<" "<<2.0*myvec.y()<<" "<<2.0*myvec.z()<<endl;
or cerr<<"2*myvec :"<<Vector3r(2.0*myvec)<<endl;
or simply uncomment the line ....
Will I break something if I uncomment it ?

Thanks in advance.


Franck