Re: [eigen] two decisions to take |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] two decisions to take
- From: "Schleimer, Ben" <bensch128@xxxxxxxxx>
- Date: Tue, 4 Sep 2007 10:47:18 -0700 (PDT)
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=6QUZ6vqyvt582WP5qNbBirQh6Z3+DpdU2LvovkXf6i3BzRwlV1tG1hhkowR8qzXbywrfgBvaBP+8YKgkAmxAoDpVXX1gt4udNnVIUR5m0c+7u09ZSxSobdWqFEo1/CmyMLOvCdck+83T0tHOGmeLzMJTV4Eroz+d2I+5Pqoqcpk=;
--- 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.
Cheers
Ben