Changeset 1521 for trunk/test/normalization_test.cc
- Timestamp:
- Sep 21, 2008, 7:54:19 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/normalization_test.cc
r1520 r1521 28 28 #include "yat/normalizer/RowNormalizer.h" 29 29 #include "yat/normalizer/Spearman.h" 30 #include "yat/normalizer/Zscore.h" 30 31 31 32 #include "yat/utility/DataIterator.h" … … 44 45 void test_spearman(test::Suite&); 45 46 void test_spearman_weighted(test::Suite&); 47 void test_z_score(test::Suite&); 46 48 47 49 int main(int argc, char* argv[]) … … 55 57 test_row_normalize(suite); 56 58 test_spearman(suite); 59 test_z_score(suite); 57 60 58 61 return suite.return_value(); … … 220 223 suite.add(suite.equal(res(0,3).data(), 0.5/3)); 221 224 } 225 226 void test_z_score(test::Suite& suite) 227 { 228 suite.err() << "Testing Zscore\n"; 229 std::vector<double> vec; 230 vec.push_back(0); 231 vec.push_back(3.14); 232 normalizer::Zscore zscore; 233 zscore(vec.begin(), vec.end(), vec.begin()); 234 for (size_t i=0; i<vec.size(); ++i) 235 suite.add(suite.equal(vec[i], 2.0*i-1.0)); 236 } 237 238
Note: See TracChangeset
for help on using the changeset viewer.