This class implements a dynamic vector of double values.
More...
#include <doublevector.h>
|
double * | v |
| This is the vector of double values. More...
|
|
int | size |
| This is the size of the vector. More...
|
|
This class implements a dynamic vector of double values.
◆ DoubleVector() [1/4]
DoubleVector::DoubleVector |
( |
| ) |
|
|
inline |
◆ DoubleVector() [2/4]
DoubleVector::DoubleVector |
( |
int |
sz | ) |
|
This is the DoubleVector constructor for a specified size.
- Parameters
-
sz | is the size of the vector to be created |
- Note
- The elements of the vector will all be created, and set to zero
◆ DoubleVector() [3/4]
DoubleVector::DoubleVector |
( |
int |
sz, |
|
|
double |
initial |
|
) |
| |
This is the DoubleVector constructor for a specified size with an initial value.
- Parameters
-
sz | is the size of the vector to be created |
initial | is the initial value for all the entries of the vector |
◆ DoubleVector() [4/4]
◆ ~DoubleVector()
DoubleVector::~DoubleVector |
( |
| ) |
|
This is the DoubleVector destructor.
- Note
- This will free all the memory allocated to all the elements of the vector
◆ Delete()
void DoubleVector::Delete |
( |
int |
pos | ) |
|
This will delete an entry from the vector.
- Parameters
-
pos | is the element of the vector to be deleted |
- Note
- This will free the memory allocated to the deleted element of the vector
◆ operator*()
double DoubleVector::operator* |
( |
const DoubleVector & |
d | ) |
const |
This operator will calculate the dot product of the vector and an existing DoubleVector.
- Parameters
-
- Returns
- the dot product of the two vectors
◆ operator=()
This operator will set the vector equal to an existing DoubleVector.
- Parameters
-
◆ operator[]() [1/2]
double& DoubleVector::operator[] |
( |
int |
pos | ) |
|
|
inline |
This will return the value of an element of the vector.
- Parameters
-
pos | is the element of the vector to be returned |
- Returns
- the value of the specified element
◆ operator[]() [2/2]
const double& DoubleVector::operator[] |
( |
int |
pos | ) |
const |
|
inline |
This will return the value of an element of the vector.
- Parameters
-
pos | is the element of the vector to be returned |
- Returns
- the value of the specified element
◆ Reset()
void DoubleVector::Reset |
( |
| ) |
|
This will reset the vector.
- Note
- This will delete every entry from the vector and set the size to zero
◆ resize()
void DoubleVector::resize |
( |
int |
addsize, |
|
|
double |
value |
|
) |
| |
This will add new entries to the vector.
- Parameters
-
addsize | is the number of new entries to the vector |
value | is the value that will be entered for the new entries |
◆ setToZero()
void DoubleVector::setToZero |
( |
| ) |
|
This function will set all of the entries of the vector to zero.
◆ Size()
int DoubleVector::Size |
( |
| ) |
const |
|
inline |
This will return the size of the vector.
- Returns
- the size of the vector
◆ size
This is the size of the vector.
This is the vector of double values.
The documentation for this class was generated from the following files: