Public Member Functions | |
DoubleVector () | |
Creates an empty vector. | |
DoubleVector (int n) | |
Constructs a vector with the specified capacity. | |
int | size () |
Gets the vector size. | |
void | setSize (int n) |
Sets the array size. | |
void | add (double x) |
Adds an element to the end of the vector. | |
double | get (int i) |
Gets an element. | |
void | set (int i, double x) |
Sets an element. | |
void | copy (int start, double[] dst, int dstPos, int len) |
Copies elements into an array. | |
void | add (double[] src, int srcPos, int n) |
Adds array elements. | |
void | set (int i, double[] src, int srcPos, int n) |
Sets array elements. | |
double[] | toArray () |
Converts the vector contents to an array. | |
double[] | internalArray () |
Gets the internal array object. | |
void | ensureCapacity (int n) |
Increases the capacity if necessary, to ensure that the vector can hold at least the number of elements specified by the argument. |
gridripper::util::DoubleVector::DoubleVector | ( | int | n | ) | [inline] |
Constructs a vector with the specified capacity.
n | the initial capacity |
int gridripper::util::DoubleVector::size | ( | ) | [inline] |
Gets the vector size.
void gridripper::util::DoubleVector::setSize | ( | int | n | ) | [inline] |
Sets the array size.
n | the new size |
void gridripper::util::DoubleVector::add | ( | double | x | ) | [inline] |
Adds an element to the end of the vector.
x | the value |
double gridripper::util::DoubleVector::get | ( | int | i | ) | [inline] |
Gets an element.
i | index |
void gridripper::util::DoubleVector::set | ( | int | i, | |
double | x | |||
) | [inline] |
Sets an element.
i | index | |
x | value |
void gridripper::util::DoubleVector::copy | ( | int | start, | |
double[] | dst, | |||
int | dstPos, | |||
int | len | |||
) | [inline] |
Copies elements into an array.
start | starting position | |
dst | the output array | |
dstPos | starting position in the output array | |
len | number of elements to copy |
void gridripper::util::DoubleVector::add | ( | double[] | src, | |
int | srcPos, | |||
int | n | |||
) | [inline] |
Adds array elements.
src | the source array | |
srcPos | starting position in the source array | |
n | number of elements to copy |
void gridripper::util::DoubleVector::set | ( | int | i, | |
double[] | src, | |||
int | srcPos, | |||
int | n | |||
) | [inline] |
Sets array elements.
i | index of first element to overwrite | |
src | the source array | |
srcPos | starting position in the source array | |
n | number of elements to copy |
double [] gridripper::util::DoubleVector::toArray | ( | ) | [inline] |
Converts the vector contents to an array.
Note that the returned array is a copy, hence it can only be used for reading, writing it has no effect on the vector contents.
double [] gridripper::util::DoubleVector::internalArray | ( | ) | [inline] |
Gets the internal array object.
Note that its length is usually larger than size().
void gridripper::util::DoubleVector::ensureCapacity | ( | int | n | ) | [inline] |
Increases the capacity if necessary, to ensure that the vector can hold at least the number of elements specified by the argument.
n | the desired minimum capacity |