Changes from tags/0.5.1 at r4100 to tags/0.5.2 at r4100


Ignore:
Location:
tags/0.5.2
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • tags/0.5.2/NEWS

    r4100 r4100  
    22
    33See the end of this file for copyrights and conditions.
     4
     5Version 0.5.2 (released 17 March 2009)
     6
     7  - fixed compilation error in IGP (issue #503)
     8  - fixed incorrect error message from CommandLine (issue #508)
     9
     10  A complete list of closed tickets can be found here [[br]]
     11  http://dev.thep.lu.se/yat/query?status=closed&milestone=yat+0.5.2
    412
    513Version 0.5.1 (released 26 February 2009)
  • tags/0.5.2/build_support/svn_support.am

    r4100 r4100  
    6868  esac
    6969
     70version-check:
     71  @case `sed 200q $(srcdir)/m4/version.m4` in \
     72  *yat-$(VERSION)*$(YAT_LT_VERSION)*);; \
     73  *) \
     74    echo "version.m4: YAT_LT_VERSION not updated;" 1>&2;\
     75    echo "  expected to find 'yat-$(VERSION)  $(YAT_LT_VERSION)'" 1>&2;\
     76    echo "  not releasing" 1>&2;\
     77    exit 1;; \
     78  esac
     79
    7080# check that wc is updated and pristine
    7181svn-check:
     
    7787  fi
    7888
    79 release: svn-check news-check maintainer-check
     89release: svn-check news-check version-check maintainer-check
    8090  md5sum $(distdir).tar.gz > $(distdir).tar.gz.MD5
  • tags/0.5.2/m4/version.m4

    r4100 r4100  
    2828m4_define([MINOR_VERSION], [5])
    2929# PATCH - Modify for every released patch
    30 m4_define([PATCH_VERSION], [1])
     30m4_define([PATCH_VERSION], [2])
    3131
    3232# DEV_BUILD - When rolling a tarball we set this to `false'. In
     
    5656# yat-0.5    1:2:0*
    5757# yat-0.5.1  2:0:0
     58# yat-0.5.2  2:1:0
    5859#
    59 m4_define([YAT_LT_VERSION_INFO], [2:0:0])
     60m4_define([YAT_LT_VERSION_INFO], [2:1:0])
    6061
    6162# *Accidently, the libtool number was not updated for yat 0.5
  • tags/0.5.2/test/Makefile.am

    r4100 r4100  
    5050  data_weight_test data_weight_proxy_test distance_test \
    5151  ensemble_test feature_selection_test fileutil_test \
    52   fisher_test index_test inputranker_test interpolation_test \
     52  fisher_test igp_test index_test inputranker_test interpolation_test \
    5353  iterator_test kernel_lookup_test kernel_test \
    5454  knn_test kolmogorov_smirnov_test large_file_test matrix_lookup_test \
     
    8585fileutil_test_SOURCES = fileutil_test.cc
    8686fisher_test_SOURCES = fisher_test.cc
     87igp_test_SOURCES = igp_test.cc
    8788index_test_SOURCES = index_test.cc
    8889inputranker_test_SOURCES = inputranker_test.cc
  • tags/0.5.2/test/commandline_test.cc

    r4100 r4100  
    33/*
    44  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
     5  Copyright (C) 2009 Peter Johansson
    56
    67  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    3637bool test_switch(yat::test::Suite& error);
    3738bool test_arg(yat::test::Suite& error);
     39void test_exception_msg(yat::test::Suite& error);
    3840bool test_file(yat::test::Suite& error);
    3941bool test_failures(yat::test::Suite& error);
     
    5658    suite.add(test_option_name_clash(suite));
    5759    suite.add(test_free_arg(suite));
     60    test_exception_msg(suite);
    5861  }
    5962  catch (std::runtime_error& e) {
     
    8689}
    8790
     91
     92void test_exception_msg(yat::test::Suite& suite)
     93{
     94  // test for ticket 508
     95  using namespace theplu::yat::utility;
     96  CommandLine cmd;
     97  OptionHelp help(cmd, "h,help", "");
     98  OptionFile indata(cmd, "i,in", "input file", true, true,"r");
     99  OptionSwitch cmd_memory(cmd, "m", "transpose in a memory cheap manner");
     100  OptionArg<size_t> cmd_n(cmd, "n", "number of rows to print in each iteration");
     101  OptionSwitch cmd_numeric(cmd, "numeric",
     102                                         "input is a numeric matrix");
     103  OptionFile outdata(cmd, "o,out", "output file",true, false,"w");
     104  OptionSwitch verbose(cmd, "v,verbose", "display progress");
     105  int ac = 2;
     106  char* av[] = { "test_prog", "--haha" };
     107  try {
     108    cmd.parse(ac,av);
     109  }
     110  catch (std::runtime_error& e) {
     111    std::string msg(e.what());
     112    if (msg.size()<15) {
     113      suite.xadd(false);
     114      suite.err() << "Error: short exception message\n"
     115                  << "  exception message is: `" << msg
     116                  << "' that is " << msg.size() << " characters long.\n"
     117                  << "  expected at least 15 characters\n";
     118    }
     119  }
     120}
     121
     122
    88123bool test_switch(yat::test::Suite& suite)
    89124{
  • tags/0.5.2/yat/classifier/IGP.h

    r4100 r4100  
    77  Copyright (C) 2006 Jari Häkkinen, Markus Ringnér
    88  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson, Markus Ringnér
     9  Copyright (C) 2009 Peter Johansson
    910
    1011  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    2425*/
    2526
    26 #include "DataLookup1D.h"
    2727#include "MatrixLookup.h"
    2828#include "Target.h"
     
    118118      size_t neighbor=i;
    119119      double mindist=std::numeric_limits<double>::max();
    120       const DataLookup1D a(matrix_,i,false);
    121120      for(size_t j=0; j<target_.size(); j++) {           
    122         DataLookup1D b(matrix_,j,false);
    123         double dist=distance_(a.begin, a.end(), b.begin());
    124         if(j!=i && dist<mindist) {
     121        if (i==j) // avoid self-self comparison
     122          continue;
     123        double dist = distance_(matrix_.begin_column(i), matrix_.end_column(i),
     124                                matrix_.begin_column(j));
     125        if(dist<mindist) {
    125126          mindist=dist;
    126127          neighbor=j;
  • tags/0.5.2/yat/statistics/KolmogorovSmirnov.h

    r4100 r4100  
    159159       Same as score() but keeping the sign, in other words,
    160160       abs(signed_score())==score()
     161
     162       A positive score implies that values in class \c true \em on
     163       \em average are smaller than values in class \c false.
    161164
    162165       \since New in yat 0.5
  • tags/0.5.2/yat/statistics/utility.h

    r4100 r4100  
    99  Copyright (C) 2006 Jari Häkkinen, Peter Johansson, Markus Ringnér
    1010  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
     11  Copyright (C) 2009 Peter Johansson
    1112
    1213  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    4546namespace statistics { 
    4647
    47   /**
    48      \brief 50th percentile
    49      @see Percentiler
    50   */
    51   template <class T>
    52   double median(T first, T last, const bool sorted=false);
    53 
    54   /**
    55      \see Percentiler
    56   */
    57   template <class T>
    58   double percentile(T first, T last, double p, bool sorted=false) YAT_DEPRECATE;
    59  
    6048  /**
    6149     Adding a range [\a first, \a last) into an object of type T. The
     
    6553  template <typename T, typename ForwardIterator>
    6654  void add(T& o, ForwardIterator first, ForwardIterator last,
    67            const classifier::Target& target)
    68   {
    69     for (size_t i=0; first!=last; ++i, ++first)
    70       o.add(utility::iterator_traits<ForwardIterator>().data(first),
    71             target.binary(i),
    72             utility::iterator_traits<ForwardIterator>().weight(first));
    73   }
     55           const classifier::Target& target);
    7456
    7557  ///
     
    121103  ///
    122104  template <class T>
    123   double mad(T first, T last, const bool sorted=false)
    124   {
    125     double m = median(first, last, sorted);
    126     std::vector<double> ad;
    127     ad.reserve(std::distance(first, last));
    128     for( ; first!=last; ++first)
    129       ad.push_back(fabs(*first-m));
    130     std::sort(ad.begin(), ad.end());
    131     return median(ad.begin(), ad.end(), true);
    132   }
     105  double mad(T first, T last, const bool sorted=false);
    133106 
    134107
     
    149122  ///
    150123  template <class T>
    151   double median(T first, T last, const bool sorted=false)
    152   { return percentile2(first, last, 50.0, sorted); }
     124  double median(T first, T last, const bool sorted=false);
     125
    153126
    154127  /**
     
    166139     can be const_iterators.
    167140     
    168      Requirements: T should be an iterator over a range of doubles (or
    169      any type being convertable to double).
     141     Requirements: RandomAccessIterator is an iterator over a range of
     142     doubles (or any type being convertable to double).
    170143     
    171144     @return \a p'th percentile of range
     
    177150     smaller for large ranges.
    178151  */
     152  template <class RandomAccessIterator>
     153  double percentile(RandomAccessIterator first, RandomAccessIterator last,
     154                    double p, bool sorted=false) YAT_DEPRECATE;
     155 
     156
     157  /**
     158     \see Percentiler
     159     
     160     \since new in yat 0.5
     161   */
     162  template <class RandomAccessIterator>
     163  double percentile2(RandomAccessIterator first, RandomAccessIterator last,
     164                     double p, bool sorted=false)
     165  {
     166    Percentiler percentiler(p, sorted);
     167    return percentiler(first, last);
     168  }
     169
     170  ///
     171  /// @brief Computes the skewness of the data in a vector.
     172  ///
     173  /// The skewness measures the asymmetry of the tails of a
     174  /// distribution.
     175  ///
     176  double skewness(const utility::VectorBase&);
     177 
     178
     179  //////// template implementations ///////////
     180
     181  template <typename T, typename ForwardIterator>
     182  void add(T& o, ForwardIterator first, ForwardIterator last,
     183           const classifier::Target& target)
     184  {
     185    for (size_t i=0; first!=last; ++i, ++first)
     186      o.add(utility::iterator_traits<ForwardIterator>().data(first),
     187            target.binary(i),
     188            utility::iterator_traits<ForwardIterator>().weight(first));
     189  }
     190
     191
     192  template <class T>
     193  double mad(T first, T last, const bool sorted=false)
     194  {
     195    double m = median(first, last, sorted);
     196    std::vector<double> ad;
     197    ad.reserve(std::distance(first, last));
     198    for( ; first!=last; ++first)
     199      ad.push_back(fabs(*first-m));
     200    std::sort(ad.begin(), ad.end());
     201    return median(ad.begin(), ad.end(), true);
     202  }
     203 
     204
     205  template <class T>
     206  double median(T first, T last, const bool sorted=false)
     207  {
     208    return percentile2(first, last, 50.0, sorted);
     209  }
     210
     211
    179212  template <class RandomAccessIterator>
    180213  double percentile(RandomAccessIterator first, RandomAccessIterator last,
     
    207240
    208241
    209   /**
    210      \see Percentiler
    211      
    212      \since new in yat 0.5
    213    */
    214   template <class RandomAccessIterator>
    215   double percentile2(RandomAccessIterator first, RandomAccessIterator last,
    216                      double p, bool sorted=false)
    217   {
    218     Percentiler percentiler(p, sorted);
    219     return percentiler(first, last);
    220   }
    221 
    222   ///
    223   /// @brief Computes the skewness of the data in a vector.
    224   ///
    225   /// The skewness measures the asymmetry of the tails of a
    226   /// distribution.
    227   ///
    228   double skewness(const utility::VectorBase&);
    229  
    230242}}} // of namespace statistics, yat, and theplu
    231243
  • tags/0.5.2/yat/utility/CommandLine.cc

    r4100 r4100  
    122122        if (is_long_option(*arg)) {
    123123          std::string key(arg->substr(2));
    124           std::stringstream ss(key);
    125           getline(ss, key, '=');
     124          std::stringstream ss2(key);
     125          getline(ss2, key, '=');
    126126          std::string value;
    127           getline(ss, value, '\0');
     127          getline(ss2, value, '\0');
    128128          if (!value.empty()){
    129129            *arg = value;
     
    142142          }           
    143143          else if (iter==long_options_.end()) {
    144             ss.str("");
    145             ss << ": unrecognized option `" << key << "'\n" << try_help();
    146             throw cmd_error(ss.str());
     144            std::stringstream ss3;
     145            ss3 << ": unrecognized option `" << key << "'\n" << try_help();
     146            throw cmd_error(ss3.str());
    147147          }
    148148        }
     
    153153              iter(short_options_.find((*arg)[i]));
    154154            if (iter==short_options_.end()) {
    155               std::stringstream ss;
    156               ss << ": invalid option -- " << (*arg)[i] << "\n"
    157                  << try_help() << "\n";
    158               throw cmd_error(ss.str());
     155              std::stringstream ss2;
     156              ss2 << ": invalid option -- " << (*arg)[i] << "\n"
     157                  << try_help() << "\n";
     158              throw cmd_error(ss2.str());
    159159            }       
    160160            else
     
    165165          free_arg_.push_back(*arg);
    166166          if (free_arg_.size()>free_arg_max_) {
    167             std::stringstream ss;
    168             ss << ": invalid option -- " << *arg << "\n"
    169                << try_help() << "\n";
    170             throw cmd_error(ss.str());
     167            std::stringstream ss2;
     168            ss2 << ": invalid option -- " << *arg << "\n"
     169                << try_help() << "\n";
     170            throw cmd_error(ss2.str());
    171171          }
    172172        }
     
    176176    }
    177177    catch (cmd_error& e){
    178       std::stringstream ss;
    179       ss << program_name_ << ": " << e.what();
    180       throw cmd_error(ss.str());
     178      std::stringstream ss2;
     179      ss2 << program_name_ << ": " << e.what();
     180      throw cmd_error(ss2.str());
    181181    }
    182182     
Note: See TracChangeset for help on using the changeset viewer.