Tools.h++ Class Reference

Table Of Contents
Copy constructor. The entire vector is copied, including all embedded values.
Public Member Operators
RWGVector(val)&
operator=(RWGVector(val)& s);
Assignment operator. The entire vector is copied.
RWGVector(val)&
operator=(val v);
Sets all elements of self to the value v.
val
operator()(size_t i) const;
val&
operator()(size_t i);
Return the i'th element in the vector. The index i must be between zero and the length of
the vector less one. No bounds checking is performed. The second variant can be used as
an lvalue.
val
operator[](size_t i) const;
val&
operator[](size_t i);
Return the ith element in the vector. The index i must be between zero and the length of
the vector less one. Bounds checking is performed.
Public Member Functions
const val*
data() const;
Returns a pointer to the raw data of self. Should be used with care.
size_t
length() const;
Returns the length of the vector.
void
reshape(size_t n);
Resize the vector. If the vector shrinks, it will be truncated. If the vector grows, then the
value of the additional elements will be undefined.