Changeset 1463
- Timestamp:
- Sep 1, 2008, 11:34:15 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/normalization_test.cc
r1447 r1463 24 24 #include "Suite.h" 25 25 26 #include "yat/normalization/Centralizer.h" 27 #include "yat/normalization/ColumnNormalizer.h" 26 28 #include "yat/normalization/QuantileNormalizer.h" 27 #include "yat/normalization/Centralizer.h"28 29 29 30 #include "yat/utility/Matrix.h" … … 33 34 using namespace theplu::yat; 34 35 void test_centralizer(test::Suite&); 36 void test_column_normalizer(test::Suite&); 35 37 void test_quantile_normalize(test::Suite&); 36 38 … … 61 63 62 64 65 void test_column_normalize(test::Suite& suite) 66 { 67 suite.err() << "Testing QuantileNormalizer\n"; 68 69 utility::Matrix m(2,2); 70 m(0,0) = 0; 71 m(0,1) = 10; 72 m(1,0) = 2; 73 m(1,1) = 4; 74 normalization::QuantileNormalizer qn; 75 qn(m, m); 76 suite.err() << "Testing m(0,0)\n"; 77 suite.add(suite.equal(m(0,0), 2)); 78 suite.err() << "Testing m(0,1)\n"; 79 suite.add(suite.equal(m(0,1), 6)); 80 suite.err() << "Testing m(1,0)\n"; 81 suite.add(suite.equal(m(1,0), 6)); 82 suite.err() << "Testing m(1,1)\n"; 83 suite.add(suite.equal(m(1,1), 2)); 84 } 85 63 86 void test_quantile_normalize(test::Suite& suite) 64 87 { -
trunk/yat/normalization/ColumnNormalizer.h
r1462 r1463 23 23 */ 24 24 25 #include "yat/utility/matrix.h" 26 25 27 namespace theplu { 26 28 namespace yat { 27 namespace utility {28 class Matrix;29 }30 29 namespace normalization { 31 30 … … 44 43 functor used to normalize each column 45 44 */ 46 typedef T normalizer_type 45 typedef T normalizer_type; 47 46 48 47 /** … … 73 72 { 74 73 for (size_t i=0; i<matrix.rows(); ++i) 75 normalizer_(result.begin_co nst_column(i), result.end_const_columns(i),74 normalizer_(result.begin_column(i), result.end_column(i), 76 75 result.begin_column(i)); 77 76
Note: See TracChangeset
for help on using the changeset viewer.