gridripper::util::FloatVector Class Reference

Growable array of floats. More...

List of all members.

Public Member Functions

 FloatVector ()
 Creates an empty vector.
 FloatVector (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 (float x)
 Adds an element to the end of the vector.
float get (int i)
 Gets an element.
void set (int i, float x)
 Sets an element.
void copy (int start, float[] dst, int dstPos, int len)
 Copies elements into an array.
void add (float[] src, int srcPos, int n)
 Adds array elements.
void set (int i, float[] src, int srcPos, int n)
 Sets array elements.
float[] toArray ()
 Converts the vector contents to an array.
float[] 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.


Detailed Description

Growable array of floats.

Version:
0.5, 06/12/2009
Since:
GridRipper 0.5, 06/10/2009
Author:
Peter Csizmadia

Constructor & Destructor Documentation

gridripper::util::FloatVector::FloatVector ( int  n  )  [inline]

Constructs a vector with the specified capacity.

Parameters:
n the initial capacity


Member Function Documentation

int gridripper::util::FloatVector::size (  )  [inline]

Gets the vector size.

Returns:
the size

void gridripper::util::FloatVector::setSize ( int  n  )  [inline]

Sets the array size.

Parameters:
n the new size

void gridripper::util::FloatVector::add ( float  x  )  [inline]

Adds an element to the end of the vector.

Parameters:
x the value

float gridripper::util::FloatVector::get ( int  i  )  [inline]

Gets an element.

Parameters:
i index
Returns:
value

void gridripper::util::FloatVector::set ( int  i,
float  x 
) [inline]

Sets an element.

Parameters:
i index
x value

void gridripper::util::FloatVector::copy ( int  start,
float[]  dst,
int  dstPos,
int  len 
) [inline]

Copies elements into an array.

Parameters:
start starting position
dst the output array
dstPos starting position in the output array
len number of elements to copy

void gridripper::util::FloatVector::add ( float[]  src,
int  srcPos,
int  n 
) [inline]

Adds array elements.

Parameters:
src the source array
srcPos starting position in the source array
n number of elements to copy

void gridripper::util::FloatVector::set ( int  i,
float[]  src,
int  srcPos,
int  n 
) [inline]

Sets array elements.

Parameters:
i index of first element to overwrite
src the source array
srcPos starting position in the source array
n number of elements to copy

float [] gridripper::util::FloatVector::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.

Returns:
the array

float [] gridripper::util::FloatVector::internalArray (  )  [inline]

Gets the internal array object.

Note that its length is usually larger than size().

Returns:
the array

void gridripper::util::FloatVector::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.

Parameters:
n the desired minimum capacity


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

Generated on Wed Jun 17 18:47:30 2009 for GridRipper by  doxygen 1.5.6