Changeset 1737
- Timestamp:
- Jan 19, 2009, 9:40:06 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/normalization_test.cc
r1736 r1737 46 46 void test_gauss_normalize(test::Suite&); 47 47 void test_qquantile_normalize(test::Suite&); 48 void test_qquantile_normalize_weighted(test::Suite&); 48 49 void test_quantile_normalize(test::Suite&); 49 50 void test_row_normalize(test::Suite&); … … 60 61 test_column_normalize(suite); 61 62 test_qquantile_normalize(suite); 63 test_qquantile_normalize_weighted(suite); 62 64 test_quantile_normalize(suite); 63 65 test_gauss_normalize(suite); … … 165 167 suite.equal_fix(m2(2,0),result2(1,1),1.0e-12) && 166 168 suite.equal_fix(m2(3,0),result2(0,1),1.0e-12) ); 169 } 170 171 172 void test_qquantile_normalize_weighted(test::Suite& suite) 173 { 174 using namespace normalizer; 175 176 suite.err() << "Testing qQuantileNormalizer weighted\n"; 177 178 std::vector<utility::DataWeight> vec; 179 vec.reserve(100); 180 for (size_t i=0; i<100; ++i) 181 vec.push_back(utility::DataWeight(i, 1.0)); 182 //qQuantileNormalizer(vec.begin(), vec.end(), 5); 167 183 } 168 184 -
trunk/yat/normalizer/qQuantileNormalizer.h
r1736 r1737 22 22 23 23 #include "yat/regression/CSplineInterpolation.h" 24 #include "yat/utility/DataWeight.h" 25 #include "yat/utility/iterator_traits.h" 24 26 #include "yat/utility/Vector.h" 25 27 #include "yat/utility/yat_assert.h" … … 28 30 #include <iterator> 29 31 #include <stdexcept> 32 #include <vector> 30 33 31 34 namespace theplu { … … 139 142 140 143 private: 144 // unweighted "constructor" 145 template<typename Iterator> 146 void build(Iterator first, Iterator last, unsigned int N, 147 utility::unweighted_iterator_tag); 141 148 void init(const utility::VectorBase&, unsigned int N); 142 149 … … 230 237 : average_(utility::Vector(N)), index_(utility::Vector(N)) 231 238 { 239 typedef typename 240 utility::weighted_iterator_traits<BidirectionalIterator>::type tag; 241 build(first, last, N, tag()); 242 243 } 244 245 246 template<typename Iterator> 247 void qQuantileNormalizer::Partitioner::build(Iterator first, Iterator last, 248 unsigned int N, 249 utility::unweighted_iterator_tag) 250 { 232 251 utility::Vector vec(std::distance(first, last)); 233 252 std::copy(first, last, vec.begin());
Note: See TracChangeset
for help on using the changeset viewer.