Changeset 1190 for trunk/yat/utility


Ignore:
Timestamp:
Feb 29, 2008, 7:17:25 PM (14 years ago)
Author:
Peter
Message:

adding missing implementation of operator += and added some throwing

File:
1 edited

Legend:

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

    r1151 r1190  
    122122
    123123
     124  const VectorMutable& VectorMutable::operator+=(const VectorBase& other)
     125  {
     126    if (size()!=other.size())
     127      throw std::runtime_error("VectorMutable::operator+= size must be same.");
     128    assert(vec_);
     129    int status=gsl_vector_add(vec_, other.gsl_vector_p());
     130    if (status)
     131      throw utility::GSL_error(std::string("VectorMutable::sub", status));
     132    return *this;
     133  }
     134
     135
    124136  const VectorMutable& VectorMutable::operator+=(double d)
    125137  {
     
    132144  const VectorMutable& VectorMutable::operator-=(const VectorBase& other)
    133145  {
     146    if (size()!=other.size())
     147      throw std::runtime_error("VectorMutable::operator-= size must be same.");
    134148    assert(vec_);
    135149    int status=gsl_vector_sub(vec_, other.gsl_vector_p());
Note: See TracChangeset for help on using the changeset viewer.