Ignore:
Timestamp:
Feb 10, 2009, 5:11:04 PM (12 years ago)
Author:
Peter
Message:

Speeding up copying from Matrix to MatrixWeighted? using
BinaryWeight?. Moving BinaryWeight? from stl_utility.h to
utility.h. Improved docs in MatrixWeighted?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/MatrixWeighted.cc

    r1706 r1789  
    2828#include "DataIterator.h"
    2929#include "Matrix.h"
     30#include "utility.h"
    3031#include "WeightIterator.h"
    3132
     
    112113  void MatrixWeighted::copy(const Matrix& data)
    113114  {
    114     Matrix weight;
    115     nan(data, weight);
    116     copy(data, weight);
    117   }
    118 
    119 
    120   void MatrixWeighted::copy(const Matrix& data, const Matrix& weight)
    121   {
    122     assert(data.rows()==weight.rows());
    123     assert(data.columns()==weight.columns());
    124115    columns_ = data.columns();
    125116    resize(data.rows(), data.columns());
     
    127118    assert(columns()==data.columns());
    128119    std::copy(data.begin(), data.end(), data_iterator(vec_.begin()));
    129     std::copy(weight.begin(), weight.end(), weight_iterator(vec_.begin()));
     120    BinaryWeight()(data.begin(), data.end(), weight_iterator(vec_.begin()));
    130121  }
    131122
Note: See TracChangeset for help on using the changeset viewer.