|
Boost : |
From: Benedikt Weber (weber_at_[hidden])
Date: 2002-07-02 14:20:46
Joerg
Could you give me a hint why you have to compare floating point numbers
here. I was just thinking of some simple checks like if the dimensions of
matrices are consistent for a matrix product or for assignment. For that you
would only need to compare indices. Or compile-time checks which would
prevent you to assign a full matrix to a triangular one as I did in the
example.
Benedikt
"Joerg Walter" <jhr.walter_at_[hidden]> wrote
> The corresponding checks exist in the packed matrix evaluation:
>
> #ifdef NUMERICS_BOUNDS_CHECK_EX
> {
> // Need the const member dispatched.
> const M &cm = m;
> typename E::const_iterator1 it1e (e ().begin1 ());
> typename E::const_iterator1 it1e_end (e ().end1 ());
> while (it1e != it1e_end) {
> typename E::const_iterator2 it2e (it1e.begin ());
> typename E::const_iterator2 it2e_end (it1e.end ());
> while (it2e != it2e_end) {
> // FIXME: we need a better floating point
> comparison...
> check (*it2e == cm (it2e.index1 (), it2e.index2
()),
> bad_index ());
> ++ it2e;
> }
> ++ it1e;
> }
> }
> #endif
>
> but are currently disabled due to the usual problems with floating point
> arithmetic when checking too strict. I'll discuss with Mathias, how to
> install a customizable comparator.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk