Changeset 1273


Ignore:
Timestamp:
Apr 10, 2008, 9:59:23 AM (13 years ago)
Author:
Jari Häkkinen
Message:

Some more uint, u_int, and u_long fixes.

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/averager_test.cc

    r1251 r1273  
    4444
    4545//Forward declarations
    46 bool equal(const Averager&, const Averager&, u_int, Suite&);
    47 bool equal(const AveragerWeighted&, const AveragerWeighted&, u_int,
     46bool equal(const Averager&, const Averager&, unsigned int, Suite&);
     47bool equal(const AveragerWeighted&, const AveragerWeighted&, unsigned int,
    4848           Suite& suite);
    49 bool equal(const Averager&, const AveragerWeighted&, u_int, Suite& suite);
    50 bool equal(const AveragerPair&, const AveragerPair&, u_int, Suite& suite);
    51 bool equal(const AveragerPair&, const AveragerPairWeighted&, u_int,
     49bool equal(const Averager&, const AveragerWeighted&, unsigned int, Suite& suite);
     50bool equal(const AveragerPair&, const AveragerPair&, unsigned int, Suite& suite);
     51bool equal(const AveragerPair&, const AveragerPairWeighted&, unsigned int,
    5252           Suite& suite);
    53 bool equal(const AveragerPairWeighted&, const AveragerPairWeighted&, u_int,
    54            Suite& suite);
     53bool equal(const AveragerPairWeighted&, const AveragerPairWeighted&,
     54           unsigned int, Suite& suite);
    5555
    5656
     
    7373
    7474  Averager* a1 = new Averager(1.0+3+5,1.0+9+25,3);
    75   u_int tol = 10;
     75  unsigned int tol = 10;
    7676  if (!equal(a,*a1, tol, suite)){
    7777    suite.add(false);
     
    8484    suite.err() << a.mean() - a1->mean() << std::endl;
    8585    suite.err() << a.variance() - a1->variance() << std::endl;
    86     suite.err() << "error: Averager(double x, double xx, u_long n)\n";
     86    suite.err() << "error: Averager(double x, double xx, unsigned long n)\n";
    8787  }
    8888  delete a1;
     
    238238}
    239239
    240 bool equal(const Averager& a, const Averager& b, u_int tol,
     240bool equal(const Averager& a, const Averager& b, unsigned int tol,
    241241           Suite& suite)
    242242{
     
    249249
    250250bool equal(const AveragerWeighted& a, const AveragerWeighted& b,
    251            const u_int tol, Suite& suite)
     251           const unsigned int tol, Suite& suite)
    252252{
    253253  bool equal = true;
     
    269269}
    270270
    271 bool equal(const Averager& a, const AveragerWeighted& b, const u_int tol,
     271bool equal(const Averager& a, const AveragerWeighted& b, const unsigned int tol,
    272272           Suite& suite)
    273273{
     
    290290
    291291bool equal(const AveragerPair& a, const AveragerPair& b,
    292            const u_int tol, Suite& suite)
     292           const unsigned int tol, Suite& suite)
    293293{
    294294  bool ok = true;
     
    306306
    307307bool equal(const AveragerPair& a, const AveragerPairWeighted& b,
    308            const u_int tol, Suite& suite)
     308           const unsigned int tol, Suite& suite)
    309309{
    310310  bool ok = true;
     
    329329}
    330330bool equal(const AveragerPairWeighted& a, const AveragerPairWeighted& b,
    331            const u_int tol, Suite& suite)
     331           const unsigned int tol, Suite& suite)
    332332{
    333333  bool ok = true;
  • trunk/test/commandline_test.cc

    r1260 r1273  
    3333#include <fstream>
    3434#include <stdexcept>
    35 
    36 #include <sys/types.h>
    3735
    3836using namespace theplu;
     
    151149  CommandLine cmd;
    152150  OptionArg<std::string> input(cmd, "i,input", "input file");
    153   OptionArg<u_int> n(cmd, "n", "number of lines");
     151  OptionArg<unsigned int> n(cmd, "n", "number of lines");
    154152
    155153  suite.err() << "Testing OptionArg existence -i file...";
     
    220218  }
    221219
    222   suite.err() << "Testing OptionArg u_int value -n 3...";
     220  suite.err() << "Testing OptionArg unsigned int value -n 3...";
    223221  {
    224222    int ac = 3;
     
    257255  OptionSwitch verbose(cmd, "v,verbose", "explain what is being done");
    258256  OptionArg<std::string> input(cmd, "i,input", "input file");
    259   OptionArg<u_int> n(cmd, "n", "number of lines");
     257  OptionArg<unsigned int> n(cmd, "n", "number of lines");
    260258
    261259  suite.err() << "Testing unknown option --peter...";
     
    303301
    304302
    305   suite.err() << "Testing 23.12 is not u_int...";
     303  suite.err() << "Testing 23.12 is not unsigned int...";
    306304  {
    307305    int ac = 3;
     
    317315  }
    318316
    319   suite.err() << "Testing -1 is not u_int...";
     317  suite.err() << "Testing -1 is not unsigned int...";
    320318  {
    321319    int ac = 3;
  • trunk/test/distance_test.cc

    r1247 r1273  
    4242
    4343void check_equality(double, double, test::Suite&, const std::string&,
    44                     u_int N=1);
     44                    unsigned long int N=1);
    4545utility::Matrix data(void);
    4646
     
    154154
    155155void check_equality(double dist1, double dist2, test::Suite& suite,
    156                     const std::string& msg, u_int N)
     156                    const std::string& msg, unsigned long int N)
    157157{
    158158  if (!suite.equal(dist1, dist2, N)) {
  • trunk/test/nni_test.cc

    r1251 r1273  
    5050  test::Suite suite(argc, argv);
    5151
    52   uint neighbours=3;
     52  unsigned int neighbours=3;
    5353  std::string knni_data(test::filename("data/knni_matrix.data"));
    5454  std::string knni_result(test::filename("data/knni_result.data"));
  • trunk/test/subset_generator_test.cc

    r1251 r1273  
    129129  std::vector<double> t_value(4,0);
    130130  std::vector<double> v_value(4,0);
    131   for(u_long k=0;k<cv_test.size();k++) {
     131  for(unsigned long k=0;k<cv_test.size();k++) {
    132132   
    133133    const classifier::MatrixLookup& tv_view=cv_test.training_data(k);
     
    160160    std::vector<size_t> t_class_count(3,0);
    161161    std::vector<size_t> t_class_count2(3,0);
    162     for(u_long l=0;l<cv_training.size();l++) {
     162    for(unsigned long l=0;l<cv_training.size();l++) {
    163163      const classifier::MatrixLookup& t_view=cv_training.training_data(l);
    164164      const classifier::Target& t_target=cv_training.training_target(l);
  • trunk/yat/classifier/EnsembleBuilder.h

    r1227 r1273  
    8989    /// is issued size is zero.
    9090    ///
    91     u_long size(void) const;
     91    unsigned long size(void) const;
    9292
    9393    ///
     
    160160  {
    161161    if (classifier_.empty()){
    162       for(u_long i=0; i<subset_->size();++i) {
     162      for(unsigned long i=0; i<subset_->size();++i) {
    163163        C* classifier = mother_.make_classifier();
    164164        classifier->train(subset_->training_data(i),
     
    187187    utility::Matrix prediction; 
    188188
    189     for(u_long k=0;k<size();++k) {       
     189    for(unsigned long k=0;k<size();++k) {       
    190190      D sub_data =  test_data(data, k);
    191191      classifier(k).predict(sub_data,prediction);
     
    199199 
    200200  template <class C, class D>
    201   u_long EnsembleBuilder<C, D>::size(void) const
     201  unsigned long EnsembleBuilder<C, D>::size(void) const
    202202  {
    203203    return classifier_.size();
     
    259259
    260260    utility::Matrix prediction; 
    261     for(u_long k=0;k<size();k++) {
     261    for(unsigned long k=0;k<size();k++) {
    262262      classifier(k).predict(subset_->validation_data(k),prediction);
    263263     
  • trunk/yat/classifier/SubsetGenerator.h

    r1222 r1273  
    298298      features_.push_back(utility::Index(ml.rows()));
    299299
    300     for (u_long k=0; k<size(); k++){
     300    for (unsigned long k=0; k<size(); k++){
    301301      training_target_.push_back(Target(target(),training_index(k)));
    302302      validation_target_.push_back(Target(target(),validation_index(k)));
     
    324324  void SubsetGenerator<Data>::build(const KernelLookup& kernel)
    325325  {
    326     for (u_long k=0; k<size(); k++){
     326    for (unsigned long k=0; k<size(); k++){
    327327      training_target_.push_back(Target(target(),training_index(k)));
    328328      validation_target_.push_back(Target(target(),validation_index(k)));
Note: See TracChangeset for help on using the changeset viewer.