Boost logo

Ublas :

From: Rob McDonald (ramcdona_at_[hidden])
Date: 2008-08-20 19:58:35


> Jesse,
>
> I took my initial inspiration from the same page on the wiki.
> Unfortunately, when I implemented much the same thing, it didn't work.
>
> I've tried yours and it appears to work.
>
> Here is the error message mine gives. It appears to be because mine is
> still generic code...
>
> vect.h:89: error: there are no arguments to `data' that depend on a
> template parameter, so a declaration of `data' must be available
> vect.h:89: error: (if you use `-fpermissive', G++ will accept your code,
> but allowing the use of an undeclared name is deprecated)
>
> Do you have any suggestions to make data () [] generic?
>
> Rob

I was able to get this to work thusly:

BOOST_UBLAS_INLINE
bounded_vector3 (T x, T y, T z) : vector_type(3){
   this->data () [0] = x;
   this->data () [1] = y;
   this->data () [2] = z;
}

I'm not sure why that didn't work before. It must have been a
permutation I left out although I'd swear I tried exactly that.

Thanks for the suggestions everyone. Here was a helpful link...
http://gcc.gnu.org/onlinedocs/gcc/Name-lookup.html

Then of course, there is the 2nd part of my original question:

> Rob said:
> After I get that working, I have another similar challenge...
>
> I would like to be able to assign one of these vectors with a comma
> delimited list. This is currently done in Blitz++, and I am migrating
> some code from Blitz to boost::ublas.
>
> So, I want to be able to do this....
>
> vect v;
> v = 1.2, 3.5, 7.8;

Does anyone know how to set up this slick assignment command?

Thanks in advance,

Rob