Re: [eigen] Recursion and block matrices

[ Thread Index | Date Index | More Archives ]

Thanks for explaining Stride<0,0>.

A few weeks, ago, when I read Gael's email, I was already sufficiently overwhelmed with Eigen, and did not want to get involved in the Devel branch. Today I took a look, and the Ref certainly seems related, but I can't say that I understand it well enough to use it. It seems that the inner stride must be 1?

What I am aiming for is conceptually simple, and it is allowing me to learn the Eigen class hierarchy well enough to implement sub-matrices that will be less efficient as expressions, but will not have infinite recursion, and will share the same memory as the original matrix. In a nutshell, a sub-matrix is a Map of a rectangular subset of a PlainObject.

Will let you guys know when I am done. I'm sure I will not have done this in the best way, and any suggestions you have for improvement will be taken to heart. I hope will not have too many question to bother you along the way. If you have any other ideas for defining submatrices with the qualities I described above, please shout. Although I enjoy the challenge, I would not classify this as fun, and am looking forward to using this functionality.

Thanks, again,

On 09/18/2012 08:59 AM, Christoph Hertzberg wrote:
On 18.09.2012 17:51, Norman Goldstein wrote:
I figured this one out by decomposing the C++ statements until the
compiler message was more specific.
It turns out that the compiler was being asked to match Stride<0,0> with
Stride<-1,-1>.  The former is
defaulted in some declarations, while the latter is for dynamic stride.
When would one want to use

Stride<0,0> means "natural" stride, so colstride is number of rows, rowstride is 1 (assuming colmajor matrices). Have you yet tried to use the Ref<MatrixXd> class, as Gael suggested some mails ago? Or are you implementing this more for the fun of it?


On 08/28/2012 01:01 AM, Gael Guennebaud wrote:

With the devel branch you might try:

void incr(Ref<MatrixXd> mat) {

// no cast needed


Mail converted by MHonArc 2.6.19+