Boost logo

Ublas :

From: Garret McGraw (gmcgraw_at_[hidden])
Date: 2008-07-23 11:01:56


Hi,

I've looked around at the wiki and previous mailing list posts and I
cannot find the answer to my question there. What I need to do is
define a custom class and set it to be stored in a matrix such as:

matrix<MyCustomClass> mat1(300, 300);

And then it must be able to be multiplied by another matrix of a
different type.

matrix<MyCustomClass2> mat2(300, 300);

Then I want to be able to take the product of the two matrices have have
it go into another matrix of a third type:

matrix<MyCustomClass3> mat3(300, 300);

mat3 = prod(mat1, mat2);

Now I have defined operators to multiply MyCustomClass*MyCustomClass2
and return MyCustomClass3 and also the operator MyCustomClass3 +=
MyCustomClass3

Is there any other operators that I must define for this to compile? Is
this even possible with ublas?

Thanks in advance,
-Garret