Changeset 758
- Timestamp:
- Feb 19, 2007, 7:52:16 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/utility/vector.cc
r755 r758 92 92 gsl_matrix_row (m.gsl_matrix_p(),i) : 93 93 gsl_matrix_column(m.gsl_matrix_p(),i) ); 94 if (!view_) 95 throw utility::GSL_error("vector::vector failed to setup view"); 94 96 proxy_v_ = v_ = &(view_->vector); 95 97 } … … 102 104 gsl_matrix_const_row (m.gsl_matrix_p(),i) : 103 105 gsl_matrix_const_column(m.gsl_matrix_p(),i) ); 106 if (!view_const_) 107 throw utility::GSL_error("vector::vector failed to setup view"); 104 108 proxy_v_ = v_const_ = &(view_const_->vector); 105 109 } … … 403 407 double& vector::operator[](size_t i) 404 408 { 405 return *gsl_vector_ptr(v_,i);409 return this->operator()(i); 406 410 } 407 411 … … 409 413 const double& vector::operator[](size_t i) const 410 414 { 411 return *gsl_vector_const_ptr(proxy_v_,i);415 return this->operator()(i); 412 416 } 413 417 … … 417 421 if (size()!=a.size()) 418 422 return false; 423 // if gsl error handler disabled, out of bounds index will not 424 // abort the program. 419 425 for (size_t i=0; i<size(); ++i) 420 426 if (gsl_vector_get(proxy_v_,i)!=a(i))
Note: See TracChangeset
for help on using the changeset viewer.