Boost logo

Boost Users :

From: John Maddock (john_at_[hidden])
Date: 2007-08-11 04:53:10


NFarnsworth_at_[hidden] wrote:
> Hallo,
> I want to use the test function from the boost math toolkit library
> to compare simulation results of mechantronic systems with a
> reference solution.
> The test reads the reference solution from a file, and after the
> simulation the test compares the file data with the data from a
> double array.
> But if a value of a function is close to zero, I will get a gross
> relative error.
> Do you have any suggestion to solve this problem?
> Thanks for your help in advance

This is a tricky one: the "test" function is specifically set up to follow
the policies we use for our regression tests: it might not be ideal for
general use yet, which is why it's listed under "Internal Details and Tools
(Experimental)".

The first thing you need to do is decide what kind of policy you want for
comparison of the values - currently we treat all denormalised values as
"effectively zero", but otherwise calculate the maximum relative difference
between the values. I guess you would want to change the cutoff for "too
small to count" or else change the way the relative difference is
calculated - perhaps taking into account which value is the true value so we
measure relative error, rather than relative difference.

At present the only way to change the way this code behaves, is to treat it
as am example and do a cut and paste and modify to taste job on it.
However, I am interested in making this more generally useful to a wider
range of situations, so any ideas or feedback are most welcome.

John.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net