Changeset 830 for trunk/yat/utility/matrix.cc
- Timestamp:
- Mar 24, 2007, 3:54:42 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/utility/matrix.cc
r813 r830 54 54 if (!m_) 55 55 throw utility::GSL_error("matrix::matrix failed to allocate memory"); 56 set_all(init_value);56 all(init_value); 57 57 } 58 58 … … 276 276 if (!m_) 277 277 throw utility::GSL_error("matrix::matrix failed to allocate memory"); 278 set_all(init_value);278 all(init_value); 279 279 280 280 // no need to delete blas_result_ if the number of rows fit, it … … 295 295 296 296 297 void matrix::set(const matrix& other) 298 { 299 assert(m_); 300 if (gsl_matrix_memcpy(m_, other.gsl_matrix_p())) 301 throw utility::GSL_error("matrix::create_gsl_matrix_copy dimension mis-match"); 302 } 303 304 305 void matrix::set_all(const double value) 297 void matrix::all(const double value) 306 298 { 307 299 assert(m_); … … 310 302 311 303 312 void matrix:: set_column(const size_t column, const vector& vec)304 void matrix::column(const size_t column, const vector& vec) 313 305 { 314 306 assert(m_); … … 319 311 320 312 321 void matrix:: set_row(const size_t row, const vector& vec)313 void matrix::row(const size_t row, const vector& vec) 322 314 { 323 315 assert(m_); … … 413 405 const matrix& matrix::operator=( const matrix& other ) 414 406 { 415 set(other); 407 assert(m_); 408 if (gsl_matrix_memcpy(m_, other.gsl_matrix_p())) 409 throw utility::GSL_error("matrix::create_gsl_matrix_copy dimension mis-match"); 416 410 return *this; 417 411 } … … 517 511 flag.clone(matrix(rows,columns,1.0)); 518 512 else 519 flag. set_all(1.0);513 flag.all(1.0); 520 514 bool nan=false; 521 515 for (size_t i=0; i<rows; i++)
Note: See TracChangeset
for help on using the changeset viewer.