- Timestamp:
- Feb 21, 2008, 11:08:23 PM (16 years ago)
- Location:
- trunk/yat/utility
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/utility/VectorMutable.cc
r1038 r1118 177 177 VectorMutable::operator proxy() 178 178 { 179 assert(vec_==const_vec_); 179 180 proxy p; 180 181 p.vec_ = vec_; 181 182 vec_ = NULL; // proxy takes ownership and delivers to its receiver 183 const_vec_ = NULL; 182 184 return p; 183 185 } -
trunk/yat/utility/VectorMutable.h
r1046 r1118 220 220 VectorView from a temporary VectorView returned from a 221 221 function. Instead this proxy class is created from the 222 temporary object and then a VectorView can be created from th si222 temporary object and then a VectorView can be created from this 223 223 proxy. 224 224 … … 231 231 232 232 private: 233 // copy assignment no allowed233 // copy assignment not allowed 234 234 const VectorMutable& operator=(const VectorMutable&); 235 235 public: -
trunk/yat/utility/VectorView.cc
r1027 r1118 63 63 : VectorMutable() 64 64 { 65 view_ = new gsl_vector_view(gsl_vector_subvector(other.gsl_vector_p(), 66 0,other.size())); 67 const_vec_ = vec_ = &(view_->vector); 65 copy(other.gsl_vector_p()); 68 66 } 69 67 … … 90 88 91 89 VectorView::VectorView(proxy p) 92 : VectorMutable( p.vec_), view_(NULL)90 : VectorMutable(), view_(NULL) 93 91 { 92 copy(p.vec_); 94 93 } 95 94 … … 111 110 return *this; 112 111 } 112 113 114 void VectorView::copy(gsl_vector* other ) 115 { 116 view_ = new gsl_vector_view(gsl_vector_subvector(other,0,other->size)); 117 const_vec_ = vec_ = &(view_->vector); 118 } 113 119 114 120 -
trunk/yat/utility/VectorView.h
r1046 r1118 185 185 private: 186 186 const VectorView& assign(const VectorBase& other); 187 void copy(gsl_vector*); 187 188 void delete_allocated_memory(void); 188 189
Note: See TracChangeset
for help on using the changeset viewer.