
Ublas : 
From: Michael Stevens (mail_at_[hidden])
Date: 20050503 07:38:24
On Tuesday 03 May 2005 12:29, Gunter Winkler wrote:
> On Tuesday 03 May 2005 11:22, Max Weinberg wrote:
> > Well, I don't care if it's called operator==, but there definitely should
> > be a way to compare matrices. Call it equal if you like and give it a
> > functor parameter that handles the element comparison.
> > Isn't that an easy exercise using the "matrix expressions"?
>
> BTW: Using norm_1(AB) or norm_inf(AB) is a O(n*m) or O(nnz) operation.
> Doing a elementwise comparison (optionally with short circuit) is O(n*m) or
> O(nnz), too. So there is no difference regarding the algorithmic
> complexity.
I think I see what Max wants: An 'equality' that uses a uBLAS "matrix
expressions".
Gunters suggests norm_inf(AB) seems to fit the bill perfectly. In user code I
think
if (norm_inf(AB) == 0)
.. equal
is nice linear algebra expression.
Has two small drawbacks.
a) norm_inf(AB) !=0 does not short circuit
b) Requires operator instead of operator == for elements. Only an issue if
you store non algebraic elements!
Is this good Max?
Michael