VF_insert | VD_insert | VE_insert |
VCF_insert | VCD_insert | VCE_insert |
VPF_insert | VPD_insert | VPE_insert |
VI_insert | VBI_insert | VSI_insert | VLI_insert | VQI_insert | |
VU_insert | VUB_insert | VUS_insert | VUL_insert | VUQ_insert | VUI_insert |
|
Function | Insert an element into a vector |
|
Syntax C/C++ | #include <VFstd.h>
void VF_insert( fVector X, ui size, ui pos, float C ); |
C++ VecObj | #include <OptiVec.h>
void vector<T>::insert( ui pos, const T& C ); |
Pascal/Delphi | uses VFstd;
procedure VF_insert( X:fVector; size, pos:UIntSize; C:Single ); |
|
CUDA function C/C++ | #include <cudaVFstd.h>
int cudaVF_insert( fVector d_X, ui size, ui pos, float C );
int cusdVF_insert( fVector d_X, ui size, ui pos, float *d_C );
void VFcu_insert( fVector h_X, ui size, ui pos, float C );
|
CUDA function Pascal/Delphi | uses VFstd;
function cudaVF_insert( d_X:fVector; size, pos:UIntSize; C:Single ): IntBool;
function cusdVF_insert( d_X:fVector; size, pos:UIntSize; d_C:PSingle ): IntBool;
procedure VFcu_insert( h_X:fVector; size, pos:UIntSize; C:Single );
(no VFcu_indput function available - neither for C/C++ nor for Pascal/Delphi!)
|
|
Description | This is one of the few functions where the input vector is changed itself (instead of being mapped onto an output vector). A new element is inserted at the position pos and has the value C. Elements before pos are unchanged, elements from pos on are shifted one position higher; the last element is lost. (If you wish to save the last element, choose size big enough to have a dummy element at the end of the vector; now it will be the dummy that gets lost.) |
|
|
|
|