Changeset 3912


Ignore:
Timestamp:
May 19, 2020, 12:07:28 AM (2 weeks ago)
Author:
Peter
Message:

boost random classes beta_distribution, hyperexponential_distribution
and laplace_distribution are not available with boost 1.53. Similar to
non_central_chi_squared (refs #944) these classes are only used in a
typedef, so we exclude these typedefs when the classes were not found
in configure. Lifting out tests of these classes to their own tests,
so these tests can return SKIP.

Location:
trunk
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r3907 r3912  
    414414    AC_MSG_RESULT([no])
    415415  ])
     416
     417# test if boost::random::beta_distribution<> is available in header
     418# file <boost/random/non_central_chi_squared_distribution.hpp>
     419AC_COMPILE_IFELSE([
     420  AC_LANG_PROGRAM(
     421      [@%:@include <boost/random/beta_distribution.hpp>],
     422      [boost::random::beta_distribution<> foo])
     423], [
     424  AC_DEFINE([YAT_HAVE_BOOST_RANDOM_BETA_DISTRIBUTION],
     425            [1],
     426            [Define to 1 if boost::random::beta_distribution<> is available])
     427])
     428
     429
     430# test if boost::random::hyperexponential_distribution is available in header
     431# file <boost/random/hyperexponential_distribution.hpp>
     432AC_COMPILE_IFELSE([
     433  AC_LANG_PROGRAM(
     434      [@%:@include <boost/random/hyperexponential_distribution.hpp>],
     435      [boost::random::hyperexponential_distribution<> foo])
     436], [
     437  AC_DEFINE([YAT_HAVE_BOOST_RANDOM_HYPEREXPONENTIAL_DISTRIBUTION],
     438            [1],
     439            [Define to 1 if boost::random::hyperexponential_distribution<> is available])
     440])
     441
     442
     443# test if boost::random::laplace_distribution is available in header
     444# file <boost/random/laplace_distribution.hpp>
     445AC_COMPILE_IFELSE([
     446  AC_LANG_PROGRAM(
     447      [@%:@include <boost/random/laplace_distribution.hpp>],
     448      [boost::random::laplace_distribution<> foo])
     449], [
     450  AC_DEFINE([YAT_HAVE_BOOST_RANDOM_LAPLACE_DISTRIBUTION],
     451            [1],
     452            [Define to 1 if boost::random::laplace_distribution<> is available])
     453])
     454
     455
    416456# test if boost::random::non_central_chi_squared_distribution<> is
    417457# available in header file
     
    427467])
    428468
    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])
    432469
    433470# check for hts and samtools available from http://www.htslib.org
  • trunk/test/Makefile.am

    r3902 r3912  
    4949  test/bam_pair_iterator.test \
    5050  test/bam_pair_iterator2.test \
     51  test/beta_distribution.test \
    5152  test/binary_read_write.test \
    5253  test/chi2.test \
     
    7475  test/getvector.test \
    7576  test/gff.test test/help.test test/histogram.test \
     77  test/hyperexponential_distribution.test \
    7678  test/igp.test test/index.test test/inputranker.test test/interpolation.test \
    7779  test/iterator.test test/kendall.test test/kernel_lookup.test \
    7880  test/kernel_matrix.test \
    7981  test/kernel_pca.test test/kernel.test \
    80   test/knn.test test/kolmogorov_smirnov.test test/large_file.test \
     82  test/knn.test test/kolmogorov_smirnov.test \
     83  test/laplace_distribution.test \
     84  test/large_file.test \
    8185  test/libbam.test \
    8286  test/likelihood_ratio_test_binomial.test \
  • trunk/test/random_distribution.cc

    r3900 r3912  
    7878
    7979  test_discrete<random::Bernoulli>();
    80   test_discrete<random::Beta>();
    8180  test_discrete<random::NegativeBinomial>();
    82   test_discrete<random::Hyperexponential>();
    8381  test_discrete<random::Weibull>();
    84   test_discrete<random::Laplace>();
    8582
    8683  test_continuous<random::Cauchy>();
  • trunk/yat/random/DiscreteDistribution.h

    r3898 r3912  
    2929
    3030#include <boost/random/bernoulli_distribution.hpp>
     31#ifdef YAT_HAVE_BOOST_RANDOM_BETA_DISTRIBUTION
    3132#include <boost/random/beta_distribution.hpp>
     33#endif
     34#ifdef YAT_HAVE_BOOST_RANDOM_HYPEREXPONENTIAL_DISTRIBUTION
    3235#include <boost/random/hyperexponential_distribution.hpp>
     36#endif
     37#ifdef YAT_HAVE_BOOST_RANDOM_LAPLACE_DISTRIBUTION
    3338#include <boost/random/laplace_distribution.hpp>
     39#endif
    3440#include <boost/random/negative_binomial_distribution.hpp>
    3541#include <boost/random/weibull_distribution.hpp>
     
    95101
    96102     \since New in yat 0.18
     103
     104     \note beta_distribution is not available in older boost
    97105   */
     106#ifdef YAT_HAVE_BOOST_RANDOM_BETA_DISTRIBUTION
    98107  typedef DiscreteDistribution<boost::random::beta_distribution<> > Beta;
     108#endif
    99109
    100110  /**
     
    104114
    105115     \since New in yat 0.18
     116
     117     \note hyperexponential_distribution is not available in older boost
    106118   */
     119#ifdef YAT_HAVE_BOOST_RANDOM_HYPEREXPONENTIAL_DISTRIBUTION
    107120  typedef
    108121  DiscreteDistribution<boost::random::hyperexponential_distribution<> >
    109122  Hyperexponential;
     123#endif
    110124
    111125  /**
     
    115129
    116130     \since New in yat 0.18
     131
     132     \note laplace_distribution is not available in older boost
    117133   */
     134#ifdef YAT_HAVE_BOOST_RANDOM_LAPLACE_DISTRIBUTION
    118135  typedef DiscreteDistribution<boost::random::laplace_distribution<> > Laplace;
     136#endif
    119137
    120138  /**
  • trunk/yat/utility/config_public.h.in

    r3900 r3912  
    3939#endif
    4040#endif
     41
     42/// Define to 1 if boost::random::beta_distribution is available in
     43/// header file <boost/random/beta_distribution.hpp>
     44#undef YAT_HAVE_BOOST_RANDOM_BETA_DISTRIBUTION
     45
     46/// Define to 1 if boost::random::hyperexponential_distribution is
     47/// available in header file <boost/random/hyperexponential_distribution.hpp>
     48#undef YAT_HAVE_BOOST_RANDOM_HYPEREXPONENTIAL_DISTRIBUTION
     49
     50/// Define to 1 if boost::random::laplace_distribution is
     51/// available in header file <boost/random/laplace_distribution.hpp>
     52#undef YAT_HAVE_BOOST_RANDOM_LAPLACE_DISTRIBUTION
    4153
    4254/// Define to 1 if boost::random::non_central_chi_squared_distribution
Note: See TracChangeset for help on using the changeset viewer.