|
|
@ -32,7 +32,8 @@ public:
|
|
|
|
~vector() {
|
|
|
|
~vector() {
|
|
|
|
this->dimention = 0;
|
|
|
|
this->dimention = 0;
|
|
|
|
free(this->entries);
|
|
|
|
free(this->entries);
|
|
|
|
this->entries = NULL;
|
|
|
|
//this->entries = NULL;
|
|
|
|
|
|
|
|
this->err = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
long long get_dimention() const { return this->dimention; }
|
|
|
|
long long get_dimention() const { return this->dimention; }
|
|
|
|
cnumber *get_entries() const { return this->entries; }
|
|
|
|
cnumber *get_entries() const { return this->entries; }
|
|
|
@ -52,7 +53,8 @@ public:
|
|
|
|
return this->get_entry(index);
|
|
|
|
return this->get_entry(index);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// FIXME: Figure out how to make sure you do not try to access something outside of the index
|
|
|
|
// FIXME: Figure out how to make sure you do not try to access something
|
|
|
|
|
|
|
|
// outside of the index
|
|
|
|
cnumber &operator[](const long long index) { return this->entries[index]; }
|
|
|
|
cnumber &operator[](const long long index) { return this->entries[index]; }
|
|
|
|
|
|
|
|
|
|
|
|
friend ostream &operator<<(ostream &os, const vector &v) {
|
|
|
|
friend ostream &operator<<(ostream &os, const vector &v) {
|
|
|
|