Boost logo

Boost :

From: Leopoldo Peralta (lperalta_at_[hidden])
Date: 2007-07-01 15:41:04


I went to the current SVN and updated the log1.hpp file in my Boost
installation. The same error that I reported occurs.

Going deeper into my Boost based project , I found that this particular
error happens only when the Boost Rational Library is included.

For example, this code works fine:

#define BOOST_MATH_THROW_ON_DOMAIN_ERROR

#include <boost/math/distributions/students_t.hpp>
#include <boost/math/special_functions/log1p.hpp>
#include <iomanip>

using namespace boost::math;

int _tmain(int argc, _TCHAR* argv[])
{
        double d = log1p(5.78);
        students_t_distribution<float> d3(12);
}

However, this one will prevent compiling:

#define BOOST_MATH_THROW_ON_DOMAIN_ERROR

#include <boost/rational.hpp> // <----- Causes Error

#include <boost/math/distributions/students_t.hpp>
#include <boost/math/special_functions/log1p.hpp>
#include <iomanip>

using namespace boost::math;

int _tmain(int argc, _TCHAR* argv[])
{
        double d = log1p(5.78);
        students_t_distribution<float> d3(12);
}

Error is:

C:\boost_1_34_0_beta\boost_1_34_0\boost\math\special_functions\log1p.hpp(83)
: error C2784: 'boost::rational<IntType> boost::abs(const
boost::rational<IntType> &)' : could not deduce template argument for 'const
boost::rational<IntType> &' from
'boost::math::tools::promote_args<T1,T2,T3,T4,T5,T6>::type'
        with
        [
            T1=double,
            T2=float,
            T3=float,
            T4=float,
            T5=float,
            T6=float
        ]

It seems to me that boost\math\tools\promotion.hpp tool may need some fix to
avoid this conflicting interaction between Boost::Rational and
Boost::MathToolKit

Leopoldo

-----Mensaje original-----
De: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]] En
nombre de John Maddock
Enviado el: Sunday, July 01, 2007 11:01 AM
Para: boost_at_[hidden]
Asunto: Re: [boost] [math toolkit]

Leopoldo Peralta wrote:
> This Error occurs (MSVC 2003 + SP1) when calling boost::math::log1p

Hopefully this has been fixed in current SVN, see
http://svn.boost.org/trac/boost/browser/sandbox/math_toolkit/boost/math/spec
ial_functions/log1p.hpp

If not, let me have a test case and I'll look into it.

HTH, John.

_______________________________________________
Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk