LGS-Loeser 0.1
|
00001 00002 // Praktikum Informatik 1 00003 // Versuch 7: Lösung eines mathematischen Anwendungsproblems 00004 // 00005 // Datei: Vektor.h 00006 // Inhalt: Vektor-Klasse zum speichern von Vektoren variabler Größe 00008 00009 #ifndef VEKTOR_H_ 00010 #define VEKTOR_H_ 00011 00015 00016 #include <iostream> 00017 #include <iomanip> 00018 using namespace std; 00019 00023 00024 class Vektor 00025 { 00026 public: 00027 // Konstruktor, übernimmt die Dimension 00028 Vektor(int n); 00029 //Kopierkonstruktor 00030 Vektor(const Vektor&); 00031 //Zuweisungsoperator 00032 Vektor& operator=(const Vektor& b); 00033 //Destruktor 00034 ~Vektor(); 00035 00036 // Set- und Getmethoden zum Bearbeiten und Lesen der Inhalte des Vektors 00037 double get(const int i) const; 00038 void set(const int i, const double Zahl); 00039 int getDim() const; 00040 00041 private: 00042 double* v; // Vektor 00043 int dim; 00044 }; 00045 00046 ostream& operator<<(ostream& Stream, const Vektor& v); 00047 00048 #endif /*VEKTOR_H_*/