00001 #ifndef _theplu_yat_utility_vector_view_
00002 #define _theplu_yat_utility_vector_view_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include "VectorMutable.h"
00031
00032 #include <gsl/gsl_vector.h>
00033
00034 namespace theplu {
00035 namespace yat {
00036 namespace utility {
00037
00038 class Matrix;
00039 class Vector;
00040
00078 class VectorView : public VectorMutable
00079 {
00080 public:
00086 VectorView(void);
00087
00096 VectorView(VectorView& other);
00097
00105 explicit VectorView(VectorMutable& other);
00106
00117 VectorView(VectorMutable& v, size_t offset, size_t n, size_t stride=1);
00118
00136 VectorView(Matrix& m, size_t i, bool row=true);
00137
00141 ~VectorView(void);
00142
00146 bool isview(void) const;
00147
00157 const VectorView& operator=(const VectorView&);
00158
00168 const VectorView& operator=(const VectorBase&);
00169
00170 private:
00171 const VectorView& assign(const VectorBase& other);
00172 void copy(gsl_vector*);
00173 void delete_allocated_memory(void);
00174
00175 gsl_vector_view* view_;
00176
00188 struct proxy
00189 {
00192 gsl_vector* vec_;
00193 };
00194
00195 public:
00199 VectorView(proxy p);
00200
00204 operator proxy();
00205 };
00206
00207 }}}
00208
00209 #endif