| Re: [eigen] Bug in traspose | 
[ Thread Index | 
Date Index
| More lists.tuxfamily.org/eigen Archives
] 
- To: eigen@xxxxxxxxxxxxxxxxxxx
 
- Subject: Re: [eigen] Bug in traspose
 
- From: "Schleimer, Ben" <bensch128@xxxxxxxxx>
 
- Date: Thu, 17 Jan 2008 16:48:52 -0800 (PST)
 
- 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=B0HW1eNVjxaqt6G8lK1wDRRhxX1+GQO2+kgwQMZDq6FfMF+xoRhK390bpQy6qcGzb1r/PQq6NHmGhiDrXSLFjps73c4oXctQI9NjmPbklWMtZnv1b/1xYsxwGWhKcgm2tAtDvBnYtClV8FR7H43LoKXYh9NrzVmTGwoac7E/aC0=;
 
--- Benoît Jacob <jacob@xxxxxxxxxxxxxxx> wrote:
> OK, first off I think you're right on this: we need to replace .newline() by 
> operator, because of the relative priority of these operators!
> 
> http://www.cplusplus.com/doc/tutorial/operators.html
> 
> operator, has the lowest priority. Whatever set of operators we choose must 
> have equal priorities and left-to-right associativity. The one exception is 
> the first operator which may have higher priority.
> 
> There is a problem with this:
> 
> > Matrix2d m;
> > m <<= (1, 2),
> >       (3, 4);
> 
> Here the first operator, refers to the object 1 and the compiler will treat it 
> as an "int". Since we can't overload operator, on a POD type, I see no way to 
> make this work. Same problem with every solution you're proposing with a 
> parenthesis ( before the 1.
I was thinking more about using va_args inside the operator()(...).
Then , can be overloaded to go to the next row.
I wonder how tvmet gets
m = 1, 2,
    3, 4; 
to work if the , operator is only overloaded in the Matrix<> class...
Cheers
Ben