Changeset 1273
- Timestamp:
- Apr 10, 2008, 9:59:23 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/averager_test.cc
r1251 r1273 44 44 45 45 //Forward declarations 46 bool equal(const Averager&, const Averager&, u _int, Suite&);47 bool equal(const AveragerWeighted&, const AveragerWeighted&, u _int,46 bool equal(const Averager&, const Averager&, unsigned int, Suite&); 47 bool equal(const AveragerWeighted&, const AveragerWeighted&, unsigned int, 48 48 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,49 bool equal(const Averager&, const AveragerWeighted&, unsigned int, Suite& suite); 50 bool equal(const AveragerPair&, const AveragerPair&, unsigned int, Suite& suite); 51 bool equal(const AveragerPair&, const AveragerPairWeighted&, unsigned int, 52 52 Suite& suite); 53 bool equal(const AveragerPairWeighted&, const AveragerPairWeighted&, u_int,54 Suite& suite);53 bool equal(const AveragerPairWeighted&, const AveragerPairWeighted&, 54 unsigned int, Suite& suite); 55 55 56 56 … … 73 73 74 74 Averager* a1 = new Averager(1.0+3+5,1.0+9+25,3); 75 u _int tol = 10;75 unsigned int tol = 10; 76 76 if (!equal(a,*a1, tol, suite)){ 77 77 suite.add(false); … … 84 84 suite.err() << a.mean() - a1->mean() << std::endl; 85 85 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"; 87 87 } 88 88 delete a1; … … 238 238 } 239 239 240 bool equal(const Averager& a, const Averager& b, u _int tol,240 bool equal(const Averager& a, const Averager& b, unsigned int tol, 241 241 Suite& suite) 242 242 { … … 249 249 250 250 bool equal(const AveragerWeighted& a, const AveragerWeighted& b, 251 const u _int tol, Suite& suite)251 const unsigned int tol, Suite& suite) 252 252 { 253 253 bool equal = true; … … 269 269 } 270 270 271 bool equal(const Averager& a, const AveragerWeighted& b, const u _int tol,271 bool equal(const Averager& a, const AveragerWeighted& b, const unsigned int tol, 272 272 Suite& suite) 273 273 { … … 290 290 291 291 bool equal(const AveragerPair& a, const AveragerPair& b, 292 const u _int tol, Suite& suite)292 const unsigned int tol, Suite& suite) 293 293 { 294 294 bool ok = true; … … 306 306 307 307 bool equal(const AveragerPair& a, const AveragerPairWeighted& b, 308 const u _int tol, Suite& suite)308 const unsigned int tol, Suite& suite) 309 309 { 310 310 bool ok = true; … … 329 329 } 330 330 bool equal(const AveragerPairWeighted& a, const AveragerPairWeighted& b, 331 const u _int tol, Suite& suite)331 const unsigned int tol, Suite& suite) 332 332 { 333 333 bool ok = true; -
trunk/test/commandline_test.cc
r1260 r1273 33 33 #include <fstream> 34 34 #include <stdexcept> 35 36 #include <sys/types.h>37 35 38 36 using namespace theplu; … … 151 149 CommandLine cmd; 152 150 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"); 154 152 155 153 suite.err() << "Testing OptionArg existence -i file..."; … … 220 218 } 221 219 222 suite.err() << "Testing OptionArg u _int value -n 3...";220 suite.err() << "Testing OptionArg unsigned int value -n 3..."; 223 221 { 224 222 int ac = 3; … … 257 255 OptionSwitch verbose(cmd, "v,verbose", "explain what is being done"); 258 256 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"); 260 258 261 259 suite.err() << "Testing unknown option --peter..."; … … 303 301 304 302 305 suite.err() << "Testing 23.12 is not u _int...";303 suite.err() << "Testing 23.12 is not unsigned int..."; 306 304 { 307 305 int ac = 3; … … 317 315 } 318 316 319 suite.err() << "Testing -1 is not u _int...";317 suite.err() << "Testing -1 is not unsigned int..."; 320 318 { 321 319 int ac = 3; -
trunk/test/distance_test.cc
r1247 r1273 42 42 43 43 void check_equality(double, double, test::Suite&, const std::string&, 44 u _int N=1);44 unsigned long int N=1); 45 45 utility::Matrix data(void); 46 46 … … 154 154 155 155 void 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) 157 157 { 158 158 if (!suite.equal(dist1, dist2, N)) { -
trunk/test/nni_test.cc
r1251 r1273 50 50 test::Suite suite(argc, argv); 51 51 52 u int neighbours=3;52 unsigned int neighbours=3; 53 53 std::string knni_data(test::filename("data/knni_matrix.data")); 54 54 std::string knni_result(test::filename("data/knni_result.data")); -
trunk/test/subset_generator_test.cc
r1251 r1273 129 129 std::vector<double> t_value(4,0); 130 130 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++) { 132 132 133 133 const classifier::MatrixLookup& tv_view=cv_test.training_data(k); … … 160 160 std::vector<size_t> t_class_count(3,0); 161 161 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++) { 163 163 const classifier::MatrixLookup& t_view=cv_training.training_data(l); 164 164 const classifier::Target& t_target=cv_training.training_target(l); -
trunk/yat/classifier/EnsembleBuilder.h
r1227 r1273 89 89 /// is issued size is zero. 90 90 /// 91 u _long size(void) const;91 unsigned long size(void) const; 92 92 93 93 /// … … 160 160 { 161 161 if (classifier_.empty()){ 162 for(u _long i=0; i<subset_->size();++i) {162 for(unsigned long i=0; i<subset_->size();++i) { 163 163 C* classifier = mother_.make_classifier(); 164 164 classifier->train(subset_->training_data(i), … … 187 187 utility::Matrix prediction; 188 188 189 for(u _long k=0;k<size();++k) {189 for(unsigned long k=0;k<size();++k) { 190 190 D sub_data = test_data(data, k); 191 191 classifier(k).predict(sub_data,prediction); … … 199 199 200 200 template <class C, class D> 201 u _long EnsembleBuilder<C, D>::size(void) const201 unsigned long EnsembleBuilder<C, D>::size(void) const 202 202 { 203 203 return classifier_.size(); … … 259 259 260 260 utility::Matrix prediction; 261 for(u _long k=0;k<size();k++) {261 for(unsigned long k=0;k<size();k++) { 262 262 classifier(k).predict(subset_->validation_data(k),prediction); 263 263 -
trunk/yat/classifier/SubsetGenerator.h
r1222 r1273 298 298 features_.push_back(utility::Index(ml.rows())); 299 299 300 for (u _long k=0; k<size(); k++){300 for (unsigned long k=0; k<size(); k++){ 301 301 training_target_.push_back(Target(target(),training_index(k))); 302 302 validation_target_.push_back(Target(target(),validation_index(k))); … … 324 324 void SubsetGenerator<Data>::build(const KernelLookup& kernel) 325 325 { 326 for (u _long k=0; k<size(); k++){326 for (unsigned long k=0; k<size(); k++){ 327 327 training_target_.push_back(Target(target(),training_index(k))); 328 328 validation_target_.push_back(Target(target(),validation_index(k)));
Note: See TracChangeset
for help on using the changeset viewer.