Changeset 611 for trunk/c++_tools/gslapi
 Timestamp:
 Aug 30, 2006, 2:39:20 PM (16 years ago)
 Location:
 trunk/c++_tools/gslapi
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/c++_tools/gslapi/matrix.cc
r593 r611 161 161 162 162 163 matrix matrix::nan(void) const 164 { 165 matrix m(rows(),columns(),1.0); 163 bool matrix::nan(matrix &m) const 164 { 165 m=matrix(rows(),columns(),1.0); 166 bool nan=false; 166 167 for (size_t i=0; i<rows(); i++) 167 168 for (size_t j=0; j<columns(); j++) 168 if (std::isnan(operator()(i,j))) 169 if (std::isnan(operator()(i,j))) { 169 170 m(i,j)=0; 170 return m; 171 nan=true; 172 } 173 return nan; 171 174 } 172 175 
trunk/c++_tools/gslapi/matrix.h
r597 r611 250 250 251 251 /// 252 /// @return matrix containing 1 and 0 only. 1 means element in 253 /// matrix is valid and a zero means element is a NaN. 254 /// 255 matrix nan(void) const; 252 /// The argument is changed into a matrix containing 1's and 0's 253 /// only. 1 means element in matrix is valid and a zero means 254 /// element is a NaN. 255 /// 256 /// @return true if matrix contains at least one NaN. 257 /// 258 bool nan(matrix&) const; 256 259 257 260 ///
Note: See TracChangeset
for help on using the changeset viewer.