Changeset 343


Ignore:
Timestamp:
Jun 8, 2005, 12:00:28 AM (16 years ago)
Author:
Jari Häkkinen
Message:

Changed return values for a few operators.

Location:
trunk/lib/gslapi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/gslapi/vector.cc

    r342 r343  
    194194
    195195
    196   vector& vector::operator=( const vector& other )
     196  const vector& vector::operator=( const vector& other )
    197197  {
    198198    if( this != &other ) {
  • trunk/lib/gslapi/vector.h

    r342 r343  
    105105    ///
    106106    // Jari, group as vector_operators
    107     inline int
    108     add_constant(double term) { return gsl_vector_add_constant(v_,term); }
     107    inline int add(double term) { return gsl_vector_add_constant(v_,term); }
    109108
    110109    ///
     
    312311    vector operator*(const double d) const;
    313312
    314     ///
     313    ///
    315314    /// Vector addition.
    316315    ///
     
    319318    vector operator+( const vector& other ) const;
    320319
    321     ///
     320    ///
    322321    /// Vector subtraction.
    323322    ///
     
    338337    /// dimensions.
    339338    ///
    340     vector& operator=(const vector&);
    341 
    342     ///
     339    /// @return A const reference to the resulting vector.
     340    ///
     341    const vector& operator=(const vector&);
     342
     343    ///
    343344    /// Addition and assign operator.
    344345    ///
    345     /// @return The resulting vector.
    346     ///
    347     inline vector operator+=( const vector& other )
     346    /// @return A const reference to the resulting vector.
     347    ///
     348    inline const vector& operator+=( const vector& other )
    348349    { gsl_vector_add(v_,other.v_); return *this; }
    349350
    350     ///
     351    ///
    351352    /// Subtract and assign operator.
    352353    ///
    353     /// @return The resulting vector.
    354     ///
    355     inline vector operator-=( const vector& other )
     354    /// @return A const reference to the resulting vector.
     355    ///
     356    inline const vector& operator-=( const vector& other )
    356357    { gsl_vector_sub(v_,other.v_); return *this; }
    357358
     
    359360    /// Multiply with scalar and assign operator.
    360361    ///
    361     vector& operator*=(const double d) { gsl_vector_scale(v_,d); return *this; }
     362    /// @return A const reference to the resulting vector.
     363    ///
     364    inline const vector& operator*=(const double d)
     365    { gsl_vector_scale(v_,d); return *this; }
    362366
    363367
Note: See TracChangeset for help on using the changeset viewer.