00001 #ifndef _theplu_yat_utility_vector_
00002 #define _theplu_yat_utility_vector_
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
00031 #include "VectorMutable.h"
00032 #include "Exception.h"
00033
00034 #include <cstddef>
00035 #include <iosfwd>
00036 #include <stdexcept>
00037
00038 #include <gsl/gsl_vector.h>
00039
00040 namespace theplu {
00041 namespace yat {
00042 namespace utility {
00043
00044 class matrix;
00045
00059 class Vector : public VectorMutable
00060 {
00061 public:
00065 Vector(void);
00066
00073 explicit Vector(size_t n, double init_value=0);
00074
00081 Vector(const Vector& other);
00082
00089 explicit Vector(const VectorBase& other);
00090
00103 explicit Vector(std::istream &, char sep='\0')
00104 throw(utility::IO_error, std::exception);
00105
00109 ~Vector(void);
00110
00114 bool isview(void) const;
00115
00126 void resize(size_t, double init_value=0);
00127
00137 const Vector& operator=(const Vector&);
00138
00148 const Vector& operator=(const VectorBase&);
00149
00150 private:
00151 const Vector& assign(const VectorBase& other);
00152
00164 gsl_vector* create_gsl_vector_copy(const VectorBase&) const;
00165
00177 gsl_vector* create_gsl_vector(size_t n) const;
00178
00179 void delete_allocated_memory(void);
00180 };
00181
00191 void swap(Vector&, Vector&);
00192
00193 }}}
00194
00195 #endif