Changeset 3900


Ignore:
Timestamp:
May 3, 2020, 10:29:25 AM (3 years ago)
Author:
Peter
Message:

closes #944; add configure check whether class is availabale in boost and exclude typedef if not. Lift out test for that typedef to separate test so it can be skipped (without skipping all sister tests) when boost is old.

Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r3896 r3900  
    414414    AC_MSG_RESULT([no])
    415415  ])
    416 
     416# test if boost::random::non_central_chi_squared_distribution<> is
     417# available in header file
     418# <boost/random/non_central_chi_squared_distribution.hpp>
     419AC_COMPILE_IFELSE([
     420  AC_LANG_PROGRAM(
     421      [@%:@include <boost/random/non_central_chi_squared_distribution.hpp>],
     422      [boost::random::non_central_chi_squared_distribution<> foo])
     423], [
     424  AC_DEFINE([YAT_HAVE_BOOST_RANDOM_NON_CENTRAL_CHI_SQUARED_DISTRIBUTION],
     425            [1],
     426            [Define to 1 if boost::random::non_central_chi_squared_distribution<> is available])
     427])
     428
     429#      AC_DEFINE([YAT_HAVE_BOOST_RANDOM_NON_CENTRAL_CHI_SQUARED_DISTRIBUTION],
     430#               [1],
     431#               [define if boost::random::non_central_chi_squared_distribution<> is available])
    417432
    418433# check for hts and samtools available from http://www.htslib.org
  • trunk/test/Makefile.am

    r3898 r3900  
    9090  test/negative_binomial_distribution.test \
    9191  test/nni.test test/normalization.test \
     92  test/non_central_chi_squared_distribution.test \
    9293  test/ostream_iterator.test \
    9394  test/pca.test \
  • trunk/test/random_distribution.cc

    r3898 r3900  
    9090  test_continuous<random::Gamma>();
    9191  test_continuous<random::Lognormal>();
    92   test_continuous<random::NonCentralChiSquared>();
    9392  test_continuous<random::StudentT>();
    9493
  • trunk/yat/random/ContinuousDistribution.h

    r3898 r3900  
    3434#include <boost/random/gamma_distribution.hpp>
    3535#include <boost/random/lognormal_distribution.hpp>
     36#ifdef YAT_HAVE_BOOST_RANDOM_NON_CENTRAL_CHI_SQUARED_DISTRIBUTION
    3637#include <boost/random/non_central_chi_squared_distribution.hpp>
     38#endif
    3739#include <boost/random/student_t_distribution.hpp>
    3840
     
    135137
    136138     \since New in yat 0.18
     139
     140     \note non_central_chi_squared_distribution is not available in
     141     older boost (it does exist in boost 1.59)
    137142   */
     143#ifdef YAT_HAVE_BOOST_RANDOM_NON_CENTRAL_CHI_SQUARED_DISTRIBUTION
    138144  typedef
    139145  ContinuousDistribution<boost::random::non_central_chi_squared_distribution<> >
    140146  NonCentralChiSquared;
     147#endif
    141148
    142149  /**
  • trunk/yat/utility/config_public.h.in

    r3899 r3900  
    3939#endif
    4040#endif
     41
     42/// Define to 1 if boost::random::non_central_chi_squared_distribution
     43/// is available in header file
     44/// <boost/random/non_central_chi_squared_distribution.hpp>
     45#undef YAT_HAVE_BOOST_RANDOM_NON_CENTRAL_CHI_SQUARED_DISTRIBUTION
    4146
    4247/// Define to 1 if htslib is available
Note: See TracChangeset for help on using the changeset viewer.