views:

892

answers:

3

hi

I am trying to implement certain matrix operations but I am lost in the internals of ublas library. is there a resource such as tutorial or an example on how to implement new ublas matrix expressions?

Thanks

+1  A: 

My suggestion is to just template your new functions so you don't have to worry about matrix expressions or ublas internals. For example, if you wanted to write your own inverse function, write it as a template:

template<typename MATRIX_IN, typename MATRIX_OUT>
bool invert_matrix(const MATRIX& A, MATRIX_OUT& B)
{
    // now use A(i,j), B(i,j), etc
    ...
}
Inverse
+1  A: 

Don't know if it'll help, but there's a wiki page on extending uBlas here. That expression template stuff really blows my mind. :)

Emile Cormier
+1  A: 

There are also some examples here, if they help at all.

Alex