From: Paul A Bristow (pbristow_at_[hidden])
Date: 2007-06-07 15:03:40
>[mailto:boost-bounces_at_[hidden]] On Behalf Of Brook Milligan
>Sent: 03 June 2007 19:45
>Subject: [boost] [Probability] release of probability library
>After figuring out the rudiments of bjam, I have released a version of
>the Probability library in the Boost Vault:
>My hope is that this makes it much easier to integrate into an
>existing Boost system for testing and use. I would greatly appreciate
>any comments and helpful suggestions for improvement. Once again, the
>main documentation is available at
>Thank you very much for any helpful reviews.
As usual, bjam produced a myriad of error messages.
For MSVC 8.0
1 I found I needed to suppress
// Need to suppress warning in all examples until boost/concept_check.hpp does it (ticket #813).
# pragma warning(disable: 4100) // 'b' : unreferenced formal parameter
2 return probability(exp(-lambda) * pow(lambda, static_cast<double>(i)) / factorial(i));
static_cast to double or int - MSVC does not specialise for unsigned int (and say that one should not). int probably best?
3 Tests don't work with 1_34_0 version of tests.
#define BOOST_TEST_MODULE probability_tests
in place of #define BOOST_AUTO_TEST_MAIN
and #define BOOST_TEST_DYN_LINK
and BOOST_AUTO_UNIT_TEST to BOOST_AUTO_TEST_CASE (test_validator_concept) ... throughout.
4 log1p is not provided by MSVC math.h, but I added
5 I had to replace log(v) and exp(v) with casts like
exp(static_cast<Value>(v) to avoid ambiguity.
Running 24 test cases...
*** No errors detected
for debug and release
But I also don't see why
// XXX - why can't operator<<(std::ostream&, ...) be used?
You have disabled this with
I:\boost_1_34_0\boost/test/test_tools.hpp(298) : error C2679: binary '<<' : no operator found which takes a right-hand operand of
type 'const likelihood' (or there is no acceptable conversion)
C:\Program Files\Microsoft Visual Studio 8\VC\include\ostream(650): could be 'std::basic_ostream<_Elem,_Traits>
&std::operator <<<char,std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,const char *)' [found using argument-dependent
Example 2 produces many warnings
'initializing' : conversion from 'const double' to 'float', possible loss of data
that I presume are expected as value is of type float.
Example 6 produces warning C4101: 'c' : unreferenced local variable
that could be commented out
example 5 I'm a bit puzzled what it does/shows - none of the functions are called?
Examples 6 lots of errors like
..\..\libs\probability\test\example6.cpp(139) : error C2039: 'universal_time' : is not a member of 'boost::posix_time'
..\..\libs\probability\test\example6.cpp(139) : error C3861: 'universal_time': identifier not found
..\..\libs\probability\test\example6.cpp(143) : error C3083: 'microsec_clock': the symbol to the left of a '::' must be a type
Is this a change in 1_34_0? I will investigate but suggestions?
I am also re-reading the documentation ;-)
Finally I note the thorough - indeed exemplary - use of testing and concepts :-)
--- Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB +44 1539561830 & SMS, Mobile +44 7714 330204 & SMS pbristow_at_[hidden]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk