Name
- wvNewIndexVector, wvVaNewIndexVector, wvCopyIndexVector,
wvDestroyIndexVector - index vector functions
Synopsis
-
#include <wv/matrix.h>
WVindexVector *wvNewIndexVector(WVdimensionIndex len);
WVindexVector *wvVaNewIndexVector(WVdimensionIndex len, ...);
WVindexVector *wvCopyIndexVector(const WVindexVector *source);
void wvDestroyIndexVector(WVindexVector *indexVector);
Description
-
wvNewIndexVector returns a vector of length len. The vector
is initialized to be a zero vector.
wvVaNewIndexVector returns a vector of length len initialized
with the values of the other arguments. There should be len of these
arguments, and the arguments must be of type WVdimension. If this
is not the case, the results are undefined.
wvCopyIndexVector returns a copy of the source vector.
wvDestroyIndexVector frees the memory used by indexVector.
It is the application programmer's responsibility to free this memory (by
calling this function).
WVdimensionIndex and WVdimension are defined in
<wv/matrix.h> as:
typedef unsigned int WVdimension;
typedef unsigned char WVdimensionIndex;
Example
-
#include <wv/matrix.h>
.
.
.
{
WVindexVector *size;
WVindexVector *index;
WVmatrix *mat;
size = wvVaNewIndexVector(2, 256, 512);
mat = wvNewMatrix(size);
index = wvNewIndexVector(2);
.
.
.
wvDestroyMatrix(mat);
wvDestroyIndexVector(index);
wvDestroyIndexVector(size);
}
See Also
-
wvIndexVectorGetMax(3),
wvIndexVectorLen(3),
wvIndexVectorSub(3),
wvMatrixElt(3),
wvNewMatrix(3)
Diagnostics
- A NULL pointer is returned if the request cannot be completed (usually
indicating that the process has run out of memory).
|