Boost logo

Ublas :

Subject: Re: [ublas] Numeric traits for ublas bounded_vector and matrix
From: Jesse Perla (jesseperla_at_[hidden])
Date: 2010-02-22 17:54:50


Rutger ter Borg <rutger <at> terborg.net> writes:
>
> Jesse Perla wrote:
> ublas::bounded_matrix< double, 10, 10 > A( 3, 3 );
> std::cout << A.size1() << " by " << A.size2() << std::endl;
> A.resize( 6, 6 );
> std::cout << A.size1() << " by " << A.size2() << std::endl;

I hear what you are saying... and perhaps the problem is that in all of my
code bounded_vector, etc. are used as both a statically sized and a statically
allocated matrix since I didn't have any other options.

Regardless, I needed to use this kind of metafunction to do what I have
been suggesting. The ones I made were:
static_vector_size<bounded_vector<double, 3>::type == mpl::int_<3>
is_bounded_vector<bounded_vector<double, 3> == mpl::true_

Since ublas doesn't make the distinction between static size vs. allocation,
perhaps the better names are:
has_static_allocation<> and static_allocation_size<>