Re: [eigen] two things

[ Thread Index | Date Index | More Archives ]

On Wednesday 25 June 2008 22:09:17 Gael Guennebaud wrote:
> right, an intermediate solution would be to specialize Matrix<> if one
> of the dim is 1, e.g. let's add an additional "hidden" template
> parameter:
> template <typename T, int R, int C, ...,  int IsVector = R==1 || C==1>
> class Matrix {....};
> template <typename T, int R, int C, ..., int Flags>
> class Matrix<T,R,C, ...,  MaxSize,1,Flags,true> {  /* vector */ };
> but this only allows to improve a bit the constructors and this does
> not offer any template Vector<> class, so I'm not sure it's  worth it,
> just an idea....

It's interesting, I'm not opposed to it; on the other hand like you i'm not 
sure if it's worth the effort, as the problems with the matrix constructors 
are essentially "virtual problems" which don't cause harm in practice.

> > 2) about linear vectorization: i remember you suggested adding a
> > packet(int) method. I think this is still a good idea and would still
> > improve linear vectorization despite the improvements you already made.
> > OK?
> actually I'm not sure that's worth it: I've done some bench and if I
> remember well the overhead between a MatrixXf(R,C); versus a
> VectorXf(R*C); was negligible, like x1.1 or x1.2.....

so it was a 10% or 20% speed difference? Not what I call negligible!

Also, the speed difference becomes bigger as the InnerSize is small. What 
sizes did you test?



Attachment: signature.asc
Description: This is a digitally signed message part.

Mail converted by MHonArc 2.6.19+