HalleyChebyAD
 All Classes Files Functions Variables Friends
SimpleVector Class Reference

Implementation of a dense serial vector according to Vector_traits. More...

#include <SimpleVector.hpp>

Public Member Functions

 SimpleVector (int length)
 Constructor. More...
 
virtual ~SimpleVector ()
 Destructor.
 
SimpleVectoroperator= (const double &val)
 Set all the entries of the Vector equal to val.
 
SimpleVectoroperator= (const SimpleVector &RHS)
 Set the entry of the Vector equal to the entries in RHS.
 
 SimpleVector (const SimpleVector &other)
 
void Scale (const double &val)
 multiply THIS by a scalar value
 
SimpleVectorClone ()
 Create a new vector with the same structure of THIS. Values are not initialized.
 
void ToDouble (double *dcopy)
 Copies entries of THIS into dcopy.
 
void CopyDouble (const double *source)
 Copies entries of source into THIS.
 
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) const
 Print all the entries of the vector.
 
void Print () const
 

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
 
double Norm (const SimpleVector &v1)
 

Detailed Description

Implementation of a dense serial vector according to Vector_traits.

Constructor & Destructor Documentation

SimpleVector::SimpleVector ( int  length)

Constructor.

Parameters
lengthint : the length of the vector

The documentation for this class was generated from the following files: