Changeset 272
Legend:
 Unmodified
 Added
 Removed

trunk/src/matrix.cc
r242 r272 112 112 } 113 113 114 114 bool matrix::equal(const matrix& other, const double d) const 115 { 116 if (columns()!=other.columns()  rows()!=other.rows()) 117 return false; 118 for (size_t i=0; i<rows(); i++) 119 for (size_t j=0; j<columns(); j++) 120 if ((*this)(i,j)>other(i,j)+d  (*this)(i,j)<other(i,j)d ) 121 return false; 122 123 return true; 124 } 115 125 116 126 vector matrix::TEMP_col_return(size_t column) const 
trunk/src/matrix.h
r242 r272 68 68 69 69 /// 70 /// @return true if each element deviates less or equal than \a d 71 /// 72 bool equal(const matrix&, const double d=0) const; 73 74 /// 70 75 /// Create a new copy of the internal GSL matrix. 71 76 /// … … 200 205 /// Comparison operator. 201 206 /// 202 /// @return True if ... (to be defined) ... otherwise false.203 /// 204 bool operator==( const matrix &other ) const;207 /// @return True if all elements are equal otherwise False. 208 /// 209 inline bool operator==( const matrix& other ) const { return equal(other);} 205 210 206 211 /// 207 212 /// Comparison operator. 208 213 /// 209 /// @return True if ... (to be defined) ... otherwise false.210 /// 211 bool operator!=( const matrix &other ) const;214 /// @return False if all elements are equal otherwise True. 215 /// 216 inline bool operator!=( const matrix& other ) const {return !equal(other);} 212 217 213 218 ///
Note: See TracChangeset
for help on using the changeset viewer.