SOFTSUSY
4.1
|
DoubleVector is of variable length, and contains double precision. More...
#include <linalg.h>
Public Member Functions | |
DoubleVector (int e) | |
DoubleVector (int s, int e) | |
DoubleVector (double a, double b) | |
template<class E > | |
DoubleVector & | operator= (const Xpr< double, E > &x) |
this is the only required operator to make this class work with ETs | |
DoubleVector & | operator= (const DoubleVector &other) |
template<typename E > | |
DoubleVector (const Xpr< double, E > &v) | |
double & | operator() (int i) |
Reference a single element. | |
double | operator() (int i) const |
double | display (int i) const |
display one element | |
void | set (int i, double f) |
sets ith element | |
int | displayStart () const |
start of dimension | |
int | displayEnd () const |
returns end of dimension | |
const DoubleVector & | display () const |
returns whole thing | |
double | compare (const DoubleVector &a) const |
void | append (double) |
appends an element at the end | |
void | setEnd (int e) |
DoubleVector | abs () const |
returns absolute of vector | |
double | norm () const |
DoubleVector | apply (double(*fn)(double)) const |
applies fn to every element in a vector | |
double | nmin (int &p) const |
double | max () const |
maximum element in vector | |
double | max (int &p) const |
double | min (int &p) const |
minimum element in vector | |
double | absmax (int &p) const |
returns absolute maximum | |
double | sumElements () const |
Returns sum of absolute values of all elements. | |
std::size_t | size () const |
void | swap (int i, int j) |
swaps ith and jth elements of a vector | |
double | dot (const DoubleVector &v) const |
DoubleVector | sort () const |
DoubleVector | divide (DoubleVector const &v) const |
Acts on each, element by element, dividing each element by v(i) | |
double | average () const |
Average element of the vector. More... | |
int | closest (double a) const |
Closest element of the vector to the input. | |
void | fillArray (double *array, unsigned offset=0) const |
fill array, starting at offset | |
Public Member Functions inherited from Indexable< double, DoubleVector > | |
double | operator() (int n) const |
int | displayStart () const |
int | displayEnd () const |
DoubleVector & | assign_from (const Xpr< double, E > &x) |
DoubleVector | copy_from (const Xpr< double, E > &x) |
Indexable & | operator+= (const Xpr< double, E > &x) |
Indexable & | operator-= (const Xpr< double, E > &x) |
Indexable & | operator*= (double x) |
Friends | |
class | DoubleMatrix |
DoubleVector is of variable length, and contains double precision.
|
inlineexplicit |
e | Default dimensions start at 1, end at e |
|
inline |
e | Dimensions start at s, end at e |
double DoubleVector::average | ( | ) | const |
Average element of the vector.
average element
|
inline |
< dot product
void DoubleVector::setEnd | ( | int | e | ) |
Changes the length of a vector - copies as many elements of old one as possible, and fills any extra up with zeroes