00001
00002
00003
00004
00005
00006
00013 #ifndef VECTOR_H_
00014 #define VECTOR_H_
00015
00022 #define DEBUG(x,y) //std::cout << (x) << (y) <<std::endl;
00023
00024
00028 #include <string>
00029
00030
00035 class Vector {
00036
00037
00044 friend std::ostream &operator<< (std::ostream &wyjscie,const Vector &wektorek);
00045
00046
00053 friend std::istream &operator>> (std::istream &wejscie,Vector &wektorek);
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063 friend Vector operator* (const int& lhs,const Vector& rhs);
00064
00065 private:
00066 int * content;
00067 unsigned int size;
00068 void chSize(unsigned int newSize);
00069
00070
00075 void fromText(const std::string& raw);
00076
00077 public:
00081 unsigned int getSize() const {return size;}
00082
00083
00088 std::string toString() const;
00089
00090
00095 Vector(unsigned int rozmiar=0);
00096
00097
00104 Vector(const std::string& raw);
00105
00106
00111 Vector(const Vector& Wzorzec);
00112
00113
00121 Vector operator+(const Vector& rhs) const;
00122
00123
00131 Vector& operator+=(const Vector& rhs);
00132
00133
00141 Vector operator-(const Vector& rhs) const;
00142
00143
00151 Vector& operator-=(const Vector& rhs);
00152
00153
00154
00155
00156
00157
00158
00159
00160 Vector operator*(const int& rhs) const;
00161
00162
00163
00164
00165
00166
00167
00168
00169 Vector& operator*=(const int& rhs);
00170
00171
00179 int operator*(const Vector& rhs) const;
00180
00181
00188 Vector& operator=(const Vector& rhs);
00189
00190
00197 Vector& operator=(const std::string& rhs);
00198
00199
00206 int operator[](const unsigned int index) const;
00207
00208
00215 int& operator[](const unsigned int index);
00216
00217
00223 bool operator==(const Vector& rhs) const;
00224
00225
00231 bool operator!=(const Vector& rhs) const{return !(*this==rhs);}
00232
00233
00237 ~Vector();
00238 };
00239
00246 unsigned int policz(std::string wCzym,std::string co);
00247
00255 std::string IntToStr(int liczba);
00256
00257 #endif