- Timestamp:
- Feb 19, 2007, 8:41:25 PM (16 years ago)
- Location:
- trunk/yat
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/regression/Local.cc
r729 r759 52 52 { 53 53 if (step_size==0 || nof_points<3){ 54 // Peter to Jari, throw exception? 55 std::cerr << "theplu::regression::Local " 54 std::cerr << "yat::regression::Local " 56 55 << "Parameters invalid. Fitting ignored." << std::endl; 57 56 return; -
trunk/yat/utility/WeNNI.cc
r687 r759 53 53 { 54 54 for (unsigned int i=0; i<data_.rows(); i++) { 55 // Jari, avoid copying in next line56 55 std::vector<std::pair<u_int,double> > distance=calculate_distances(i); 57 56 std::sort(distance.begin(),distance.end(), … … 64 63 for (std::vector<u_int>::const_iterator k=knn.begin(); k!=knn.end(); 65 64 ++k) { 66 // Jari, a small number needed here, use something standardized.67 65 // Avoid division with zero (perfect match vectors) 68 66 double d=(distance[*k].second ? distance[*k].second : 1e-10); -
trunk/yat/utility/kNNI.cc
r687 r759 58 58 { 59 59 for (unsigned int i=0; i<mv_rows_.size(); i++) { 60 // Jari, avoid copying in next line61 60 std::vector<std::pair<u_int,double> > distance= 62 61 calculate_distances(mv_rows_[i]); … … 70 69 for (std::vector<u_int>::const_iterator k=knn.begin(); k!=knn.end(); 71 70 ++k) { 72 // Jari, a small number needed here, use something standardized.73 71 // Avoid division with zero (perfect match vectors) 74 72 double d=(distance[*k].second ? distance[*k].second : 1e-10); -
trunk/yat/utility/matrix.cc
r755 r759 78 78 : view_(NULL) 79 79 { 80 // Markus to Jari, somewhere we should check that quiet_NaNs are supported81 // std::numeric_limits<double>::has_quiet_NaN has to be true.82 // Also in vector83 84 80 // read the data file and store in stl vectors (dynamically 85 81 // expandable) … … 114 110 } 115 111 else { 116 // Jari, this should be communicated with as an exception.117 s td::cerr << "Warning: '" << element118 << "' is not accepted as a matrix element." << std::endl;112 std::stringstream ss("Warning: '"); 113 ss << element << "' is not accepted as a matrix element."; 114 throw IO_error(ss.str()); 119 115 } 120 116 } -
trunk/yat/utility/matrix.h
r755 r759 137 137 file marker. 138 138 139 \throw GSL_error if memory allocation fails. 139 \throw GSL_error if memory allocation fails, IO_error if 140 unexpected input is found in the input stream. 140 141 */ 141 142 explicit matrix(std::istream &, char sep='\0') … … 189 190 /// @return A const pointer to the internal GSL matrix. 190 191 /// 191 192 const gsl_matrix* gsl_matrix_p(void) const; 192 193 193 194 /// 194 195 /// @return A pointer to the internal GSL matrix. 195 196 /// 196 // Jari, is this needed? 197 gsl_matrix* gsl_matrix_p(void); 197 gsl_matrix* gsl_matrix_p(void); 198 198 199 199 /// -
trunk/yat/utility/vector.cc
r758 r759 145 145 } 146 146 else { 147 // Jari, this should be communicated with as an exception.148 // std::cerr << "Warning: '" << element149 // << "' is not an integer." << std::endl;147 std::stringstream ss("Warning: '"); 148 ss << element << "' is not an integer."; 149 throw IO_error(ss.str()); 150 150 } 151 151 } -
trunk/yat/utility/vector.h
r755 r759 204 204 to the vector is at end of file marker. 205 205 206 \throw GSL_error if memory allocation fails. 206 \throw GSL_error if memory allocation fails, IO_error if 207 unexpected input is found in the input stream. 207 208 */ 208 209 explicit vector(std::istream &, char sep='\0') … … 263 264 /// @return The maximum value of the vector. 264 265 /// 265 // Jari, doxygen group as Finding maximum and minimum elements266 266 double max(void) const; 267 267 … … 270 270 /// vector. The lowest index has precedence. 271 271 /// 272 // Jari, doxygen group as Finding maximum and minimum elements273 272 size_t max_index(void) const; 274 273 … … 276 275 /// @return The minimum value of the vector. 277 276 /// 278 // Jari, doxygen group as Finding maximum and minimum elements279 277 double min(void) const; 280 278 … … 283 281 /// vector. The lowest index has precedence. 284 282 /// 285 // Jari, doxygen group as Finding maximum and minimum elements286 283 size_t min_index(void) const; 287 284 … … 291 288 /// respectively. 292 289 /// 293 // Jari, doxygen group as Finding maximum and minimum elements294 290 std::pair<double,double> minmax(void) const; 295 291 … … 299 295 /// \a pair, respectively. The lowest index has precedence. 300 296 /// 301 // Jari, doxygen group as Finding maximum and minimum elements302 297 std::pair<size_t,size_t> minmax_index(void) const; 303 298 … … 334 329 /// Set all elements to \a value. 335 330 /// 336 // Jari, doxygen group as Initializing vector elements337 331 void set_all(const double& value); 338 332 … … 342 336 /// one. 343 337 /// 344 // Jari, doxygen group as Initializing vector elements345 338 void set_basis(const size_t i); 346 339 … … 348 341 /// Set all elements to zero. 349 342 /// 350 // Jari, doxygen group as Initializing vector elements351 343 void set_zero(void); 352 344 … … 361 353 /// Bug in gsl: if vector contains NaN an infinite loop is entered. 362 354 /// 363 // Markus to Jari, doxygen group as Exchanging elements ????364 355 void sort(void); 365 356 … … 422 413 /// @return Reference to element \a i. 423 414 /// 424 // Jari, doxygen group as Accessing vector elements425 415 double& operator[](size_t i); 426 416 … … 430 420 /// @return The value of element \a i. 431 421 /// 432 // Jari, doxygen group as Accessing vector elements433 422 const double& operator[](size_t i) const; 434 423
Note: See TracChangeset
for help on using the changeset viewer.