Boost logo

Ublas :

From: Preben Hagh Strunge Holm (preben_at_[hidden])
Date: 2007-03-12 07:23:05


> Yes. There are a lot of these "structure checks" in ublas. They always compare
> the results of a slow, known to be working algorithm with the results of
> the "optimal" algorithm. (This is one reason because the debug version of
> ublas is much slower than the release version.) These checks were implemented
> in order to catch internal errors and misuse of functions. Unfortunately they
> sometimes throw on legal code which is close to misuse.
>
>> dGv is actually supposed to be very small! Actually this is a measure of
>> the error!
>>
>> This is really a strange "error" for me since the product of a matrix
>> and a vector should be able to be anything!
>
> Yes. But if the input data has only a few significant bits, the _order_ of
> computation heavily influences the result. This is a situtation which should
> be avoided and thus the error is thrown. I think the error message should be
> modified to express this.

Yeah okay - but actually the optimized expression could be more correct
than the dense?

>> And why is the problem not present running without optimization and a
>> problem when using optimization!
>
> This may be because the order of computations might be different for different
> compiler options (try to force IEEE float arithmetic to check this). However,
> the error should not appear when compiling with -DNDEBUG.

No - it doesn't... So I'm very happy. until I need to debug next - I'll
try out the defines you proposed.

I'm not much of a gcc-hacker, but since there are hundreds of flags - do
you remember which one to set if I use gcc/g++?

Thanks

Best regards,
Preben Holm