Boost logo

Ublas :

From: Max Weinberg (max.weinberg_at_[hidden])
Date: 2006-03-01 09:21:30


Here is what I use. I think I posted a previous version of this before. The
code is made for sparse matrices. It will most likely work for dense
matrices as well, but it won't be efficient. There should be a special
version for this case. The code supports comparison of different matrix
types, but I am not sure anymore which combinations will work, because I
somehow lost my test code :-). It is possible to specify a functor that
carries out the element comparison; if nothing is specified the default is
std::is_equal. Usage is:

#include "isequal.h"
class MyDoubleComparator{
...
};
...
IsEqualMat<MyDoubleComparator> isequal;
const double eps=0.1;
isequal(doublemat1, doublemat2, MyDoubleComparator(eps) );

Bye, Max Weinberg
___________________________________________________________________________
mymail - der unschlagbare und kostenlose E-Mail-Dienst der Schweiz!
http://mymail.ch/?redirect=9999
Bei uns finden Sie trendige Geschenkideen und Wohnaccessoires!
http://mymail.ch/?redirect=1610