Changeset 2673


Ignore:
Timestamp:
Dec 3, 2011, 1:30:12 AM (11 years ago)
Author:
Peter
Message:

merge release 0.8 into trunk

Location:
trunk
Files:
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/NEWS

    r2617 r2673  
    1010yat 0.8.x series from http://dev.thep.lu.se/yat/svn/branches/0.8-stable
    1111
    12 version 0.8 (released DATE)
     12version 0.8 (released 2 December 2011)
    1313  - Rule for when to use approximation in ROC::p_value modified (ticket #677)
    1414  - Discrete::seed, Continuous::seed, Discrete::seed_from_devurandom,
  • trunk/build_support/tag_and_release.sh.in

    r2608 r2673  
    5151cat <<EOF
    5252
    53 Please report bugs by mail to @PACKAGE_BUGREPORT@ 
     53Please report bugs by mail to @PACKAGE_BUGREPORT@
    5454
    5555This release was bootstrapped with the following tools:
     
    6363earlier versions at
    6464
    65   http://dev.thep.lu.se/yat/browser/tags/@VERSION@/NEWS     
     65  http://dev.thep.lu.se/yat/browser/tags/@VERSION@/NEWS
    6666
    6767EOF
  • trunk/configure.ac

    r2628 r2673  
    8787AC_PROG_SED
    8888AC_PROG_LIBTOOL
     89
     90# find the compiler vendor: gnu, intel, etc
     91AX_COMPILER_VENDOR
    8992
    9093have_doxygen=no
     
    199202YAT_CPP_ADD_FLAG([CPPFLAGS], [$BOOST_CPPFLAGS])
    200203
     204# see tickets #648 #687
     205AC_MSG_CHECKING([whether constructor in boost concept is supported])
     206AC_COMPILE_IFELSE([
     207  AC_LANG_PROGRAM(
     208    [
     209     @%:@include <boost/concept_check.hpp>
     210     template <typename T>
     211     class MyConcept
     212     {
     213     public:
     214       MyConcept(void) {}
     215       BOOST_CONCEPT_USAGE(MyConcept){}
     216     };
     217    ],[
     218     MyConcept<double> x;
     219     x = x;
     220    ])
     221  ],
     222  [AC_MSG_RESULT([yes])
     223   AC_DEFINE([YAT_HAVE_BOOST_CONCEPT_WITH_CONSTRUCTOR],[1],
     224             [define if compiler supports boost concept with constructor])
     225  ],
     226  [AC_MSG_RESULT([no])]
     227)
     228
     229
    201230#support for large files
    202231AC_SYS_LARGEFILE
     
    209238# building yat, i.e., they are not needed for a user of yat and are
    210239# not propagated to yat-config or yat.m4.
    211 YAT_CXX_ADD_FLAG([INTERNAL_CXXFLAGS], [-Wall -pedantic])
     240AS_IF([test x"$ax_cv_cxx_compiler_vendor" = x"gnu"], [
     241  YAT_CXX_ADD_FLAG([INTERNAL_CXXFLAGS], [-Wall -pedantic])
     242])
    212243YAT_CPP_ADD_FLAG([INTERNAL_CPPFLAGS], [-DHAVE_INLINE=1])
    213244AC_ARG_ENABLE([debug],
     
    223254  YAT_CXX_ADD_FLAG([INTERNAL_CXXFLAGS], [-O3])
    224255fi
     256
     257# turn off compiler warning #654 from intel compiler
     258AS_IF([test x"$ax_cv_cxx_compiler_vendor" = x"intel"], [
     259  YAT_CXX_ADD_FLAG([CXXFLAGS], ['-diag-disable 654'])
     260])
    225261
    226262# some versions of boost uses long long - turn off compiler warnings
     
    258294   outfile=`echo $f | sed 's,Makefile,doxygen.mk,'`;
    259295   test -e $outfile || echo '# dummie' > $outfile;
     296   stampfile=`echo $f | sed 's,Makefile,dx-stamp,'`;
     297   # if doxygen.mk is a dummie version remove stamp-file to ensure make
     298   # rule is triggered to generate real doxygen.mk
     299   head -n 1 $outfile | $GREP -v '^# dummie' > /dev/null \
     300   || { rm -f $stampfile && need_sleep=1; }
    260301esac
    261302done
     303# avoid time stamp ties between doxygen.mk and its dx-stamp
     304test x$need_sleep = x1 && sleep 2
    262305])
    263306
  • trunk/m4/version.m4

    r2617 r2673  
    2121
    2222#
    23 # Set version numbers, see http://apr.apache.org/versioning.html 
     23# Set version numbers, see http://apr.apache.org/versioning.html
    2424#
    2525# MAJOR - Modify when incompatible changes are made
     
    6969# yat-0.7.2  4:2:0
    7070# yat-0.7.3  4:3:0
     71# yat-0.8.0  5:0:0
    7172#
    7273# *Accidently, the libtool number was not updated for yat 0.5
  • trunk/test/Makefile.am

    r2662 r2673  
    200200
    201201yat-hello-check: $(srcdir)/yat-hello-1.0.tar.gz
    202   GZIP=$(GZIP_ENV) gzip -dc $< | $(am__untar) \
     202  GZIP=$(GZIP_ENV) gzip -dc $(srcdir)/yat-hello-1.0.tar.gz | $(am__untar) \
    203203  && cd yat-hello-1.0 \
    204204  && ./configure --with-yat=$(bindir) \
  • trunk/test/commandline.cc

    r2608 r2673  
    540540  {
    541541    int ac = 3;
    542     const char* cav[] = { "test_prog", "-n" "-1"};
     542    const char* cav[] = { "test_prog", "-n", "-1"};
    543543    char** av = stradup(cav, ac);
    544544    try{
  • trunk/test/utility.cc

    r2608 r2673  
    6767
    6868int main(int argc, char* argv[])
    69 { 
     69{
    7070  using namespace theplu::yat;
    7171  test::Suite suite(argc, argv);
     
    123123
    124124  }
    125  
     125
    126126  // testing trailing values
    127127  s=" 23 23   ";
     
    147147  suite.add(utility::convert(1.23)=="1.23");
    148148  suite.add(utility::convert(1)=="1");
     149
     150  suite.add(utility::is<unsigned int>("1"));
     151  suite.add(!utility::is<unsigned int>("   "));
     152  suite.add(!utility::is<unsigned int>("   -1"));
     153  // test -1 cannot be assigned to unsigned int
     154  try {
     155    unsigned int x = utility::convert<unsigned int>("-1");
     156    suite.err() << "convert<unsigned>(\"-1\") did not throw\n";
     157    suite.err() << "x: " << x << "\n";
     158    suite.add(false);
     159    exit(1);
     160  }
     161  catch (std::runtime_error& e) {
     162    suite.out() << "expected error: " << e.what() << "\n";
     163  }
    149164
    150165  if (!suite.add(utility::is<double>("-inf")))
     
    219234  B b;
    220235
    221   utility::compose_f_gx_hy<B, U1, U2> binary = 
     236  utility::compose_f_gx_hy<B, U1, U2> binary =
    222237    utility::make_compose_f_gx_hy(b, u1, u2);
    223238
    224   utility::compose_f_gxy<U2, B> binary2 = 
     239  utility::compose_f_gxy<U2, B> binary2 =
    225240    utility::make_compose_f_gxy(u2, b);
    226241
    227   utility::compose_f_gx<U1, U2> unary = 
     242  utility::compose_f_gx<U1, U2> unary =
    228243    utility::make_compose_f_gx(u1, u2);
    229244}
     
    256271  }
    257272  catch (std::runtime_error& e) {
    258     suite.out() << "expected exception thrown with what() = " 
     273    suite.out() << "expected exception thrown with what() = "
    259274                << e.what() << "\n";
    260275  }
     
    318333  std::istringstream iss(str);
    319334  std::vector<std::vector<double> > double_m;
    320   utility::load(iss, double_m);
     335  utility::load(iss, double_m, '\0', '\n');
    321336  suite.add(double_m.size()==2);
    322337
     
    325340  std::istringstream iss2(str);
    326341  std::vector<std::vector<std::string> > str_m;
    327   utility::load(iss2, str_m);
     342  utility::load(iss2, str_m, '\0', '\n');
    328343  std::cout << str_m.size() << std::endl;
    329344  for (size_t i=0; i<str_m.size(); ++i)
     
    388403                     static_cast<size_t>(distance(first, iter))) ) {
    389404        suite.err() << "test_inverse_validate() failed\n";
    390         suite.err() << "  comparing: " << map_iter->second[i] 
    391                     << " and " << distance(first, iter) 
     405        suite.err() << "  comparing: " << map_iter->second[i]
     406                    << " and " << distance(first, iter)
    392407                    << " expected them to be equal\n";
    393408      }
     
    405420    suite.add(*(first + iter->second) == iter->first);
    406421  }
    407  
     422
    408423}
    409424
     
    426441  else {
    427442    suite.add(false);
    428     suite.err() << "size mismatch: vec.size()=" << vec.size() 
    429                 << "vec2.size()=" << vec2.size() << "\n"; 
     443    suite.err() << "size mismatch: vec.size()=" << vec.size()
     444                << "vec2.size()=" << vec2.size() << "\n";
    430445  }
    431446  const utility::VectorConstView b(a, 0, 5, 2);
     
    437452  if (vec3.size()!=vec4.size()) {
    438453    suite.add(false);
    439     suite.err() << "size mismatch: vec3.size()=" << vec3.size() 
    440                 << " vec4.size()=" << vec4.size() << "\n"; 
     454    suite.err() << "size mismatch: vec3.size()=" << vec3.size()
     455                << " vec4.size()=" << vec4.size() << "\n";
    441456  }
    442457  else {
     
    453468  if (vec.size()!=vec5.size()) {
    454469    suite.add(false);
    455     suite.err() << "size mismatch: vec.size()=" << vec.size() 
    456                 << " vec5.size()=" << vec5.size() << "\n"; 
     470    suite.err() << "size mismatch: vec.size()=" << vec.size()
     471                << " vec5.size()=" << vec5.size() << "\n";
    457472  }
    458473  else {
  • trunk/test/yat_msg_error_test.sh

    r2622 r2673  
    3232cat >> configure.ac <<EOF
    3333YAT_MSG_ERROR([$specific_msg])
     34AC_PREREQ([2.64])
    3435AC_MSG_CHECKING([for something more])
    3536AC_MSG_RESULT([no])
  • trunk/test/yat_msg_error_test2.sh

    r2608 r2673  
    3030
    3131cat >> configure.ac <<EOF
     32AC_PREREQ([2.64])
    3233AS_IF([test x = x], [], [YAT_MSG_ERROR([some message])])
    3334AC_CONFIG_FILES([Makefile])
  • trunk/yat/statistics/AveragerWeighted.cc

    r2563 r2673  
    2323#include "AveragerWeighted.h"
    2424
     25#include <limits>
    2526#include <cmath>
    2627
  • trunk/yat/statistics/ROC.h

    r2603 r2673  
    241241      double pos2 = pos-pos1;
    242242      double neg2 = neg-neg1;
    243       result += gsl_ran_hypergeometric_pdf(i, pos, neg, n)
     243      result += gsl_ran_hypergeometric_pdf(i, static_cast<unsigned int>(pos),
     244                                           static_cast<unsigned int>(neg), n)
    244245        * p_exact_with_ties(iter, end,
    245246                            block - pos2*neg1 - 0.5*pos1*neg1,
  • trunk/yat/statistics/utility.h

    r2503 r2673  
    189189  double percentile(RandomAccessIterator first, RandomAccessIterator last,
    190190                    double p, bool sorted=false) YAT_DEPRECATE;
    191  
    192191
    193192  /**
     
    286285  template <class RandomAccessIterator>
    287286  double percentile(RandomAccessIterator first, RandomAccessIterator last,
    288                     double p, bool sorted=false)
     287                    double p, bool sorted)
    289288  {
    290289    BOOST_CONCEPT_ASSERT((boost::RandomAccessIterator<RandomAccessIterator>));
  • trunk/yat/utility/concept_check.h

    r2411 r2673  
    2323*/
    2424
     25// always include config first
     26#include "config_public.h"
     27
    2528#include "iterator_traits.h"
    2629
     
    5457  {
    5558  public:
     59#ifdef YAT_HAVE_BOOST_CONCEPT_WITH_CONSTRUCTOR
    5660    /// Default constructor
    5761    Container2D(void) {}
     62#endif
    5863
    5964    /// value_type
  • trunk/yat/utility/config_public.h.in

    r2431 r2673  
    11#ifndef _theplu_yat_utility_config_public_
    2 #define _theplu_yat_utility_config_public_ 
     2#define _theplu_yat_utility_config_public_
    33
    44// $Id$
     
    3131#undef YAT_HAVE_GCC_DEPRECATED
    3232
     33/// Define if compiler supports boost concept with constructor
     34#undef YAT_HAVE_BOOST_CONCEPT_WITH_CONSTRUCTOR
     35
    3336/// Version of yat in string format
    3437#undef YAT_VERSION
  • trunk/yat/utility/utility.h

    r2581 r2673  
    3535#include "Exception.h"
    3636
     37#include <algorithm>
     38#include <cctype>
    3739#include <cmath>
     40#include <functional>
    3841#include <limits>
     42#include <locale>
    3943#include <istream>
    4044#include <string>
     
    331335
    332336  template<typename T>
    333   void load(std::istream& is, std::vector<T>& vec, char sep='\0')
     337  void load(std::istream& is, std::vector<T>& vec, char sep)
    334338  {
    335339    detail::VectorPusher<T> pusher;
     
    352356  bool convert(const std::string& s, T& result)
    353357  {
     358    if (!std::numeric_limits<T>::is_signed) {
     359      // first non-whitespace character
     360      std::string::const_iterator iter = s.begin();
     361      while (iter!=s.end() && std::isspace(*iter))
     362        ++iter;
     363      // unsigned int cannot start with a '-' and with some compilers
     364      // operation ss >> result won't fail so catch it like this instead.
     365      if (iter==s.end() || *iter=='-')
     366        return false;
     367    }
    354368    std::istringstream ss(s);
    355369    ss >> result;
Note: See TracChangeset for help on using the changeset viewer.