Changeset 1445 for trunk


Ignore:
Timestamp:
Aug 28, 2008, 12:53:11 AM (13 years ago)
Author:
Peter
Message:

adding Centralizer

Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/normalization_test.cc

    r1432 r1445  
    2525
    2626#include "yat/normalization/QuantileNormalizer.h"
     27#include "yat/normalization/Centralizer.h"
    2728
    2829#include "yat/utility/Matrix.h"
    2930
     31#include <vector>
     32
    3033using namespace theplu::yat;
     34void test_centralizer(test::Suite&);
    3135void test_quantile_normalize(test::Suite&);
    3236
     
    3640  suite.err() << "testing normalizations ... " << std::endl;
    3741
     42  test_centralizer(suite);
    3843  test_quantile_normalize(suite);
    3944
     
    4247
    4348
     49void test_centralizer(test::Suite& suite)
     50{
     51  suite.err() << "Testing Centralizer\n";
     52  std::vector<double> vec;
     53  vec.push_back(1);
     54  vec.push_back(2);
     55  vec.push_back(3);
     56  normalization::Centralizer<> c;
     57  c(vec.begin(), vec.end(), vec.begin());
     58  for (size_t i=0; i<vec.size(); ++i)
     59    suite.add(suite.equal(vec[i], static_cast<double>(i)-1.0));
     60}
     61
     62
    4463void test_quantile_normalize(test::Suite& suite)
    4564{
    46   suite.err() << "Testing quantile normalization\n";
     65  suite.err() << "Testing QuantileNormalizer\n";
    4766 
    4867  utility::Matrix m(2,2);
  • trunk/yat/normalization/Makefile.am

    r1432 r1445  
    2929include_normalizationdir = $(includedir)/yat/normalization
    3030
    31 include_normalization_HEADERS = QuantileNormalizer.h
     31include_normalization_HEADERS = Centralizer.h QuantileNormalizer.h
  • trunk/yat/normalization/QuantileNormalizer.h

    r1432 r1445  
    1 #ifndef _theplu_yat_normalization_quantile_normalization_
    2 #define _theplu_yat_normalization_quantile_normalization_
     1#ifndef _theplu_yat_normalization_quantile_normalizer_
     2#define _theplu_yat_normalization_quantile_normalizer_
    33
    44/*
  • trunk/yat/statistics/Average.h

    r1339 r1445  
    4444       \return average of range
    4545     */
    46     template<typename ForwardIterator>
    47     inline double operator()(ForwardIterator first, ForwardIterator last) const
     46    template<typename InputIterator>
     47    inline double operator()(InputIterator first, InputIterator last) const
    4848    {
    49       typename averager<ForwardIterator>::type a;
     49      typename averager<InputIterator>::type a;
    5050      add(a, first, last);
    5151      return a.mean();
  • trunk/yat/statistics/Averager.h

    r1437 r1445  
    184184
    185185  /**
    186      \brief adding a ranges of values to Averager \a a
     186     \brief adding a range of values to Averager \a a
    187187   */
    188188  template <typename Iter>
Note: See TracChangeset for help on using the changeset viewer.