|Re: [eigen] sub-matrix extensions|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] sub-matrix extensions
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Fri, 6 Feb 2009 14:44:40 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=7m1EHcp9hatbgwiXj8LpSG0aRwZNsnoHkmJWQhcsxm0=; b=gHoygQX7Aat5+zuVcZxyBJcTvhT0vd18EgbjS+xEqTYONz5wsjbi1jqnz159J/ITcv KUBn0TL9kAQA3BlOukKNVX7ZG2TjBHvY6yp7rXeH5ef3k1pNjaXrgYNiyEwZu6C9/lr5 rQziwmjdg5g9bC681lKDMOaZcnUYM6DIDBSoo=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=gLcGVkncMhF4HPCFw3pKp26zCn9oWDuAxJAuIUGycY79ZewVcIMXN/tVKtH+onFCSN T9EFwj5tN/ClZ/j3HGCs6ydHes6Knw4DRVRZkCqQKOyVq+KoJfjqK0okPGRPxflSnE8P HmJyrj3wLKMREXLhFmocVKmnDS5ZwcoyHyvZQ=
On Fri, Feb 6, 2009 at 1:27 PM, Jitse Niesen <jitse@xxxxxxxxxxxxxxxxx> wrote:
> On Fri, 6 Feb 2009, Gael Guennebaud wrote:
>> c) here I have a use case where runtime strides are needed, but do
>> you think we also need compile-time strides ? (probably yes)
>> d) do you think bidirectional strides might be useful ? eg:
>> mat.stride(2,3) (picks the intersections of all even rows and k*3
> I have some Matlab code that uses A(1:2:end, 1:2:end) = ... which would be
> A.stride(2,2) = ... in your notation. In the end, we got rid of it by
> redefining A to be a permutation of the original A, so it was not essential,
> but it was useful in developing the code / maths.
> As for c), I'm not sure what the question is. I guess with compile-time
> strides you mean all the template tricks so that you write A.stride<2,2> .
> In my case, 2 is a compile-time constant (obviously), so this could be done.
> As I understand it, the use of the templates is that you can do
> optimizations at compile time. Is there a possible optimization here? In my
> case, it wouldn't be very useful since we could get rid of the double
> strides (indeed, the fact that double strides are slow in Matlab was one of
> the reasons we re-defined A).
exactly, for instance the compiler might optimize a *2 using a shift,
this allows us to compute the size of the matrix at compile time (if
the matrix size if known at compile time of course) that further allow
to perform some unrolling, etc...