[╯°□°]╯︵┻━┻
Goldberg Simulator 20000
|
00001 #ifndef PRJ_VECT_H 00002 #define PRJ_VECT_H 00003 00004 00005 #include <vector> 00006 #include <iostream> 00007 #include <string> 00008 #include <cmath> 00009 #include <initializer_list> 00010 #include <algorithm> 00011 00012 using namespace std; 00013 00014 //--provisoire 00015 double const PI=3.14159265358979323846; 00016 //-- 00017 00018 class Vect{ 00019 private: 00020 vector<double> comp; 00021 Vect prodVect(Vect const& v) const;//test 00022 double prodScal(Vect const& v) const;//test 00023 Vect oppose() const;//test 00024 Vect mult(double const& d) const;//test 00025 bool compareFast(Vect const& v) const; 00026 public: 00027 Vect project(Vect const& v); 00028 Vect reject(Vect const&); 00029 //constructeurs 00030 Vect();//test 00031 Vect(size_t const& dim);//test 00032 Vect(initializer_list<double> const& v);//test 00033 Vect(vector<double> v);//test 00034 //Vect(double const& a,double const&b,double const&c); 00035 00036 //methodes 00037 Vect add(Vect const& v,bool const& bigDim=true) const; 00038 Vect sub(Vect const& v,bool const& bigDim=true) const; 00039 double get(size_t const& i) const; 00040 void set(size_t const& i, double const& nb);//test 00041 void set(vector<double> const& comp);//test 00042 void set0(); 00043 unsigned int getDim() const;//OK 00044 void addDim(double const& d=0);//test 00045 void setDim(size_t const& dim);//test 00046 void subDim();//test 00048 Vect cut(size_t const& first,size_t nb_comp=0); 00050 00051 bool compare(Vect const& v,double const& tol=0.,bool const& dimInegal=false) const; 00052 bool compare2(Vect const& v,double const& tolNorme=0.) const; 00053 Vect normalize() const; 00054 double norme() const;//test 00055 double normeCarree() const;//test 00056 Vect operator+(Vect const& v) const;//test 00057 Vect operator-(Vect const& v) const;//test 00058 Vect& operator+=(Vect const& v);//test 00059 Vect& operator-=(Vect const& v);//test 00060 Vect operator-() const;//test 00061 Vect operator^(Vect const& v)const ;//test 00062 Vect operator*(double const& nb)const ;//test 00063 Vect operator/(double const& nb)const ; 00064 bool operator==(Vect const& v)const ;//test 00065 bool operator!=(Vect const& v)const;//test 00066 double operator*(Vect const& v)const;//test 00067 double operator||(bool const& sqrt)const;//test 00068 Vect& operator*=(double const& nb);//test 00069 Vect& operator/=(double const& nb); 00070 double operator[](size_t const& i); 00071 }; 00072 00073 Vect operator*(double const& a, Vect const& v);//test 00074 //void operator*=(Vect const& a, Vect const& b); 00075 //bool operator 00076 00077 ostream& operator<<(ostream&,Vect const& v);//test 00078 00079 00080 00081 #endif // PRJ_VECT_H