#include <linalg.h>
Public Member Functions | |
DoubleVector (int e) | |
Default dimensions start at 1, end at e. | |
DoubleVector (int s, int e) | |
DoubleVector (const DoubleVector &v) | |
Sets new double vector equal to v. | |
~DoubleVector () | |
Destructor. | |
void | setEnd (int e) |
const DoubleVector & | operator= (const DoubleVector &v) |
Standard linear algebra follows. | |
DoubleVector | operator * (const DoubleVector &v) |
NOT dot product, but product of elements. | |
double & | operator() (int i) |
Reference a single element. | |
double | dot (const DoubleVector &v) const |
dot product | |
double | display (int i) const |
Obvious display functions. | |
int | displayEnd () const |
start of dimension | |
DoubleVector | display () const |
returns end of dimension | |
void | display (double *a) const |
DoubleVector | apply (double(*fn)(double)) |
applies fn to every element in a vector | |
void | set (int i, double f) |
sets ith element | |
double | max () const |
maximum element in vector | |
double | min (int &p) const |
minimum element in vector | |
double | nmin (int &p) const |
next-to-minimum element in vector | |
void | swap (int i, int j) |
swaps ith and jth elements of a vector |
|
Dimensions start at s, end at e |
|
Displays all of vector in *a. a is in old C convention ie index starts at ZERO! (For outputting to fortran) |
|
Changes the length of a vector - copies as many elements of old one as possible, and fills any extra up with zeroes |