Boost logo

Ublas :

From: Gunter Winkler (guwi17_at_[hidden])
Date: 2007-02-28 09:34:58


On Wednesday 28 February 2007 12:16, Sourabh wrote:
> On Wed, 28 Feb 2007, Gunter Winkler wrote:
> > * comparison: operators ==, != (for sparse types)
> > * useful default constructor (which has to construct the zero element)

> I did not understand your statement (MyMatrix has to behave like a
> scalar). Can't ublas infer the type (vector) and drive the corresponding
> operator on the elements ?

Yes, this is exactly what ublas does. However, the two points mentioned above
are not defined for any ublas matrix class. Thus you have to use something
like bounded_matrix and provide an operator==() and operator!=() for this
class.

Note, using a matrix of matrices cases some other problems, because the
product of two matrices is not commutative but ublas assumes this for
scalars. What do you want to do with a sparse matrix of sparse matrices?

mfg
Gunter