Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

Vector Container
[Data Containers]

Collaboration diagram for Vector Container:


Files

file  psVector.h
 Contains basic vector definitions and operations.

Data Structures

union  p_psVectorData
 < Union of psVector data types. More...
struct  psVector
 An vector to support primitive types. More...

Functions

psVectorpsVectorAlloc (psU32 nalloc, psElemType dataType)
 Allocate a vector.
psVectorpsVectorRealloc (psVector *psVec, psU32 nalloc)
 Reallocate a vector.
psVectorpsVectorExtend (psVector *vector, int delta, int nExtend)
 Extend a vector's length.
psVectorpsVectorRecycle (psVector *psVec, psU32 nalloc, psElemType type)
 Recycle a vector.
psVectorpsVectorCopy (psVector *out, const psVector *in, psElemType type)
 Copy a vector, converting types.
psVectorpsVectorSort (psVector *outVector, const psVector *inVector)
 Sort an array of floats.
psVectorpsVectorSortIndex (psVector *outVector, const psVector *inVector)
 Creates an array of indices based on sort ordered of array.
char * psVectorToString (psVector *vector, int maxLength)
 Creates a string from a psVector's values in the form "[x0,x1,x2]".
psF64 p_psVectorGetElementF64 (psVector *vector, int position)
 Returns an element in the vector as a psF64 value.
bool p_psVectorPrint (FILE *f, psVector *a, char *name)
 Print a vector to a stream.


Function Documentation

psF64 p_psVectorGetElementF64 psVector vector,
int  position
 

Returns an element in the vector as a psF64 value.

Returns:
psF64 the value at specified position, or NAN if position is invalid.
Parameters:
vector  vector to retrieve element
position  the vector position to get

bool p_psVectorPrint FILE *  f,
psVector a,
char *  name
 

Print a vector to a stream.

Returns:
psBool TRUE is successful, otherwise FALSE.
Parameters:
f  output stream
a  vector to print
name  name of vector (for title)

psVector* psVectorAlloc psU32  nalloc,
psElemType  dataType
 

Allocate a vector.

Uses psLib memory allocation functions to create a vector collection of data as defined by the psType type.

Returns:
psVector* Pointer to psVector.
Parameters:
nalloc  Total number of elements to make available.
dataType  Type of data to be held by vector.

psVector* psVectorCopy psVector out,
const psVector in,
psElemType  type
 

Copy a vector, converting types.

Performs a deep copy of the elements of one psVector to a new psVector, converting numeric types to a specified type.

Returns:
psVector* Pointer to resulting psVector.
Parameters:
out  if non-NULL, a psVector to recycle
in  the vector to copy.
type  the data type of the resulting psVector

psVector* psVectorExtend psVector vector,
int  delta,
int  nExtend
 

Extend a vector's length.

Increments a vector's length, n, by the specified number of elements. If the allocated storage is less than the current vector's length plus twice the number of elements to be added, it is reallocated larger by a given amount.

Returns:
psVector* Pointer to the adjusted psVector
Parameters:
vector  Vector to extend
delta  Amount to expand allocation, if necessary
nExtend  Number of elements to add to vector length

psVector* psVectorRealloc psVector psVec,
psU32  nalloc
 

Reallocate a vector.

Uses psLib memory allocation functions to reallocate a vector collection of data. The vector is reallocated according to the psType type member contained within the vector.

Returns:
psVector* Pointer to psVector.
Parameters:
psVec  Vector to reallocate.
nalloc  Total number of elements to make available.

psVector* psVectorRecycle psVector psVec,
psU32  nalloc,
psElemType  type
 

Recycle a vector.

Uses psLib memory allocation functions to reallocate a vector collection of data. The vector is reallocated according to the psElemType type parameter.

Returns:
psVector* Pointer to psVector.
Parameters:
psVec  Vector to recycle. If NULL, a new vector is created. No effort taken to preserve the values.
nalloc  Total number of elements to make available.
type  the datatype of the returned vector

psVector* psVectorSort psVector outVector,
const psVector inVector
 

Sort an array of floats.

Sorts an array of floats in ascending order. This function is valid for all non-complex data types.

Returns:
psVector* Pointer to sorted psVector.
Parameters:
outVector  the output vector to recycle, or NULL if new vector desired.
inVector  the vector to sort.

psVector* psVectorSortIndex psVector outVector,
const psVector inVector
 

Creates an array of indices based on sort ordered of array.

Sorts a vector and creates an integer array holding indices of sorted float values based on pre-sort index positions.

Returns:
psVector* vector of the indices of sort.
Parameters:
outVector  vector to recycle
inVector  vector to sort

char* psVectorToString psVector vector,
int  maxLength
 

Creates a string from a psVector's values in the form "[x0,x1,x2]".

Returns:
psPtr a newly allocated string
Parameters:
vector  vector to create a string from
maxLength  the maximum length of the resulting string


Generated on Wed Jun 15 11:01:14 2005 for Pan-STARRS Foundation Library by  doxygen 1.4.1