tminres
|
Implementation of a dense serial vector according to Vector_traits. More...
#include <SimpleVector.hpp>
Public Member Functions | |
SimpleVector (int size) | |
Constructor. | |
virtual | ~SimpleVector () |
Destructor. | |
SimpleVector & | operator= (const double &val) |
Set all the entry of the Vector equal to val. | |
SimpleVector & | operator= (const SimpleVector &RHS) |
Set the entry of the Vector equal to the entries in RHS. | |
void | Scale (const double &val) |
multiply THIS by a scalar value | |
SimpleVector * | Clone () |
Create a new vector with the same structure of THIS. Values are not initialized. | |
double & | operator[] (const int i) |
Access entry i (non const version) | |
const double & | operator[] (const int i) const |
Access entry i (const version) | |
const double | at (const int i) const |
Access entry i. if i < 0 return 0. | |
void | Randomize (int seed) |
Fill the entries of the vector with random numbers. The vector is normalized with norm 1. | |
void | Print (std::ostream &os) |
Print all the entries of the vector. | |
Private Attributes | |
double * | vals |
int | size |
Friends | |
void | add (const SimpleVector &v1, const double &c2, const SimpleVector &v2, SimpleVector &result) |
result = v1 + c2*v2 | |
void | add (const double &c1, const SimpleVector &v1, const double &c2, const SimpleVector &v2, SimpleVector &result) |
result = c1*v1 + c2*v2 | |
void | add (const double &alpha, const SimpleVector &v1, const SimpleVector &v2, SimpleVector &result) |
result = alpha(v1 + v2) | |
void | add (const SimpleVector &v1, const SimpleVector &v2, const SimpleVector &v3, SimpleVector &result) |
result = v1 + v2 + v3 | |
void | subtract (const SimpleVector &v1, const SimpleVector &v2, SimpleVector &result) |
result = v1 - v2 | |
double | InnerProduct (const SimpleVector &v1, const SimpleVector &v2) |
return the inner product of v1 and v2 |
Implementation of a dense serial vector according to Vector_traits.
Definition at line 27 of file SimpleVector.hpp.
SimpleVector::SimpleVector | ( | int | size | ) |
Constructor.
size | int : the size of the vector |
Definition at line 22 of file SimpleVector.cpp.