VF_vector | VD_vector | VE_vector |
VCF_vector | VCD_vector | VCE_vector |
VPF_vector | VPD_vector | VPE_vector |
VI_vector | VBI_vector | VSI_vector | VLI_vector | VQI_vector | |
VU_vector | VUB_vector | VUS_vector | VUL_vector | VUQ_vector | VUI_vector |
|
Function | Memory allocation for a vector |
|
Syntax C/C++ | #include <VFstd.h>
fVector VF_vector( ui size ); |
Pascal/Delphi | uses VecLib;
function VF_vector( size:UIntSize ): fVector; |
|
CUDA function C/C++ | #include <cudaVFstd.h>
fVector cudaVF_vector( ui size );
|
CUDA function Pascal/Delphi | uses VFstd;
function cudaVF_vector( size:UIntSize ): fVector;
|
|
Description | Based on memory model and environment, the most appropriate allocation procedure is chosen by these functions. Failure to allocate memory always leads to an error message and a subsequent program abort (similar to the error handling of the "new" operator). To release the memory thus allocated, V_free, V_freeAll, or V_nfree should be used (the latter only in C/C++).
Note: the declaration of a vector (e.g., as fVector) reserves only a name, but no memory!
See chapter 4.1 if you are interested in details of the implementation.
Do not use this function in connection with the object-oriented interface VecObj. It has its own automated memory allocation procedure incorporated into the constructors, see chapter 3. |
|
Error handling | If there is not enough memory available, or if size is zero, an error message "Not enough memory" is displayed and the program aborted.
32-bit:
If more than 4 GB of memory are requested, an error message "Vector > 4 GB not possible" is displayed and the program aborted. |
|
Return value | Pointer to the allocated memory |
|
|