Boost logo

Ublas :

Subject: Re: [ublas] Numeric traits for ublas bounded_vector and matrix
From: Rutger ter Borg (rutger_at_[hidden])
Date: 2010-02-21 03:52:12


Jesse Perla wrote:
>
> I think the has_static_size, has_static_column_size, has_static_row_size
> would be very useful for enable_if.
>

Hey Jesse,

I've added the has_static_size<T> and has_static_stride<T> meta-functions
which will be true_ if all sizes or strides are static (i.e., "fully"
static). I don't think it's possible to unroll stuff in the other case,
isn't it?

E.g.,

has_static_size< double[2] >::value == true
has_static_size< double[2][4] >::value == true
has_static_size< std::vector<double> >::value == false
has_static_size< ublas::matrix<double> >::value == false
has_static_size< ublas::bounded_matrix<double,3,3> >::value == false

has_static_stride< double[2] >::value == true
has_static_stride< double[2][4] >::value == true
has_static_stride< std::vector<double> >::value == false
has_static_stride< ublas::matrix<double> >::value == false
has_static_stride< ublas::bounded_matrix<double,3,3> >::value == true

Hopefully this does what you want.

Cheers,

Rutger