53 const long long int&
size()
const
67 #pragma message(" ########## Debug mode ###############")
82 #pragma message(" ########## Debug mode ###############")
95 void IndexCheck(
const long long int &i)
const
97 if ( i<0 || i>=
size() )
MyVector(const long long int n=0)
Allocates a vector with n elements on the heap.
const double & operator[](const long long int i) const
Returns the value of element i.
const long long int & size() const
Returns the number of elements.
friend std::ostream & operator<<(std::ostream &s, MyVector const &orig)
Output of the vector orig.
double & operator[](const long long int i)
Returns the value of element i.
long long int length_
number of elements
virtual ~MyVector()
Deallocates the heap memory.
MyVector & operator=(MyVector const &orig)
Reallocates the vector with the same elements as vector orig and copies its elements.
double * val_
pointer to allocated memory