Changeset 1710
- Timestamp:
- Jan 13, 2009, 5:35:23 PM (12 years ago)
- Location:
- trunk/yat/utility
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/utility/VectorConstView.cc
r1487 r1710 5 5 Copyright (C) 2004 Jari Häkkinen, Peter Johansson 6 6 Copyright (C) 2005, 2006, 2007 Jari Häkkinen, Peter Johansson, Markus Ringnér 7 Copyright (C) 2008 Peter Johansson7 Copyright (C) 2008, 2009 Peter Johansson 8 8 9 9 This file is part of the yat library, http://dev.thep.lu.se/trac/yat … … 24 24 25 25 #include "VectorConstView.h" 26 #include "VectorView.h" 26 27 #include "Matrix.h" 27 28 … … 34 35 : VectorBase(), const_view_(NULL) 35 36 { 36 const_view_ = 37 new gsl_vector_const_view(gsl_vector_const_subvector(other.gsl_vector_p(), 38 0, other.size())); 39 const_vec_ = &(const_view_->vector); 37 copy(other); 40 38 } 41 39 … … 44 42 : VectorBase(), const_view_(NULL) 45 43 { 46 const_view_ = 47 new gsl_vector_const_view(gsl_vector_const_subvector(other.gsl_vector_p(), 48 0, other.size())); 49 const_vec_ = &(const_view_->vector); 44 copy(other); 50 45 } 51 46 … … 79 74 80 75 76 void VectorConstView::copy(const VectorBase& other) 77 { 78 const_view_ = 79 new gsl_vector_const_view(gsl_vector_const_subvector(other.gsl_vector_p(), 80 0, other.size())); 81 const_vec_ = &(const_view_->vector); 82 } 83 84 85 void VectorConstView::delete_allocated_memory(void) 86 { 87 delete const_view_; 88 const_view_=NULL; 89 const_vec_ = NULL; 90 } 91 92 81 93 bool VectorConstView::isview(void) const 82 94 { … … 84 96 } 85 97 86 87 88 void VectorConstView::delete_allocated_memory(void)89 {90 if (const_view_){91 delete const_view_;92 const_view_=NULL;93 }94 const_vec_ = NULL;95 }96 97 98 98 }}} // of namespace utility, yat, and thep -
trunk/yat/utility/VectorConstView.h
r1651 r1710 10 10 Copyright (C) 2006 Jari Häkkinen, Markus Ringnér 11 11 Copyright (C) 2007 Jari Häkkinen, Peter Johansson, Markus Ringnér 12 Copyright (C) 2008 Peter Johansson12 Copyright (C) 2008, 2009 Peter Johansson 13 13 14 14 This file is part of the yat library, http://dev.thep.lu.se/trac/yat … … 37 37 38 38 class Matrix; 39 class VectorView; 39 40 40 41 /** … … 111 112 112 113 private: 114 void copy(const VectorBase& other); 113 115 void delete_allocated_memory(void); 114 116
Note: See TracChangeset
for help on using the changeset viewer.