Re: [eigen] two decisions to take

[ Thread Index | Date Index | More Archives ]

--- Andre Krause <post@xxxxxxxxxxxxxxxx> wrote:

> Donald Ephraim Curtis wrote:
> > However, i think there might be interest to do vector1.cross(vector2) to
> > mean, cross v1 with v2 and store in v1... like in the case v1 x= v2?
> i really would not do that. you cant see the concrete meaning of 
> vector1.cross(vector2). you cant tell if it just returns the cross 
> product or if it stores the cross product in vector1.

I disagree. I think that eigen2 should be using methods instead of global functions because it's a
C++ toolkit. Also, then we can cleanly use method chaining: 

double zLen = x.cross(y).dot(n) * 3; 

or better: 

double zLen = x^y*n*3; 
(the ^ is the cross operator and the * is the dot operator. For vectors not of dim3, ^ should be
the wedge operator)

compared to:

double zLen = dot(cross(x, y), n) * 3;

Please, implement infix operators, not prefix operators.

If you absolutely need prefix operators, please, please put them in the eigen2 namespace so they
don't pollute the global namespace.

We can always use setCross/^= vs. cross/^ to mean assignment operation vs return value operation.


Mail converted by MHonArc 2.6.19+