Boost logo

Ublas :

From: Michael Stevens (mail_at_[hidden])
Date: 2005-02-07 07:04:11


On Friday 04 February 2005 15:42, Eddie.Vedder_at_[hidden] wrote:
> Hi there,
>
> I tried to write my own matrix class, which should hold a special matrix
> (rotation matrix) of size 3x3. The class inherits from
> boost::numeric::ublas::bounded_matrix<double, 3, 3> (similar to the vector3
> example on the "Effective UBLAS"-site).
OK
> My problem is: How can I access the matrix elements within new methods of
> my class. In the vector3 case it worked with data()[i].
You just need to call the usual element access operator. In the case of a
matrix that is the "operator ()". So inside a member function of your derived
class you would call
        double element_value = operator () (i,j);
to get the value of element i,j.

Michael