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 #include "Exception.h"
00032
00033 #include <gsl/gsl_vector.h>
00034
00035 namespace theplu {
00036 namespace yat {
00037 namespace utility {
00038
00039 class Matrix;
00040 class Vector;
00041
00079 class VectorView : public VectorMutable
00080 {
00081 public:
00087 VectorView(void);
00088
00097 VectorView(VectorView& other);
00098
00106 explicit VectorView(VectorMutable& other);
00107
00118 VectorView(VectorMutable& v, size_t offset, size_t n, size_t stride=1);
00119
00137 VectorView(Matrix& m, size_t i, bool row=true);
00138
00142 ~VectorView(void);
00143
00147 bool isview(void) const;
00148
00158 const VectorView& operator=(const VectorView&);
00159
00169 const VectorView& operator=(const VectorBase&);
00170
00171 private:
00172 const VectorView& assign(const VectorBase& other);
00173 void copy(gsl_vector*);
00174 void delete_allocated_memory(void);
00175
00176 gsl_vector_view* view_;
00177
00189 struct proxy
00190 {
00193 gsl_vector* vec_;
00194 };
00195
00196 public:
00200 VectorView(proxy p);
00201
00205 operator proxy();
00206 };
00207
00208 }}}
00209
00210 #endif