|
Ublas : |
From: Jeffrey Brent McBeth (mcbeth_at_[hidden])
Date: 2005-10-20 09:49:05
On Thu, Oct 20, 2005 at 04:44:16PM +0200, Eddie.Vedder_at_[hidden] wrote:
> Dear list,
>
> I try to write my own class vector3d inherited from ublas::vector as
> proposed at
> http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?Effective_UBLAS.
> How can I assign an element of the vector within the constructor? I tried to
> operator () and data(), but both didn't work.
>
> Example:
> vector3d( double x, double y, double z )
> {
> operator () (0) = x;
> data () [0] = x;
> }
>
> Can anybody help?
I'm doing exactly what you describe, and I have it written as
(*this)[0] = x;
(*this)[1] = y;
(*this)[2] = z;
I suspect
data_[0] = x;
would work too?
Jeff
-- ---------------------------------------------------------------------------- Computer Science is as much about computers as astronomy is about telescopes -- Edsger Wybe Dijkstra (1930-2002) ----------------------------------------------------------------------------