Changeset 1130
- Timestamp:
- Feb 23, 2008, 7:49:29 PM (14 years ago)
- Location:
- trunk/yat/utility
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/utility/Vector.cc
r1129 r1130 162 162 if (!vec_) 163 163 throw utility::GSL_error("Vector failed to allocate memory"); 164 gsl_vector_memcpy(vec_,other.gsl_vector_p()); 164 if (gsl_vector_memcpy(vec_, other.gsl_vector_p())) 165 throw utility::GSL_error("Vector::assign memcpy failed."); 165 166 const_vec_ = vec_; 166 167 } -
trunk/yat/utility/VectorConstView.cc
r1121 r1130 34 34 35 35 VectorConstView::VectorConstView(const VectorConstView& other) 36 : VectorBase( other.gsl_vector_p()), const_view_(NULL)36 : VectorBase(), const_view_(NULL) 37 37 { 38 const_view_ = 39 new gsl_vector_const_view(gsl_vector_const_subvector(other.gsl_vector_p(), 40 0, other.size())); 41 const_vec_ = &(const_view_->vector); 38 42 } 39 43 40 44 41 45 VectorConstView::VectorConstView(const VectorBase& other) 42 : VectorBase( other.gsl_vector_p()), const_view_(NULL)46 : VectorBase(), const_view_(NULL) 43 47 { 48 const_view_ = 49 new gsl_vector_const_view(gsl_vector_const_subvector(other.gsl_vector_p(), 50 0, other.size())); 51 const_vec_ = &(const_view_->vector); 44 52 } 45 53 -
trunk/yat/utility/VectorView.cc
r1121 r1130 103 103 { 104 104 if (size()!=other.size()) 105 throw utility::GSL_error("VectorView:: dimension mis-match");105 throw utility::GSL_error("VectorView::assign dimension mis-match"); 106 106 if (!other.size()) 107 107 return *this; 108 gsl_vector_memcpy(vec_, other.gsl_vector_p()); 108 if (gsl_vector_memcpy(vec_, other.gsl_vector_p())) 109 throw utility::GSL_error("VectorView::assign memcpy failed."); 109 110 const_vec_ = vec_; 110 111 return *this; -
trunk/yat/utility/VectorView.h
r1121 r1130 90 90 \brief Default constructor. 91 91 92 Creates a view into nothing and behaves like an empty vector.92 Creates a view into nothing and behaves like an empty Vector. 93 93 */ 94 94 VectorView(void); … … 122 122 deleted, the view becomes invalid and the result of further use 123 123 is undefined. 124 125 \throw GSL_error if a view cannot be set up.126 124 */ 127 125 VectorView(VectorMutable& v, size_t offset, size_t n, size_t stride=1); … … 168 166 \note modifies underlying data. 169 167 170 \throw GSL_error if dimensions mis-match .168 \throw GSL_error if dimensions mis-match or if assignment fails 171 169 */ 172 170 const VectorView& operator=(const VectorView&); … … 179 177 \note modifies underlying data. 180 178 181 \throw GSL_error if dimensions mis-match .179 \throw GSL_error if dimensions mis-match or if assignment fails 182 180 */ 183 181 const VectorView& operator=(const VectorBase&);
Note: See TracChangeset
for help on using the changeset viewer.