Changes from tags/0.6.2 at r4334 to tags/0.6.3 at r4334


Ignore:
Location:
tags/0.6.3
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • tags/0.6.3/NEWS

    r4334 r4334  
    44
    55yat 0.6.x series from http://dev.thep.lu.se/yat/svn/branches/0.6-stable
     6
     7Version 0.6.3 (released 21 December 2010)
     8
     9  - fixed overflow in statistics::Fisher (#638)
     10  - fixed bug that double was hard-coded in function load<T>(6) (r2271)
     11
     12  A complete list of closed tickets can be found here [[br]]
     13  http://dev.thep.lu.se/yat/query?status=closed&milestone=yat+0.6.3
    614
    715Version 0.6.2 (released 18 May 2010)
  • tags/0.6.3/build_support/Makefile.am

    r4334 r4334  
    5353  -e 's|@PACKAGE_BUGREPORT[@]|$(PACKAGE_BUGREPORT)|g' \
    5454  -e 's|@PACKAGE_URL[@]|$(PACKAGE_URL)|g' \
    55   -e 's|@ECHO[@]|$(ECHO)|g' \
    5655  -e 's|@VERSION[@]|$(VERSION)|g' \
    5756  -e 's|@YAT_MAJOR_VERSION[@]|$(YAT_MAJOR_VERSION)|g' \
     
    6766yat-config: Makefile $(srcdir)/yat-config.in
    6867  @rm -f $@ $@.tmp
    69   @$(ECHO) "#! $(SHELL)" > $@.tmp
    70   @$(ECHO) "# $@ generated by make from yat-config.in" >> $@.tmp
     68  @echo "#! $(SHELL)" > $@.tmp
     69  @echo "# $@ generated by make from yat-config.in" >> $@.tmp
    7170  @$(edit) '$(srcdir)/$@.in' >>$@.tmp
    7271  @chmod +x $@.tmp
    7372  @chmod a-w $@.tmp
    7473  @mv $@.tmp $@
    75   @$(ECHO) creating $@
     74  @echo creating $@
    7675
    7776yat.pc: Makefile $(srcdir)/yat.pc.in
    7877  @rm -f $@ $@.tmp
    79   @$(ECHO) "# $@ generated by make from yat.pc.in" > $@.tmp
     78  @echo "# $@ generated by make from yat.pc.in" > $@.tmp
    8079  @$(edit) '$(srcdir)/$@.in' >>$@.tmp
    8180  @chmod a-w $@.tmp
    8281  @mv $@.tmp $@
    83   @$(ECHO) creating $@
     82  @echo creating $@
    8483
    8584install-exec-hook:
  • tags/0.6.3/build_support/yat-config.in

    r4334 r4334  
    9393    case "$1" in
    9494    --prefix)
    95     @ECHO@ $prefix
     95    echo $prefix
    9696    exit 0
    9797    ;;
    9898    --bindir)
    99     @ECHO@ $bindir
     99    echo $bindir
    100100    exit 0
    101101    ;;
    102102    --includedir)
    103     @ECHO@ $includedir
     103    echo $includedir
    104104    exit 0
    105105    ;;
    106106    --libdir)
    107     @ECHO@ $libdir
     107    echo $libdir
    108108    exit 0
    109109    ;;
    110110    --cxx)
    111     @ECHO@ $CXX
     111    echo $CXX
    112112    exit 0
    113113    ;;
    114114    --cxxcpp)
    115     @ECHO@ $CXXCPP
     115    echo $CXXCPP
    116116    exit 0
    117117    ;;
     
    165165    ;;
    166166    --atleast-version=*)
    167       optarg=`@ECHO@ "$1" | sed 's/--atleast-version=//'`
    168       min_major=`@ECHO@ "$optarg" | sed 's/\([0-9]*\).*/\1/'`
     167      optarg=`echo "$1" | sed 's/--atleast-version=//'`
     168      min_major=`echo "$optarg" | sed 's/\([0-9]*\).*/\1/'`
    169169      if test "$optarg" = "$min_major"; then
    170170         min_minor="0";
    171171      else
    172          min_minor=`@ECHO@ "$optarg" | sed 's/[0-9]*.\([0-9]*\).*/\1/'`
     172         min_minor=`echo "$optarg" | sed 's/[0-9]*.\([0-9]*\).*/\1/'`
    173173      fi
    174174      if test "$optarg" = "$min_major.$min_minor"; then
    175175         min_patch="0";
    176176      else
    177          min_patch=`@ECHO@ "$optarg" | sed 's/[0-9]*.[0-9]*.\([0-9]*\).*/\1/'`
     177         min_patch=`echo "$optarg" | sed 's/[0-9]*.[0-9]*.\([0-9]*\).*/\1/'`
    178178      fi
    179179      if test "$optarg" = "$min_patch"; then
     
    198198    ;;
    199199    --version)
    200     @ECHO@ @VERSION@
     200    echo @VERSION@
    201201    exit 0
    202202    ;;
    203203    --version-major)
    204     @ECHO@ @YAT_MAJOR_VERSION@
     204    echo @YAT_MAJOR_VERSION@
    205205    exit 0
    206206    ;;
    207207    --version-minor)
    208     @ECHO@ @YAT_MINOR_VERSION@
     208    echo @YAT_MINOR_VERSION@
    209209    exit 0
    210210    ;;
    211211    --version-patch)
    212     @ECHO@ @YAT_PATCH_VERSION@
     212    echo @YAT_PATCH_VERSION@
    213213    exit 0
    214214    ;;
     
    243243     fi
    244244   done
    245    @ECHO@ $unique_flags
     245   echo $unique_flags
    246246fi
    247247
  • tags/0.6.3/configure.ac

    r4334 r4334  
    8181AC_PROG_SED
    8282AC_PROG_LIBTOOL
    83 # fall back to echo unless ECHO not already set (by libtool)
    84 AS_IF([test "x$ECHO" = x], [ECHO=echo])
    85 AC_SUBST(ECHO)
    8683
    8784AC_MSG_NOTICE(dnl
  • tags/0.6.3/doc/Makefile.am

    r4334 r4334  
    66# Copyright (C) 2005 Peter Johansson
    77# Copyright (C) 2006, 2007, 2008 Jari Häkkinen, Peter Johansson
    8 # Copyright (C) 2009 Peter Johansson
     8# Copyright (C) 2009, 2010 Peter Johansson
    99#
    1010# This file is part of the yat library, http://dev.thep.lu.se/yat
     
    7979
    8080$(DX_HTML_OUTPUT)/index.html: $(DOXYGEN_DEPS)
    81   @(cat doxygen.config && $(ECHO) "INPUT = $(DOXYGEN_INPUT)" && \
    82   $(ECHO) GENERATE_HTML = YES) | $(DOXYGEN) -;
     81  @(cat doxygen.config && echo "INPUT = $(DOXYGEN_INPUT)" && \
     82  echo GENERATE_HTML = YES) | $(DOXYGEN) -;
    8383
    8484$(DX_LATEX_OUTPUT)/refman.tex: $(DOXYGEN_DEPS)
    85   @(cat doxygen.config && $(ECHO) "INPUT = $(DOXYGEN_INPUT)" && \
    86   $(ECHO) GENERATE_LATEX = YES) | $(DOXYGEN) -;
     85  @(cat doxygen.config && echo "INPUT = $(DOXYGEN_INPUT)" && \
     86  echo GENERATE_LATEX = YES) | $(DOXYGEN) -;
    8787
    8888$(PACKAGE).dvi: $(DX_LATEX_OUTPUT)/refman.tex
     
    132132    test -z "$(dvidir)" || $(MKDIR_P) "$(DESTDIR)$(dvidir)";\
    133133    $(INSTALL_DATA) $(PACKAGE).dvi "$(DESTDIR)$(dvidir)/$(PACKAGE).dvi"; \
    134     $(ECHO) "$(INSTALL_DATA) $(PACKAGE).dvi $(DESTDIR)$(dvidir)/$(PACKAGE).dvi";\
     134    echo "$(INSTALL_DATA) $(PACKAGE).dvi $(DESTDIR)$(dvidir)/$(PACKAGE).dvi";\
    135135  fi
    136136
     
    139139    test -z "$(psdir)" || $(MKDIR_P) "$(DESTDIR)$(psdir)";\
    140140    $(INSTALL_DATA) $(PACKAGE).ps "$(DESTDIR)$(psdir)/$(PACKAGE).ps"; \
    141     $(ECHO) "$(INSTALL_DATA) $(PACKAGE).ps $(DESTDIR)$(psdir)/$(PACKAGE).ps";\
     141    echo "$(INSTALL_DATA) $(PACKAGE).ps $(DESTDIR)$(psdir)/$(PACKAGE).ps";\
    142142  fi
    143143
     
    146146    test -z "$(pdfdir)" || $(MKDIR_P) "$(DESTDIR)$(pdfdir)";\
    147147    $(INSTALL_DATA) $(PACKAGE).pdf "$(DESTDIR)$(pdfdir)/$(PACKAGE).pdf"; \
    148     $(ECHO) "$(INSTALL_DATA) $(PACKAGE).pdf $(DESTDIR)$(pdfdir)/$(PACKAGE).pdf";\
     148    echo "$(INSTALL_DATA) $(PACKAGE).pdf $(DESTDIR)$(pdfdir)/$(PACKAGE).pdf";\
    149149  fi
    150150
  • tags/0.6.3/doc/doxygen.config.in

    r4334 r4334  
    66# Copyright (C) 2006, 2007 Jari Häkkinen, Peter Johansson
    77# Copyright (C) 2008 Jari Häkkinen, Peter Johansson, Markus Ringnér
    8 # Copyright (C) 2009 Peter Johansson
     8# Copyright (C) 2009, 2010 Peter Johansson
    99#
    1010# This file is part of the yat library, http://dev.thep.lu.se/yat
     
    279279ALIASES += "bidirectional_iterator=<a href=\"http://www.sgi.com/tech/stl/BidirectionalIterator.html\">Bidirectional Iterator</a>"
    280280ALIASES += "random_access_iterator=<a href=\"http://www.sgi.com/tech/stl/RandomAccessIterator.html\">Random Access Iterator</a>"
     281ALIASES += "boost_url=http://www.boost.org/doc/libs/1_35_0/libs"
    281282
    282283# The ENABLED_SECTIONS tag can be used to enable conditional
     
    558559# put in front of it. If left blank `latex' will be used as the default path.
    559560
    560 LATEX_OUTPUT           = @DX_LATEX_OUTPUT@
     561LATEX_OUTPUT           =
    561562
    562563# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
     
    713714# way by setting EXPAND_ONLY_PREDEF to YES.
    714715
    715 MACRO_EXPANSION        = NO
     716MACRO_EXPANSION        = YES
    716717
    717718# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
     
    719720# PREDEFINED and EXPAND_AS_PREDEFINED tags.
    720721
    721 EXPAND_ONLY_PREDEF     = NO
     722EXPAND_ONLY_PREDEF     = YES
    722723
    723724# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
     
    745746# omitted =1 is assumed.
    746747
    747 PREDEFINED             =
     748PREDEFINED             = YAT_DEPRECATE=
    748749
    749750# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then
  • tags/0.6.3/m4/version.m4

    r4334 r4334  
    2828m4_define([MINOR_VERSION], [6])
    2929# PATCH - Modify for every released patch
    30 m4_define([PATCH_VERSION], [2])
     30m4_define([PATCH_VERSION], [3])
    3131
    3232# DEV_BUILD - When rolling a tarball we set this to `false'. In
     
    6464# yat-0.6.1  3:1:0
    6565# yat-0.6.2  3:2:0
     66# yat-0.6.3  3:3:0
    6667#
    6768# *Accidently, the libtool number was not updated for yat 0.5
    6869#
    69 m4_define([YAT_LT_VERSION_INFO], [3:2:0])
     70m4_define([YAT_LT_VERSION_INFO], [3:3:0])
    7071
    7172###
  • tags/0.6.3/m4/yat.m4

    r4334 r4334  
    111111AC_DEFUN([YAT_CHECK_YAT],
    112112[
    113 AC_PREREQ([2.60]) dnl we use AC_FIND_YAT
     113AC_PREREQ([2.60]) dnl we use YAT_FIND_YAT
    114114ac_yat_check_yat_res="yes"
    115115AC_REQUIRE([YAT_FIND_YAT])  dnl
  • tags/0.6.3/test/commandline_test.cc

    r4334 r4334  
    3030
    3131#include <cassert>
     32#include <cstdlib>
    3233#include <fstream>
    3334#include <stdexcept>
  • tags/0.6.3/test/fisher_test.cc

    r4334 r4334  
    22
    33/*
    4   Copyright (C) 2008, 2009 Peter Johansson
     4  Copyright (C) 2008, 2009, 2010 Peter Johansson
    55
    66  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    2020*/
    2121
     22#include <climits>
     23
    2224#include "Suite.h"
    2325
     
    2830void test_p_value_approximative(test::Suite&);
    2931void test_p_value_exact(test::Suite&);
     32void test_large_numbers(test::Suite&);
    3033
    3134int main(int argc, char* argv[])
     
    6568  }
    6669  test_p_value(suite);
     70  test_large_numbers(suite);
    6771  return suite.return_value();
    6872}
     
    116120
    117121}
     122
     123void test_large_numbers(test::Suite& suite)
     124{
     125  // skip test if unsigned int is 16 bit
     126  if ((UINT_MAX >> 16) == 0) {
     127    suite.out() << "skipping test_large_numbers\n";
     128    return;
     129  }
     130
     131  statistics::Fisher f;
     132  double oddsratio = f.oddsratio(1166,63326825-1166,1095,66074759-1095);
     133  if (oddsratio<0.5 || oddsratio>2) {
     134    suite.err() << "oddsratio: " << oddsratio << "\n";
     135    suite.err() << "expected ~ 1\n";
     136    suite.xadd(false);
     137  }
     138  suite.add(suite.equal_fix(f.p_value(), 0.0123, 0.0001));
     139  f.p_value_one_sided();
     140}
  • tags/0.6.3/yat/statistics/Fisher.cc

    r4334 r4334  
    55  Copyright (C) 2005 Peter Johansson
    66  Copyright (C) 2006, 2007, 2008 Jari Häkkinen, Peter Johansson
    7   Copyright (C) 2009 Peter Johansson
     7  Copyright (C) 2009, 2010 Peter Johansson
    88
    99  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    3030
    3131#include <algorithm>
     32#include <cassert>
    3233
    3334namespace theplu {
     
    6465  void Fisher::expected(double& a, double& b, double& c, double& d) const
    6566  {
    66     double N = a_+b_+c_+d_;
    67     a =((a_+b_)*(a_+c_)) / N;
    68     b =((a_+b_)*(b_+d_)) / N;
    69     c =((c_+d_)*(a_+c_)) / N;
    70     d =((c_+d_)*(b_+d_)) / N;
     67    // use floting point arithmetic to avoid overflow
     68    double a1 = a_;
     69    double b1 = b_;
     70    double c1 = c_;
     71    double d1 = d_;
     72    double N = a1 + b1 + c1 + d1;
     73    a =((a1+b1)*(a1+c1)) / N;
     74    b =((a1+b1)*(b1+d1)) / N;
     75    c =((c1+d1)*(a1+c1)) / N;
     76    d =((c1+d1)*(b1+d1)) / N;
    7177  }
    7278
     
    98104    d_ = d;
    99105
    100     oddsratio_=static_cast<double>(a*d)/static_cast<double>(b*c);
     106    oddsratio_= (static_cast<double>(a) / static_cast<double>(b) *
     107                 static_cast<double>(d) / static_cast<double>(c) );
    101108    return oddsratio_;
    102109  }
     
    118125      return p_value_approximative()/2.0;
    119126    }
     127    // check for overflow
     128    assert(c_ <= c_+d_ && d_ <= c_+d_);
     129    assert(a_ <= a_+b_ && b_ <= a_+b_);
     130    assert(a_ <= a_+c_ && c_ <= a_+c_);
     131
    120132    return statistics::cdf_hypergeometric_P(c_, c_+d_, a_+b_, a_+c_);
    121133  }
     
    147159  }
    148160
    149 
    150161}}} // of namespace statistics, yat, and theplu
  • tags/0.6.3/yat/utility/PCA.h

    r4334 r4334  
    1010  Copyright (C) 2006 Jari Häkkinen
    1111  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
     12  Copyright (C) 2010 Peter Johansson
    1213
    1314  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    4344     this space, all Nx1 vectors will have dimension Mx1. Hence
    4445     the projection will have dimension MxM where each column is
    45      a point in the new space. Also, it assumes that M>N. The opposite
    46      problem is added in the functions: process_transposed_problem and
    47      projection_transposed()...
     46     a point in the new space.
     47
     48     \note Currently number of rows, N, must be larger (or equal) than
     49     number of columns, M.
    4850  */
    4951  class PCA
     
    105107       3: Calculate eigenvalues according to \n
    106108          \f$ \lambda_{ii} = s_{ii}/N_{rows} \f$ \n
    107        4: Sort eigenvectors (from matrix V) according to descending eigenvalues\n
    108109    */
    109110    void process(void);
  • tags/0.6.3/yat/utility/iterator_traits.h

    r4334 r4334  
    229229
    230230     Struct to check if iterator has mutable data. *Iter must have a
    231      function data(). If that function returns double& ::value is
     231     function data(). If that function returns double& value is
    232232     true.
    233233   */
     
    247247
    248248     Struct to check if iterator has mutable data. *Iter must have a
    249      function data(). If that function returns double& ::value is
     249     function data(). If that function returns double& value is
    250250     true.
    251251   */
  • tags/0.6.3/yat/utility/utility.h

    r4334 r4334  
    88  Copyright (C) 2006 Jari Häkkinen
    99  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
    10   Copyright (C) 2009 Peter Johansson
     10  Copyright (C) 2009, 2010 Peter Johansson
    1111
    1212  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    262262        continue;
    263263      matrix.resize(matrix.size()+1);
    264       std::vector<double>& v=matrix.back();
     264      std::vector<T>& v=matrix.back();
    265265      v.reserve(nof_columns);
    266266      std::stringstream ss(line);
Note: See TracChangeset for help on using the changeset viewer.