Changeset 753 for trunk/yat/utility/vector.cc
- Timestamp:
- Feb 17, 2007, 2:33:24 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/utility/vector.cc
r733 r753 6 6 Copyright (C) 2005 Jari Häkkinen, Peter Johansson, Markus Ringnér 7 7 Copyright (C) 2006 Jari Häkkinen, Peter Johansson 8 Copyright (C) 2007 Jari Häkkinen 8 9 9 10 This file is part of the yat library, http://lev.thep.lu.se/trac/yat … … 49 50 proxy_v_(v_) 50 51 { 52 if (!v_) 53 throw utility::GSL_error("vector::vector failed to allocate memory"); 54 51 55 set_all(init_value); 52 56 } … … 68 72 view_ = new gsl_vector_view(gsl_vector_subvector_with_stride(v.v_,offset, 69 73 stride,n)); 74 if (!view_) 75 throw utility::GSL_error("vector::vector failed to setup view"); 70 76 proxy_v_ = v_ = &(view_->vector); 71 77 } … … 80 86 view_const_ = new gsl_vector_const_view( 81 87 gsl_vector_const_subvector_with_stride(v.v_,offset,stride,n)); 88 if (!view_const_) 89 throw utility::GSL_error("vector::vector failed to setup view"); 82 90 proxy_v_ = v_const_ = &(view_const_->vector); 83 91 } … … 170 178 // convert the data to a gsl vector 171 179 proxy_v_ = v_ = gsl_vector_alloc(nof_rows*nof_columns); 180 if (!v_) 181 throw utility::GSL_error("vector::vector failed to allocate memory"); 172 182 size_t n=0; 173 183 for (size_t i=0; i<nof_rows; i++) … … 203 213 { 204 214 gsl_vector* vec = gsl_vector_alloc(size()); 215 if (!vec) 216 throw utility::GSL_error("vector::create_gsl_vector_copy failed to allocate memory"); 205 217 gsl_vector_memcpy(vec, proxy_v_); 206 218 return vec;
Note: See TracChangeset
for help on using the changeset viewer.