/* * gslvector.hpp * * Created on: Jan 8, 2010 * Author: heber */ #ifndef GSLVECTOR_HPP_ #define GSLVECTOR_HPP_ using namespace std; /*********************************************** includes ***********************************/ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include /****************************************** forward declarations *****************************/ class GSLVector; /********************************************** declarations *******************************/ class GSLVector { friend class LinearSystemOfEquations; public: GSLVector(size_t m); GSLVector(const GSLVector * const src); GSLVector(const GSLVector & src); ~GSLVector(); // Accessing void SetFromDoubleArray(double *x); double Get(size_t m) const; void Set(size_t m, double x); double *Pointer(size_t m) const; const double *const_Pointer(size_t m) const; size_t GetDimension() const; // Initializing void SetAll(double x); void SetZero(); int SetBasis(size_t m); // Exchanging elements int SwapElements(size_t i, size_t j); int Reverse(); // checking state bool IsZero() const; bool IsOne() const; private: gsl_vector *vector; const size_t dimension; }; ostream & operator << (ostream& ost, const GSLVector &m); bool operator==(const GSLVector& a, const GSLVector& b); const GSLVector& operator+=(GSLVector& a, const GSLVector& b); const GSLVector& operator-=(GSLVector& a, const GSLVector& b); const GSLVector& operator*=(GSLVector& a, const double m); GSLVector const operator*(const GSLVector& a, const double m); GSLVector const operator*(const double m, const GSLVector& a); GSLVector const operator+(const GSLVector& a, const GSLVector& b); GSLVector const operator-(const GSLVector& a, const GSLVector& b); #endif /* GSLVECTOR_HPP_ */