ublas matrix expression tutorial/examples
Asked Answered
W

3

14

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

Wintertime answered 17/1, 2010 at 1:12 Comment(0)
N
3

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. :)

Niece answered 17/1, 2010 at 1:21 Comment(0)
S
2

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
    ...
}
Seadon answered 17/1, 2010 at 1:18 Comment(0)
B
2

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

Bloater answered 17/1, 2010 at 1:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.