Ignore:
Timestamp:
Sep 21, 2008, 6:07:45 AM (13 years ago)
Author:
Peter
Message:

changed implementation of a couple of normalizer so that operator() takes two matrices of which one is an input marix and one is a result matrix, i.e., the result does only depend on the input matrix and the result is only used as a receiver - I think this behaviour is more intuitive, although it is not as general as the previous one. We should probably document somewhere how we expect a 2Dnormalizer to behave (refs #425).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/normalizer/QuantileNormalizer.cc

    r1497 r1518  
    3939  {
    4040    assert(data.rows()==result.rows());
     41    assert(data.columns()==result.columns());
     42
     43    // create a tmp copy
    4144    utility::Matrix data_copy(data);
    4245   
     
    4851    // calculate average of each row
    4952    std::vector<yat::statistics::Averager> averager(data_copy.rows());
    50     for (size_t row=0; row<data_copy.rows(); ++row){
     53    for (size_t row=0; row<result.rows(); ++row){
    5154      add(averager[row], data_copy.begin_row(row), data_copy.end_row(row));
    5255    }
     
    5457    for (size_t column=0; column<result.columns(); ++column){
    5558      std::vector<size_t> index;
    56       utility::sort_index(index, result.column_const_view(column));
     59      utility::sort_index(index, data.column_const_view(column));
    5760                               
    58       for (size_t row=0; row<result.rows(); ++row)
     61      for (size_t row=0; row<data.rows(); ++row)
    5962        result(index[row], column) = averager[row].mean();
    6063    }
Note: See TracChangeset for help on using the changeset viewer.