|
Ublas : |
From: Michael Stevens (mail_at_[hidden])
Date: 2005-05-02 12:09:10
On Monday 02 May 2005 13:58, Max Weinberg wrote:
> Hi,
> thanks for the patches, they seem to work
>
> > There was a line changing filled1_ in reserve(). Looks like
> > storage_invariants() work quite well
>
> The bug in reserve is also present in the 1.32 release version.
>
> > There is no way to usefully define an operator== of float matrices. But
> > there is already the (still undocumented?) equal function used by some
> > BOOST_CHECK(..) macros. Try this one. Alternativly you can always use
> > norm_inf(A-B) which returns zero if both matrices are equal.
>
> As far as I can see, "equals" also uses norm. Using norm makes sense only
> in rare cases, even if the involved matrices have numerical content. You
> don't want to compute a norm if 99% of the matrices you compare already
> differ in the first element.
Agree equals only of limited use. It is only used internally as a sanity
check. To do any better would require uBLAS to propagate error bounds for
complete expressions!
I agree with Gunter. We should not define operator== in such a case as it is
horribly missleading. In cases where C++ easily allows the user to provide
their own definition it is best the user do so.
Michael