Re: [eigen] Map with negative outer stride

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Theoretically a negative stride would work.  However, in
Eigen/src/Core/Stride.h, there is an assertion

eigen_assert(InnerStrideAtCompileTime != Dynamic && OuterStrideAtCompileTime != Dynamic);

Because Dynamic is defined as -1 in
Eigen/src/Core/util/Constants.h,  this prevents OuterStride<-1>
from working.  Other negative strides such as OuterStride<-2>
are OK.

I am unsure if disabling assertions is a good idea.  If you want
to disable assertions, #define EiGEN_NO_DEBUG.

Cheers,
Chen-Pang

On Mon, Feb 2, 2015 at 13:52:40, Matwey V. Kornilov wrote:
> Hi,
> 
> I have an Vector: {1,2,3,4,5,6}
> And I need to construct a matrix of the special form it:
> 
> 1 0 0 0 0 0
> 2 1 0 0 0 0
> 3 2 1 0 0 0
> 4 3 2 1 0 0
> 5 4 3 2 1 0
> 6 5 4 3 2 1
> 
> Is there a simple way to do that through mapings?



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/