Re: rounding error in distribution.cpp

Posted by leibniz777 on
URL: http://quantlib.414.s1.nabble.com/rounding-error-in-distribution-cpp-tp7994p7997.html

I have not this version of the constructor. Where can I find it?



Jose Aparicio-Navarro wrote
Quoting Oliver Klehn <oklehn@gmx.de>:

> When using the synthetic cdo pricing engine sometimes there is thrown an
> error by the file Distribution::locate:
> Although it is true that "x >= x_.front() && x <= x_.back() + dx_.back()" in
> the QL_REQUIRE function sometimes there is thrown an error because the
> condition is not fulfilled due to rounding errors.

I am not 100% sure it is the same problem without sample code but there has been
a fix for this recently. Can you check out you have this version of the
constructor?:

    Distribution::Distribution (int nBuckets, Real xmin, Real xmax)
    //-------------------------------------------------------------------------
        : size_(nBuckets),
          xmin_(xmin), xmax_(xmax), count_(nBuckets),
[...]
        // ensure we match exactly the domain, otherwise we might fail the
        //   locate test because of precission mismatches
        dx_.back() = xmax - x_.back();
    }

Best regards
Pepe

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
QuantLib-users mailing list
QuantLib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/quantlib-users