Re: [eigen] Addition to Eigen-unsupported Spline module

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


Sorry, I'm not experienced with templates, but is there a preferred way of doing such static assertion in Eigen? Maybe an example somewhere?


On Tue, Jun 24, 2014 at 5:01 AM, Hauke Heibel <hauke.heibel@xxxxxxxxx> wrote:
Ok, sounds good. For the moment, we can at least static assert that
the Scalar of the array/vector is integral.

Hauke

On Tue, Jun 24, 2014 at 12:53 PM, Christoph Hertzberg
<chtz@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> On 24.06.2014 12:24, Hauke Heibel wrote:
>>
>> What Christoph said backs up introducing a new typedef like e.g.
>>
>> EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(DenseIndex, Idx)
>>
>> Are there any objections about doing this? I am fine with it. That's all
>> which keeps us from merging.
>
>
> Well, I'm not objecting this, but I think it would be much easier to simply
> accept any type for derivativeIndices (the same as you do for
> PointArrayType). Then the code would work for Eigen::ArrayXi as well as
> std::vector<short>, etc, and you would not need to introduce a new typedef.
> I doubt that anyone will have splines with more than 2^31 nodes in the near
> future, so requiring 64 bit indexes seems a bit over-engineered for this
> (for people requiring this it would be possible, nonetheless).
>
>
> For a clean solution, I'd like to have some kind of static assertion which
> ensures `typename IndexArray` has a size() method, and an operator[] which
> returns an integer type. Later on specializations which determine if the
> size is fixed at compile-time might come handy.
>
>
> Regards,
>
> Christoph
>
>
>
> --
> ----------------------------------------------
> Dipl.-Inf., Dipl.-Math. Christoph Hertzberg
> Cartesium 0.049
> Universität Bremen
> Enrique-Schmidt-Straße 5
> 28359 Bremen
>
> Tel: +49 (421) 218-64252
> ----------------------------------------------
>
>





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