Ignore:
Timestamp:
Jul 17, 2008, 11:26:58 PM (13 years ago)
Author:
Peter
Message:

refs #396

File:
1 edited

Legend:

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

    r1382 r1384  
    5555
    5656
     57  MatrixWeighted::MatrixWeighted(const Matrix& data)
     58  {
     59    copy(data);
     60  }
     61
     62 
    5763  MatrixWeighted::MatrixWeighted(std::istream& is, char sep)
    5864  {
    5965    Matrix data(is, sep);
    60     Matrix weight;
    61     nan(data, weight);
    62     columns_ = data.columns();
    63     resize(data.columns(), data.rows());
    64     std::copy(data.begin(), data.end(), make_data_iterator(vec_.begin()));
    65     std::copy(weight.begin(), weight.end(), make_weight_iterator(vec_.begin()));
     66    copy(data);
    6667  }
    6768
     
    106107  {
    107108    return columns_;
     109  }
     110
     111
     112  void MatrixWeighted::copy(const Matrix& data)
     113  {
     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());
     124    columns_ = data.columns();
     125    resize(data.columns(), data.rows());
     126    std::copy(data.begin(), data.end(), make_data_iterator(vec_.begin()));
     127    std::copy(weight.begin(), weight.end(), make_weight_iterator(vec_.begin()));
    108128  }
    109129
Note: See TracChangeset for help on using the changeset viewer.