OptiVec logo 

OptiVec
 
Version 8


for C/C++ and for Pascal / Delphi

OptiCode
Dr. Martin Sander Software Development
Brahmsstr. 6
D-32756 Detmold
Germany
http://www.optivec.com
e-mail: optivec@gmx.de

Part I. B: Function Reference
for VectorLib


A general description of OptiVec is given in HANDBOOK.HTM.
For MatrixLib functions, see MATRIX.HTM, for CMATH functions, see CMATH.HTM.
Chapter 1.2 of HANDBOOK.HTM contains the licence terms for the Shareware version, Chapter 1.3 for the Registered version.


8. Alphabetical Reference of Vector Functions

The functions are alphabetically ordered, with the prefixes being neglected for the ordering. The heading of each entry lists all the versions available for a specific function:

VF_exampleVD_exampleVE_example
VCF_exampleVCD_exampleVCE_example
FunctionConsider, e.g., the "abs" family of functions. It exists in vectorized versions for
  • the three real-number data types float, double, and extended (long double) with the prefixes VF_,   VD_, and VE_,
  • for the three cartesian complex-number data types (prefixes VCF_,   VCD_, and VCE_),
  • for the three polar complex-number data types (prefixes VPF_,   VPD_, and VPE_),
  • and for the signed integer data types int, byte, short int, long int, and quad (prefixes VI_,   VBI_,   VSI_,   VLI_, and VQI_);
Syntax C/C++In most cases, only the VF_ version is described. All other versions are exactly analogous; one has only to replace the data types float and fVector by the appropriate ones and replace the VF... include file by the one belonging to the desired data type.
C++ VecObjHere, the syntax of the object-oriented interface is described
Pascal/DelphiSimilarly to the description of the C/C++ syntax, again only the VF_ version is described. Replace the data types float and fVector by the appropriate ones and include the unit belonging to the desired data type into the "uses" clause.
DescriptionOften, for the sake of simplicity, the brackets around vector element indices are left away. If not stated otherwise, all vector elements from the zero'th up to the last one (with the index size−1) are subjected to the respective operation described. Thus, a formula like
      Yi = | Xi |
is to be understood as an abbreviation for
      Y[i] = | X[i] |, i=0,...,size−1
or, written as a loop:
      for( i=0; i<size; i++ ) Y[i] = fabs( X[i] );
Error handlingAll types of errors are listed which are detected and handled. The default result is given in each case.
32-bit C/C++ only:
In case of any detected floating-point errors, _matherr or _matherrl are called (see chapter 5.3). Although we do not recommend that, the user may modify _matherr and _matherrl such as to specify other results than those suggested.
Return valueThe return value of the respective function is mentioned here.
See alsoReferences to functions without a prefix "V..." refer to the documentation of your C/C++ or Pascal/Delphi compiler. References to chapters 1. to 7. refer to the file HANDBOOK.HTM.

 

VF_absVD_absVE_abs
VCF_absVCD_absVCE_abs
VPF_absVPD_absVPE_abs
VI_absVBI_absVSI_absVLI_absVQI_abs
FunctionAbsolute value
Syntax C/C++#include <VFmath.h>
int VF_abs( fVector Y, fVector X, ui size );

    (similarly VD_,   VE_,   VBI_,   VSI_,   VI_,   VLI_,   VQI_)
int VCF_abs( fVector Y, cfVector X, ui size );
    (similarly VCD_,   VCE_,   VPF_,   VPD_,   VPE_)
C++ VecObj#include <OptiVec.h>
int vector<T>::abs( const vector<T>& X );
int vector<T>::abs( const vector<complex<T>>& X );
Pascal/Delphiuses VFmath;
function VF_abs( Y, X:fVector; size:UIntSize ): IntBool;

    (similarly VD_,   VE_,   VSI_,   VI_,   VLI_,   VQI_)
function VCF_abs( Y:fVector; X:cfVector; size:UIntSize ): IntBool;
    (similarly VCD_,   VCE_,   VPF_,   VPD_,   VPE_)
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_abs( fVector d_Y, fVector d_X, ui size );
int VFcu_abs( fVector h_Y, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_abs( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function VFcu_abs( h_Y, h_X:fVector; size:UIntSize ): IntBool;
DescriptionReal and integer versions: Yi = | Xi |
VBI_,   VSI_,   VI_, and VLI_ versions only: due to the implicit modulo-2n arithmetics, the absolute value of the most negative numbers possible ( -32768 for short/SmallInt, -2147483648 for long/LongInt) is stored as the same negative (!) number (-32768 or -2147483648, resp.).
Complex versions: Yi = sqrt( Xi.Re2 + Xi.Im2 )
For the complex versions, note that the result is real-valued. For the cartesian complex functions (VC?_abs), the same result may also be obtained slightly faster, but without error handling, using VF_CtoAbs.
Error handlingReal and integer versions: no errors should occur;
Complex versions: OVERFLOW errors lead to the default result +HUGE_VAL.
Return valueFloating-point versions: FALSE (0), if error-free, otherwise TRUE (≠ 0).
The integer versions have no return value.
See alsoVF_neg,   VCF_conj

 

VF_absHugeVD_absHugeVE_absHuge
FunctionReplace negative poles (−HUGE_VAL) with positive ones (+HUGE_VAL)
Syntax C/C++#include <VFmath.h>
void VF_absHuge( fVector Y, fVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::absHuge( const vector<T>& X );
Pascal/Delphiuses VFmath;
procedure VF_absHuge( Y, X:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_absHuge( fVector d_Y, fVector d_X, ui size );
void VFcu_absHuge( fVector h_Y, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_absHuge( d_Y, d_X:fVector; size:UIntSize ): IntBool;
procedure VFcu_absHuge( h_Y, h_X:fVector; size:UIntSize );
DescriptionYi = Xi, if Xi > −HUGE_VAL
Yi = Max, if Xi ≤ −HUGE_VAL
(with HUGE_VAL being FLT_MAX, DBL_MAX, or LDBL_MAX)
Some mathematical functions like the inverse, the tangent, etc., have positive and negative poles (e.g., 1/+0 = +INF, but 1/−0 = −INF). In these cases, the slightest round-off error will decide between positive or negative infinity. For the sake of consistency, one may sometimes wish to treat 1/−0 as 1/+0 and replace negative poles by positive ones. This is what VF_absHuge does. Note that both −HUGE_VAL and −INF are changed into +HUGE_VAL, whereas +INF is left unchanged.
Error handlingnone
Return valuenone
See alsoVF_replaceNAN,   VF_maxC,   VF_minC,   VF_min,   VF_flush0,   VF_limit

 

VF_absmaxVD_absmaxVE_absmax
VCF_absmaxVCD_absmaxVCE_absmax
VPF_absmaxVPD_absmaxVPE_absmax
FunctionLargest absolute value within one vector
Syntax C/C++#include <VFstd.h>
float VF_absmax( fVector X, ui size );

    (similarly VD_,   VE_)
float VCF_absmax( cfVector X, ui size);
    (similarly VCD_,   VCE_,   VPF_,   VPD_,   VPE_)
C++ VecObj#include <OptiVec.h>
T vector<T>::absmax();
T vector<complex<T>>::absmax();
Pascal/Delphiuses VFstd;
function VF_absmax( X:fVector; size:UIntSize ): Single;

    (similarly VD_,   VE_)
function VCF_absmax( X:cfVector; size:UIntSize ): Single;
    (similarly VCD_,   VCE_,   VPF_,   VPD_,   VPE_)
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_absmax( float *h_RetVal, fVector d_X, ui size );
int cusdVF_absmax( float *d_RetVal, fVector d_X, ui size );
float VFcu_absmax( fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_absmax( var h_RetVal:Single; d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_absmax( d_RetVal:PSingle; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_absmax( X:fVector; size:UIntSize ): Single;
DescriptionThe absolute values of all elements of a vector are compared and the largest returned.
For complex numbers, the magnitudes of the elements are compared and the largest magnitude is returned. If you need the complex number itself rather than only its magnitude, use VCF_cabsmax. In order to find the greatest real and imaginary parts of cartesian complex vectors separately, call VCF_absmaxReIm.
Error handlingnone
Return valuemaximum absolute value encountered.
See alsoVF_max,   VF_absmin,   VF_absminmax,   VF_maxexp,   VF_runmax,   VF_absmaxind,   VCF_absmaxReIm,   VCF_cabsmax,   VCF_sabsmax

 

VF_absmaxindVD_absmaxindVE_absmaxind
VCF_absmaxindVCD_absmaxindVCE_absmaxind
VPF_absmaxindVPD_absmaxindVPE_absmaxind
FunctionLargest absolute value and its index
Syntax C/C++#include <VFstd.h>
float VF_absmaxind( ui *Ind, fVector X, ui size );

    (similarly VD_,   VE_)
float VCF_absmaxind( ui *Ind, cfVector X, ui size );
    (similarly VCD_,   VCE_,   VPF_,   VPD_,   VPE_)
C++ VecObj#include <OptiVec.h>
T vector<T>::absmaxind( ui *Ind );
T vector<complex<T>>::absmaxind( ui *Ind );
Pascal/Delphiuses VFstd;
function VF_absmaxind( var Ind:UIntSize; X:fVector; size:UIntSize ): Single;

    (similarly VD_,   VE_)
function VCF_absmaxind( var Ind:UIntSize; X:cfVector; size:UIntSize ): Single;
    (similarly VCD_,   VCE_,   VPF_,   VPD_,   VPE_)
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_absmaxind( float *h_RetVal, ui *h_Ind, fVector d_X, ui size );
int cusdVF_absmaxind( float *d_RetVal, ui *h_Ind, fVector d_X, ui size );
float VFcu_absmaxind( ui *h_Ind, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_absmaxind( var h_RetVal:Single; var h_Ind:UIntSize; d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_absmaxind( d_RetVal:PSingle; var h_Ind:UIntSize; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_absmaxind( var h_Ind:UIntSize; h_X:fVector; size:UIntSize ): Single;
DescriptionThe absolute values of all elements of a vector are compared and the largest returned. For complex numbers, the magnitudes of the elements are compared and the largest returned. The index of this maximum is stored at the address given by Ind. In case of more than one element with the same maximum value, the lowest index is chosen.
Error handlingnone
Return valuemaximum absolute value encountered.
See alsoVF_maxind,   VF_absmax,   VF_runmax,   VF_maxind,   VCF_absmaxReIm

 

VCF_absmaxReImVCD_absmaxReImVCE_absmaxReIm
FunctionSeparate determination of the largest absolute values of the real and imaginary parts occurring in a cartesian complex vector.
Syntax C/C++#include <VCFstd.h>
fComplex VCF_absmaxReIm( cfVector X, ui size );

    (similarly VCD_,   VCE_)
C++ VecObj#include <OptiVec.h>
complex<T> vector<complex<T>>::absmaxReIm();
Pascal/Delphiuses VCFstd;
function VCF_absmaxReIm( X:cfVector; size:UIntSize ):fComplex;

Alternative syntax (obsolete, but still supported):
procedure VCF_absmaxReIm( var RetVal:fComplex; X:cfVector; size:UIntSize );

    (similarly VCD_,   VCE_)
CUDA function C/C++#include <cudaVCFstd.h>
int cudaVCF_absmaxReIm( fComplex *h_RetVal, cfVector d_X, ui size );
int cusdVCF_absmaxReIm( fComplex *d_RetVal, cfVector d_X, ui size );
fComplex VCFcu_absmaxReIm( cfVector h_X, ui size );
CUDA function Pascal/Delphiuses VCFstd;
function cudaVCF_absmaxReIm( var h_RetVal:fComplex; d_X:cfVector; size:UIntSize ): IntBool;
function cusdVCF_absmaxReIm( d_RetVal:PfComplex; d_X:cfVector; size:UIntSize ): IntBool;
function VCFcu_absmaxReIm( h_X:cfVector; size:UIntSize ):fComplex;
DescriptionThe absolute values of the real parts of all vector elements are compared with each other and the largest one is returned as the real part of the result. Similarly, the absolute values of all the imaginary parts are compared with each other and the largest one is returned as the imaginary part of the result. Generally, the result is made up from different elements of the vector.
Error handlingnone
Return valueLargest absolute real and imaginary parts, combined into one complex number.
See alsoVCF_maxReIm,   VCF_absminReIm

 

VF_absminVD_absminVE_absmin
VCF_absminVCD_absminVCE_absmin
VPF_absminVPD_absminVPE_absmin
FunctionSmallest absolute value within one vector
Syntax C/C++#include <VFstd.h>
float VF_absmin( fVector X, ui size );

    (similarly VD_,   VE_)
float VCF_absmin( cfVector X, ui size );
    (similarly VCD_,   VCE_,   VPF_,   VPD_,   VPE_)
C++ VecObj#include <OptiVec.h>
T vector<T>::absmin();
T vector<complex<T>>::absmin();
Pascal/Delphiuses VFstd;
function VF_absmin( X:fVector; size:UIntSize ): Single;

    (similarly VD_,   VE_)
function VCF_absmin( X:cfVector; size:UIntSize ): Single;
    (similarly VCD_,   VCE_,   VPF_,   VPD_,   VPE_)
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_absmin( float *h_RetVal, fVector d_X, ui size );
int cusdVF_absmin( float *d_RetVal, fVector d_X, ui size );
float VFcu_absmin( fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_absmin( var h_RetVal:Single; d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_absmin( d_RetVal:PSingle; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_absmin( X:fVector; size:UIntSize ): Single;
DescriptionThe absolute values of all elements of a vector are compared and the smallest returned.
For complex numbers, the magnitudes of the elements are compared and the smallest magnitude is returned. If you need the complex number itself rather than only its magnitude, call VCF_cabsmin. In order to find the smallest real and imaginary parts of cartesian complex vectors separately, please use VCF_absminReIm.
Error handlingnone
Return valueminimum absolute value encountered.
See alsoVF_min,   VF_absmax,   VF_absminmax,   VF_minexp,   VF_runmin,   VF_minind,   VCF_absminReIm,   VCF_cabsmin,   VCF_sabsmin

 

VF_absminindVD_absminindVE_absminind
VCF_absminindVCD_absminindVCE_absminind
VPF_absminindVPD_absminindVPE_absminind
FunctionSmallest absolute value and the index of its first occurrence.
Syntax C/C++#include <VFstd.h>
float VF_absminind( ui *Ind, fVector X, ui size );

    (similarly VD_,   VE_)
float VCF_absminind( ui *Ind, cfVector X, ui size );
    (similarly VCD_,   VCE_,   VPF_,   VPD_,   VPE_)
C++ VecObj#include <OptiVec.h>
T vector<T>::absminind( ui *Ind );
T vector<complex<T>>::absminind( ui *Ind );
Pascal/Delphiuses VFstd;
function VF_absminind( var Ind:UIntSize; X:fVector; size:UIntSize ): Single;

    (similarly VD_,   VE_)
function VCF_absminind( var Ind:UIntSize; X:cfVector; size:UIntSize ): Single;
    (similarly VCD_,   VCE_,   VPF_,   VPD_,   VPE_)
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_absminind( float *h_RetVal, ui *h_Ind, fVector d_X, ui size );
int cusdVF_absminind( float *d_RetVal, ui *h_Ind, fVector d_X, ui size );
float VFcu_absminind( ui *h_Ind, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_absminind( var h_RetVal:Single; var h_Ind:UIntSize; d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_absminind( d_RetVal:PSingle; var h_Ind:UIntSize; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_absminind( var h_Ind:UIntSize; h_X:fVector; size:UIntSize ): Single;
DescriptionThe absolute values of all elements of a vector are compared and the smallest returned. For complex numbers, the magnitudes of the elements are compared and the smallest returned. The index of this minimum is stored at the address given by Ind. In case of more than one element with the same minimum value, the lowest index is chosen.
Error handlingnone
Return valueminimum absolute value encountered.
See alsoVF_minind,   VF_absmin,   VF_runmin,   VF_maxind,   VCF_absminReIm

 

VF_absminmaxVD_absminmaxVE_absminmax
FunctionFinds the smallest and the largest absolute value of a vector.
Syntax C/C++#include <VFstd.h>
float VF_absminmax( float *xmax, fVector X, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::absminmax(T *xmax);
Pascal/Delphiuses VFstd;
function VF_absminmax( var xmax:Single; X:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_absminmax( float *h_xmin, float *h_xmax, fVector d_X, ui size );
int cusdVF_absminmax( float *d_xmin, float *d_xmax, fVector d_X, ui size );
float VFcu_absminmax( float *xmax, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_absminmax( var h_xmin, h_xmax:Single; d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_absminmax( d_xmin, d_xmax:PSingle; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_absminmax( var h_xmax:Single; h_X:fVector; size:UIntSize ): Single;
DescriptionThe vector X is searched for its minimum and maximum in absolute terms. The maximum is stored as xmax, while the minimum is returned.
Error handlingnone
Return valueMinimum absolute value encountered.
See alsoVF_minmax,   VF_absmin,   VF_absmax,   VF_min_max_mean_stddev

 

VCF_absminReImVCD_absminReImVCE_absminReIm
FunctionSeparate determination of the smallest absolute values of the real and imaginary parts occurring in a cartesian complex vector.
Syntax C/C++#include <VCFstd.h>
fComplex VCF_absminReIm( cfVector X, ui size );

    (similarly VCD_,   VCE_)
C++ VecObj#include <OptiVec.h>
complex<T> vector<complex<T>>::absminReIm();
Pascal/Delphiuses VCFstd;
function VCF_absminReIm( X:cfVector; size:UIntSize ):fComplex;

Alternative syntax (obsolete, but still supported):
procedure VCF_absminReIm( var Min:fComplex; X:cfVector; size:UIntSize );

    (similarly VCD_,   VCE_)
CUDA function C/C++#include <cudaVCFstd.h>
int cudaVCF_absminReIm( fComplex *h_RetVal, cfVector d_X, ui size );
int cusdVCF_absminReIm( fComplex *d_RetVal, cfVector d_X, ui size );
fComplex VCFcu_absminReIm( cfVector h_X, ui size );
CUDA function Pascal/Delphiuses VCFstd;
function cudaVCF_absminReIm( var h_RetVal:fComplex; d_X:cfVector; size:UIntSize ): IntBool;
function cusdVCF_absminReIm( d_RetVal:PfComplex; d_X:cfVector; size:UIntSize ): IntBool;
function VCFcu_absminReIm( h_X:cfVector; size:UIntSize ):fComplex;
DescriptionThe absolute values of the real parts of all vector elements are compared with each other and the smallest one is returned as the real part of the result. Similarly, the absolute values of all the imaginary parts are compared with each other and the smallest one is returned as the imaginary part of the result. Generally, the result is made up from different elements of the vector.
Error handlingnone
Return valueSmallest absolute real and imaginary parts, combined into one complex number.
See alsoVCF_minReIm,   VCF_absmaxReIm

 

VF_accElementVD_accElementVE_accElement
VCF_accElementVCD_accElementVCE_accElement
VCF_accElementReVCD_accElementReVCE_accElementRe
VCF_accElementImVCD_accElementImVCE_accElementIm
VI_accElementVBI_accElementVSI_accElementVLI_accElementVQI_accElement 
VU_accElementVUB_accElementVUS_accElementVUL_accElementVUQ_accElementVUI_accElement
FunctionIncrement a single vector element by a given value
Syntax C/C++#include <VFstd.h>
void VF_accElement( fVector X, ui pos, float C );
#include <VCFstd.h>
void VCF_accElement( cfVector X, ui pos, fComplex C );
void VCF_accElementRe( fVector X, ui pos, float C );
void VCF_accElementIm( fVector X, ui pos, float C );
C++ VecObj#include <OptiVec.h>
vector<T>::accElement( ui pos, T C );
vector<complex<T>>::accElement( ui pos, complex<T> C );
vector<complex<T>>::accElementRe( ui pos, T C );
vector<complex<T>>::accElementIm( ui pos, T C );
Pascal/Delphiuses VFstd;
procedure VF_accElement( X:fVector; pos:UIntSize; C:Single );
uses VCFstd;
procedure VCF_accElement( X:cfVector; pos:UIntSize; C:fComplex );
procedure VCF_accElementRe( X:cfVector; pos:UIntSize; C:Single );
procedure VCF_accElementIm( X:cfVector; pos:UIntSize; C:Single );
CUDA function C/C++#include <cudaVFstd.h>
void cudaVF_accElement( fVector d_X, ui pos, float C );
void cusdVF_accElement( fVector d_X, ui pos, float *d_C );
#include <cudaVCFstd.h>
void cudaVCF_accElement( cfVector d_X, ui pos, fComplex C );
void cusdVCF_accElement( cfVector d_X, ui pos, fComplex *d_C );
void cudaVCF_accElementRe( cfVector d_X, ui pos, float C );
void cusdVCF_accElementRe( cfVector d_X, ui pos, float *d_C );
void cudaVCF_accElementIm( cfVector d_X, ui pos, float C );
void cusdVCF_accElementIm( cfVector d_X, ui pos, float *d_C );
CUDA function Pascal/Delphiuses VFstd;
procedure cudaVF_accElement( d_X:fVector; pos:UIntSize; C:Single );
procedure cusdVF_accElement( d_X:fVector; pos:UIntSize; d_C:PSingle );
uses VCFstd;
procedure cudaVCF_accElement( d_X:cfVector; pos:UIntSize; C:fComplex );
procedure cusdVCF_accElement( d_X:cfVector; pos:UIntSize; d_C:PfComplex );
procedure cudaVCF_accElementRe( d_X:cfVector; pos:UIntSize; C:Single );
procedure cusdVCF_accElementRe( d_X:cfVector; pos:UIntSize; d_C:PSingle );
procedure cudaVCF_accElementIm( d_X:cfVector; pos:UIntSize; C:Single );
procedure cusdVCF_accElementIm( d_X:cfVector; pos:UIntSize; d_C:PSingle );
DescriptionReal versions:
X[i] += C;
The element at the position pos is incremented by the value C.

Complex versions VCF_accElement etc.:
X[i].Re += C.Re; X[i].Im += C.Im;

Complex versions VCF_accElementRe etc.:
X[i].Re += C.Re;
The imaginary part X[i].Im is left unaffected.

Complex versions VCF_accElementIm etc.:
X[i].Im += C.Im;
The real part X[i].Re is left unaffected.

Error handlingnone
Return valuenone
See alsoVF_Pelement,   VF_element,   VF_getElement,   VF_setElement,   VF_decElement

 

VF_accVVD_accVVE_accV
VCF_accVVCD_accVVCE_accV
VI_accVVBI_accVVSI_accVVLI_accVVQI_accV 
VU_accVVUB_accVVUS_accVVUL_accVVUQ_accVVUI_accV
mixed-type versions:
VD_accVFVE_accVFVE_accVD
VCD_accVCFVCE_accVCFVCE_accVCD
VSI_accVBI
VI_accVBIVI_accVSI 
VLI_accVBIVLI_accVSIVLI_accVI 
VUS_accVUB
VU_accVUBVU_accVUS 
VUL_accVUBVUL_accVUSVUL_accVU 
VUQ_accVUBVUQ_accVUSVUQ_accVUVUQ_accVUL 
VUI_accVUBVUI_accVUSVUI_accVUVUI_accVULVUI_accVUQ
VQI_accVBIVQI_accVSIVQI_accVIVQI_accVLI 
VQI_accVUBVQI_accVUSVQI_accVUVQI_accVULVQI_accVUI
VF_...VD_...VE_...
        ...accVI        ...accVBI        ...accVSI        ...accVLI        ...accVQI 
        ...accVU        ...accVUB        ...accVUS        ...accVUL        ...accVUQ        ...accVUI
FunctionAccumulation (corresponds to the += operator)
Syntax C/C++#include <VFmath.h>
void VF_accV( fVector Y, fVector X, ui size );
void VD_accVF( dVector Y, fVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::accV( const vector<T>& X );
void vector<double>::accVF( const vector<float>& X );
Pascal/Delphiuses VFmath;
procedure VF_accV( Y, X:fVector; size:UIntSize );
procedure VD_accVF( Y:dVector; X:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFmath.h>
#include <cudaVDmath.h>
int cudaVF_accV( fVector d_Y, fVector d_X, ui size );
int cudaVD_accVF( dVector d_Y, fVector d_X, ui size );
void VFcu_accV( fVector h_Y, fVector h_X, ui size );
void VDcu_accVF( dVector h_Y, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFmath, VDmath;
function cudaVF_accV( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVD_accVF( d_Y:dVector; d_X:fVector; size:UIntSize ): IntBool;
procedure VFcu_accV( h_Y, h_X:fVector; size:UIntSize );
procedure VDcu_accVF( h_Y:dVector; h_X:fVector; size:UIntSize );
DescriptionYi += Xi
This family of functions consists of two groups. The first group is made up of the normal, same-type versions, like VF_accV.
The much larger second group allows to add a lower-accuracy type vector to a higher-accuracy type vector, like VD_accVF. For the integer types, only the highest one, quad, is used to accumulate both signed and unsigned types. The 16-bit and 32-bit integer types can accumulate only the lower types of the same sort, signed or unsigned. All integer types can be accumulated in any of the three floating-point types.
Error handlingnone
Return valuenone
See alsoVF_acc2V,   VF_addV,   VF_accV2,   VCF_accVmulVconj

 

VF_accV2VD_accV2VE_accV2
VCF_accV2VCD_accV2VCE_accV2
mixed-type versions:
VD_accVF2VE_accVF2VE_accVD2
VCD_accVCF2VCE_accVCF2VCE_accVCD2
FunctionAccumulation of squares
Syntax C/C++#include <VFmath.h>
void VF_accV2( fVector Y, fVector X, ui size );
void VD_accVF2( dVector Y, fVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::accV2( const vector<T>& X );
void vector<double>::accVF2( const vector<float>& X );
Pascal/Delphiuses VFmath;
procedure VF_accV2( Y, X:fVector; size:UIntSize );
procedure VD_accVF2( Y:dVector; X:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFmath.h>
#include <cudaVDmath.h>
int cudaVF_accV2( fVector d_Y, fVector d_X, ui size );
int cudaVD_accVF2( dVector d_Y, fVector d_X, ui size );
void VFcu_accV2( fVector h_Y, fVector h_X, ui size );
void VDcu_accVF2( dVector h_Y, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFmath, VDmath;
function cudaVF_accV2( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVD_accVF2( d_Y:dVector; d_X:fVector; size:UIntSize ): IntBool;
procedure VFcu_accV2( h_Y, h_X:fVector; size:UIntSize );
procedure VDcu_accVF2( h_Y:dVector; h_X:fVector; size:UIntSize );
DescriptionYi += Xi2
The squares of all elements of X are added to the corresponding elements of Y. Similarly to the family VF_accV, this accumulation can be done either with same-type vectors, or the result vector can have higher accuracy.
Error handlingnone
Return valuenone
See alsoVF_acc2V,   VF_addV,   VF_accV,   VCF_accVmulVconj

 

VCF_accVmulVconjVCD_accVmulVconjVCE_accVmulVconj
mixed-type versions:
VCD_accVCFmulVconjVCE_accVCFmulVconjVCE_accVCDmulVconj
FunctionComplex vectors: Accumulation of products X * Y*
Syntax C/C++#include <VCFmath.h>
void VCF_accVmulVconj( cfVector Z, cfVector X, cfVector Y, ui size );
void VCD_accVCFmulVconj( cdVector Z, cfVector X, cfVector Y, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::accVmulVconj( const vector<T>& X, const vector<T>& Y );
void vector<double>::accVFmulVconj( const vector<float>& X, const vector<float>& Y );
Pascal/Delphiuses VCFmath;
procedure VCF_accVmulVconj( Z, X, Y:cfVector; size:UIntSize );
procedure VCD_accVCFmulVconj( Z:cdVector; X, Y:cfVector; size:UIntSize );
CUDA function C/C++#include <cudaVCFmath.h>
#include <cudaVCDmath.h>
int cudaVCF_accVmulVconj( cfVector d_Z, cfVector d_X, cfVector d_Y, ui size );
int cudaVCD_accVCFmulVconj( cdVector d_Z, cfVector d_X, cfVector d_Y, ui size );
void VCFcu_accVmulVconj( cfVector h_Z, cfVector h_X, cfVector h_Y, ui size );
void VCDcu_accVCFmulVconj( cdVector h_Z, cfVector h_X, cfVector h_Y, ui size );
CUDA function Pascal/Delphiuses VCFmath, VCDmath;
function cudaVCF_accVmulVconj( d_Z, d_X, d_Y:cfVector; size:UIntSize ): IntBool;
function cudaVCD_accVCFmulVconj( d_Z:cdVector; d_X, d_Y:cfVector; size:UIntSize ): IntBool;
procedure VCFcu_accVmulVconj( h_Z, h_X, h_Y:cfVector; size:UIntSize );
procedure VCDcu_accVCFmulVConj( h_Z:cdVector; h_X, h_Y:cfVector; size:UIntSize );
DescriptionZi += Xi * Yi*
The products all elements of X with the complex-conjugated form of the corresponding elements of Y are accumulated in the corresponding elements of Z. Similarly to the family VF_accV, this accumulation can be done either with same-type vectors, or the result vector can have higher accuracy.
Error handlingnone
Return valuenone
See alsoVF_accV2,   VF_accV

 

VF_acc2VVD_acc2VVE_acc2V
mixed-type versions:
VD_acc2VFVE_acc2VFVE_acc2VD
FunctionAccumulation (corresponds to the += operator) of two vectors at once
Syntax C/C++#include <VFmath.h>
void VF_acc2V( fVector Y, fVector X1, fVector X2, ui size );
void VD_accVF( dVector Y, fVector X1, fVector X2, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::acc2V( const vector<T>& X1, const vector<T>& X2 );
void vector<double>::acc2VF( const vector<float>& X1, const vector<float>& X2 );
Pascal/Delphiuses VFmath;
procedure VF_acc2V( Y, X1, X2:fVector; size:UIntSize );
procedure VD_acc2VF( Y:dVector; X1, X2:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFmath.h>
#include <cudaVDmath.h>
int cudaVF_acc2V( fVector d_Y, fVector d_X1, fVector d_X2, ui size );
int cudaVD_acc2VF( dVector d_Y, fVector d_X1, fVector d_X2, ui size );
void VFcu_acc2V( fVector h_Y, fVector h_X1, fVector h_X2, ui size );
void VDcu_acc2VF( dVector h_Y, fVector h_X1, fVector h_X2, ui size );
CUDA function Pascal/Delphiuses VFmath, VDmath;
function cudaVF_acc2V( d_Y, d_X1, d_X2:fVector; size:UIntSize ): IntBool;
function cudaVD_acc2VF( d_Y:dVector; d_X1, d_X2:fVector; size:UIntSize ): IntBool;
procedure VFcu_acc2V( h_Y, h_X1, h_X2:fVector; size:UIntSize );
procedure VDcu_acc2VF( h_Y:dVector; h_X1, h_X2:fVector; size:UIntSize );
DescriptionYi += X1i + X2i
Error handlingnone
Return valuenone
See alsoVF_accV,   VF_add2V

 

VF_acosVD_acosVE_acos
VCF_acosVCD_acosVCE_acos
VFx_acosVDx_acosVEx_acos
VCFx_acosVCDx_acosVCEx_acos
Functionarcus cosinus function
Syntax C/C++#include <VFmath.h>
int VF_acos( fVector Y, fVector X, ui size );
int VFx_acos( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::acos( const vector<T>& X );
int vector<T>::x_acos( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_acos( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_acos( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_acos( fVector d_Y, fVector d_X, ui size );
int cudaVFx_acos( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_acos( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_acos( fVector h_Y, fVector h_X, ui size );
int VFxcu_acos( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_acos( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_acos( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_acos( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_acos( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_acos( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = arccos ( Xi )
expanded versions: Yi = C * arccos (A*Xi + B )
Error handlingReal versions: DOMAIN errors occur for arguments outside the range −1 ≤ Xi ≤ +1; the default result is NAN ("not-a-number").
The complex versions should be error-proof as long as the parameter C in the expanded versions is not already near the OVERFLOW limit; this very rare error is neither detected nor handled.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_cos,   VF_asin,   VF_atan,   acos

 

VF_addCVD_addCVE_addC
VCF_addCVCD_addCVCE_addC
VCF_addReCVCD_addReCVCE_addReC
VI_addCVBI_addCVSI_addCVLI_addCVQI_addC 
VU_addCVUB_addCVUS_addCVUL_addCVUQ_addCVUI_addC
FunctionAdd a constant to a vector
Syntax C/C++#include <VFmath.h>
void VF_addC( fVector Y, fVector X, ui size, float C);

    (similarly VD_,   VI_, etc.)
#include <VCFmath.h>
void VCF_addC( cfVector Y, cfVector X, ui size, fComplex C );
void VCF_addReC( cfVector Y, cfVector X, ui size, float CRe );

    (similarly VCD_,   VCE_)
C++ VecObj#include <OptiVec.h>
void vector<T>::addC( const vector<T>& X, const T& C); );
void vector<complex<T>>::addC( const vector<complex<T>>& X, complex<T> C );
void vector<complex<T>>::addReC( const vector<complex<T>>& X, const T& CRe );
Pascal/Delphiuses VFmath;
procedure VF_addC( Y, X:fVector; size:UIntSize; C:Single );

    (similarly VD_,   VI_, etc.)
procedure VCF_addC( Y, X:cfVector; size:UIntSize; C:fComplex );
procedure VCF_addReC( Y, X:cfVector; size:UIntSize; CRe:Single );

    (similarly VCD_,   VCE_)
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_addC( fVector d_Y, fVector d_X, ui size, float C );
int cusdVF_addC( fVector d_Y, fVector d_X, ui size, float *d_C );
void VFcu_addC( fVector d_Y, fVector d_X, ui size, float C );
#include <cudaVCFmath.h>
int cudaVCF_addReC( cfVector d_Y, cfVector d_X, ui size, float CRe );
int cusdVCF_addReC( cfVector d_Y, cfVector d_X, ui size, float *d_CRe );
void VCFcu_addReC( cfVector h_Y, cfVector h_X, ui size, float CRe );
CUDA function Pascal/Delphiuses VFmath, VCFmath;
function cudaVF_addC( d_Y, d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_addC( d_Y, d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
procedure VFcu_addC( h_Y, h_X:fVector; size:UIntSize; C:Single );
function cudaVCF_addReC( d_Y, d_X:cfVector; size:UIntSize; CRe:Single );
function cusdVCF_addReC( d_Y, d_X:cfVector; size:UIntSize; d_CRe:PSingle );
procedure VCFcu_addReC( h_Y, h_X:cfVector; size:UIntSize; CRe:Single );
DescriptionYi = Xi + C
The complex floating-point versions exist in two variants, one for complex constants C, the other for real-valued constants CRe added to the complex vector.
Error handlingfloating-point versions: none;
integer versions: see chapter 5.2.
Return valuenone
See alsoVF_addV,   VF_subC,   VF_mulC,   VF_divC,   VF_visC,   VF_redC

 

VF_addVVD_addVVE_addV
VCF_addVVCD_addVVCE_addV
VCF_addReVVCD_addReVVCE_addReV
VFs_addVVDs_addVVEs_addV
VFx_addVVDx_addVVEx_addV
VCFx_addVVCDx_addVVCEx_addV
VCFx_addReVVCDx_addReVVCEx_addReV
VI_addVVBI_addVVSI_addVVLI_addVVQI_addV 
VU_addVVUB_addVVUS_addVVUL_addVVUQ_addVVUI_addV
FunctionAdd two vectors
Syntax C/C++#include <VFmath.h>
void VF_addV( fVector Z, fVector X, fVector Y,ui size );
void VFs_addV( fVector Z, fVector X, fVector Y, ui size, float C );
void VFx_addV( fVector Z, fVector X, fVector Y, ui size, float A, float B );

    (similarly VD_,   VDx_,   VE_,   VEx_,   VI_, etc.)
void VCF_addV( cfVector Z, cfVector X, cfVector Y, ui size );
void VCF_addReV( cfVector Z, cfVector X, fVector Y, ui size );
void VCFx_addV( cfVector Z, cfVector X, cfVector Y, ui size, fComplex A, fComplex B );
void VCFx_addReV( cfVector Z, cfVector X, fVector Y, ui size, fComplex A, fComplex B );

    (similarly VCD_,   VCDx_,   VCE_,   VCEx_)
C++ VecObj#include <OptiVec.h>
void vector<T>::addV( const vector<T>& X, const vector<T>& Y );
void vector<T>::s_addV( const vector<T>& X, const vector<T>& Y, const T& C );
void vector<T>::x_addV( const vector<T>& X, const vector<T>& Y, const T& A, const T& B );
void vector<complex<T>>::addV( const vector<complex<T>>& X, const vector<complex<T>>& Y );
void vector<complex<T>>::addReV( const vector<complex<T>>& X, const vector<T>& Y );
void vector<complex<T>>::x_addV( const vector<complex<T>>& X, const vector<complex<T>>& Y, complex<T> A, complex<T> B );
void vector<complex<T>>::x_addReV( const vector<complex<T>>& X, const vector<T>& Y, complex<T> A, complex<T> B );
Pascal/Delphiuses VFmath;
procedure VF_addV( Z, X, Y:fVector; size:UIntSize );
procedure VFs_addV( Z, X, Y:fVector; size:UIntSize; C:Single );
procedure VFx_addV( Z, X, Y:fVector; size:UIntSize; A, B:Single );

    (similarly VD_,   VDx_,   VE_,   VEx_,   VI_, etc.)
procedure VCF_addV( Z, X, Y:cfVector; size:UIntSize );
procedure VCF_addReV( Z, X:cfVector; Y:fVector; size:UIntSize );
procedure VCFx_addV( Z, X, Y:cfVector; size:UIntSize; A, B:fComplex );
procedure VCFx_addReV( Z, X:cfVector; Y:fVector; size:UIntSize; A, B:fComplex );

    (similarly VCD_, VCDx_, VCE_,   VCEx_)
CUDA function C/C++#include <cudaVFmath.h>
#include <cudaVCFmath.h>
int cudaVF_addV( fVector d_Z, fVector d_X, fVector d_Y,ui size );
int cudaVFs_addV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float C );
int cusdVFs_addV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float *d_C );
int cudaVFx_addV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float A, float B );
int cusdVFx_addV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float *d_A, float *d_B );
int cudaVCF_addReV( cfVector d_Z, cfVector d_X, fVector d_Y, ui size );
int cudaVCFx_addReV( cfVector d_Z, cfVector d_X, fVector d_Y, ui size, fComplex A, fComplex B );
int cusdVCFx_addReV( cfVector d_Z, cfVector d_X, fVector d_Y, ui size, fComplex *d_A, fComplex *d_B );
void VFcu_addV( fVector h_Z, fVector h_X, fVector h_Y,ui size );
void VFscu_addV( fVector h_Z, fVector h_X, fVector h_Y, ui size, float C );
void VFxcu_addV( fVector h_Z, fVector h_X, fVector h_Y, ui size, float A, float B );
void VCFcu_addReV( cfVector h_Z, cfVector h_X, fVector h_Y, ui size );
void VCFxcu_addV( cfVector h_Z, cfVector h_X, cfVector h_Y, ui size, fComplex A, fComplex B );
void VCFxcu_addReV( cfVector h_Z, cfVector h_X, fVector h_Y, ui size, fComplex A, fComplex B );
CUDA function Pascal/Delphiuses VFmath, VCFmath;
function cudaVF_addV( d_Z, d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cudaVFs_addV( d_Z, d_X, d_Y:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVFs_addV( d_Z, d_X, d_Y:fVector; size:UIntSize; d_C:PSingle ): IntBool;
function cudaVFx_addV( d_Z, d_X, d_Y:fVector; size:UIntSize; A, B:Single ): IntBool;
function cusdVFx_addV( d_Z, d_X, d_Y:fVector; size:UIntSize; d_A, d_B:PSingle ): IntBool;
function cudaVCF_addReV( d_Z, d_X:cfVector; d_Y:fVector; size:UIntSize ): IntBool;
function cudaVCFx_addReV( d_Z, d_X:cfVector; d_Y:fVector; size:UIntSize; A, B:fComplex ): IntBool;
function cusdVCFx_addReV( d_Z, d_X:cfVector; d_Y:fVector; size:UIntSize; d_A, d_B:PfComplex ): IntBool;
procedure VFcu_addV( h_Z, h_X, h_Y:fVector; size:UIntSize );
procedure VFscu_addV( h_Z, h_X, h_Y:fVector; size:UIntSize; C:Single );
procedure VFxcu_addV( h_Z, h_X, h_Y:fVector; size:UIntSize; A, B:Single );
procedure VCFcu_addReV( h_Z, h_X:cfVector; h_Y:fVector; size:UIntSize );
procedure VCFxcu_addReV( h_Z, h_X:cfVector; h_Y:fVector; size:UIntSize; A, B:fComplex );
Descriptionsimple versions: Zi = Xi + Yi
scaled versions: Zi = C * (Xi + Yi)
expanded versions: Zi = (A * Xi + B) + Yi
The complex floating-point versions exist in two variants. In the first variant (e.g.VCF_addV,   VCFx_addV), X, Y, and Z are all complex; in the second variant, Y is real-valued (e.g., VCF_addReV - "add a real vector").
Error handlingfloating-point versions: none;
integer versions: see chapter 5.2.
Return valuenone
See alsoVF_addC,   VF_add2V,   VF_subV,   VF_mulV,   VF_divV,   VF_accV,   VF_addVI

 

VF_addVIVD_addVIVE_addVI
VF_addVBIVD_addVBIVE_addVBI
VF_addVSIVD_addVSIVE_addVSI
VF_addVLIVD_addVLIVE_addVLI
VF_addVQIVD_addVQIVE_addVQI
VF_addVUVD_addVUVE_addVU
VF_addVUBVD_addVUBVE_addVUB
VF_addVUSVD_addVUSVE_addVUS
VF_addVULVD_addVULVE_addVUL
VF_addVUQVD_addVUQVE_addVUQ
VF_addVUIVD_addVUIVE_addVUI
FunctionAdd an integer vector to a floating-point vector
Syntax C/C++#include <VFmath.h>
void VF_addVI( fVector Z, fVector X, iVector Y,ui size );
void VF_addVUB( fVector Z, fVector X, ubVector Y, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::addVI( const vector<T>& X, const vector<int>& Y );
void vector<T>::addVUS( const vector<T>& X, const vector<unsigned short>& Y, );
Pascal/Delphiuses VFmath;
procedure VF_addVI( Z, X:fVector; Y:iVector; size:UIntSize );
procedure VF_addVUL( Z, X:fVector; Y:ulVector; size:UIntSize );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_addVI( fVector d_Z, fVector d_X, iVector d_Y,ui size );
int cudaVF_addVUB( fVector d_Z, fVector d_X, ubVector d_Y, ui size );
void VFcu_addVI( fVector h_Z, fVector h_X, iVector h_Y,ui size );
void VFcu_addVUB( fVector h_Z, fVector h_X, ubVector h_Y, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_addVI( d_Z, d_X:fVector; d_Y:iVector; size:UIntSize ): IntBool;
function cudaVF_addVUL( d_Z, d_X:fVector; d_Y:ulVector; size:UIntSize ): IntBool;
procedure VFcu_addVI( h_Z, h_X:fVector; h_Y:iVector; size:UIntSize );
procedure VFcu_addVUL( h_Z, h_X:fVector; h_Y:ulVector; size:UIntSize );
DescriptionZi = Xi + Yi
Error handlingnone
Return valuenone
See alsoVF_addV,   VF_accV

 

VF_add2VVD_add2VVE_add2V
FunctionAdd three vectors
Syntax C/C++#include <VFmath.h>
void VF_add2V( fVector Z, fVector X, fVector Y1, fVector Y2, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::add2V( const vector<T>& X, const vector<T>& Y1, const vector<T>& Y2 );
Pascal/Delphiuses VFmath;
procedure VF_add2V( Z, X, Y1, Y2:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_add2V( fVector d_Z, fVector d_X, fVector d_Y1, fVector d_Y2, ui size );
void VFcu_add2V( fVector h_Z, fVector h_X, fVector h_Y1, fVector h_Y2, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_add2V( d_Z, d_X, d_Y1, d_Y2:fVector; size:UIntSize ): IntBool;
procedure VFcu_add2V( h_Z, h_X, h_Y1, h_Y2:fVector; size:UIntSize );
DescriptionZi = Xi + Y1i + Y2i
Error handlingnone
Return valuenone
See alsoVF_addV,   VF_sub2V

 

VI_andVBI_andVSI_andVLI_andVQI_and 
VU_andVUB_andVUS_andVUL_andVUQ_andVUI_and
FunctionBit-wise AND operation.
Syntax C/C++#include <VImath.h>
void VI_and( iVector Y, iVector X, ui size, int C );

    (similarly all other functions of this family)
C++ VecObj#include <OptiVec.h>
void vector<T>::and( const vector<T>& X, const T& C );
Pascal/Delphiuses VImath;
procedure VI_and( Y, X:iVector; size:UIntSize; C:Integer );

    (similarly all other functions of this family)
CUDA function C/C++#include <cudaVImath.h>
int cudaVI_and( iVector d_Y, iVector d_X, ui size, int C );
int cusdVI_and( iVector d_Y, iVector d_X, ui size, int *d_C );
void VIcu_and( iVector h_Y, iVector h_X, ui size, int C );
CUDA function Pascal/Delphiuses VImath;
function cudaVI_and( d_Y, d_X:iVector; size:UIntSize; C:Integer ): IntBool;
function cusdVI_and( d_Y, d_X:iVector; size:UIntSize; d_C:PInteger ): IntBool;
procedure VIcu_and( h_Y, h_X:iVector; size:UIntSize; C:Integer );
DescriptionYi = (Xi) & C
The bit-wise AND operation is performed on each element Xi with the bit-mask given by C. A bit is 1 in Yi, if it was 1 both in Xi and in C, and 0 otherwise. Perhaps the most useful application of this family of functions is the fast "modulo" operation on unsigned or positive numbers with the modulus being an integer power of 2. For example, a modulo division by 64 is performed by
VU_and( Y, X, size, 64−1 );
Error handlingnone
Return valuenone
See alsoVI_not,   VI_or,   VI_xor

 

VCF_argVCD_argVCE_arg
VPF_argVPD_argVPE_arg
FunctionArgument (angle in polar coordinates).
Syntax C/C++#include <VCFstd.h>
void VCF_arg( fVector Arg, cfVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::arg( const vector<complex<T>>& X );
Pascal/Delphiuses VCFstd;
procedure VCF_arg( Arg:fVector; X:cfVector; size:UIntSize );
CUDA function C/C++#include <cudaVCFstd.h>
int cudaVCF_arg( fVector d_Arg, cfVector d_X, ui size );
void VCFcu_arg( fVector h_Arg, cfVector h_X, ui size );
CUDA function Pascal/Delphiuses VCFstd;
function cudaVCF_arg( d_Arg:fVector; d_X:cfVector; size:UIntSize ): IntBool;
procedure VCFcu_arg( h_Arg:fVector; h_X:cfVector; size:UIntSize );
DescriptionIdentical to VF_CtoArg,   VD_CtoArg,   VE_CtoArg, resp. See these functions for details.

 

VF_ArgtoPVD_ArgtoPVE_ArgtoP
FunctionOverwrite the Arg part of a polar complex vector with a real vector
Syntax C/C++#include <VPFstd.h>
void VF_ArgtoP( pfVector Y, fVector Arg, ui size );
C++ VecObj#include <OptiVec.h>
void vector<polar<T>>::ArgtoP( const vector<T>& Arg );
Pascal/Delphiuses VPFstd;
procedure VF_ArgtoP( X:pfVector; Arg:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVPFstd.h>
int cudaVF_ArgtoP( pfVector d_Y, fVector d_Arg, ui size );
void VFcu_ArgtoP( pfVector h_Y, fVector h_Arg, ui size );
CUDA function Pascal/Delphiuses VPFstd;
function cudaVF_ArgtoP( d_X:pfVector; d_Arg:fVector; size:UIntSize ): IntBool;
procedure VFcu_ArgtoP( h_X:pfVector; h_Arg:fVector; size:UIntSize );
DescriptionThe Arg part of the polar complex vector Y is overwritten with the elements of the real-valued vector Arg. The Mag part of Y is not affected.
Error handlingnone
Return valuenone
See alsoVF_PtoMagArg,   VF_MagArgtoP

 

VF_asinVD_asinVE_asin
VCF_asinVCD_asinVCE_asin
VFx_asinVDx_asinVEx_asin
VCFx_asinVCDx_asinVCEx_asin
Functionarcus sinus function
Syntax C/C++#include <VFmath.h>
int VF_asin( fVector Y, fVector X, ui size );
int VFx_asin( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::asin( const vector<T>& X );
int vector<T>::x_asin( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_asin( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_asin( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_asin( fVector d_Y, fVector d_X, ui size );
int cudaVFx_asin( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_asin( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_asin( fVector h_Y, fVector h_X, ui size );
int VFxcu_asin( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_asin( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_asin( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_asin( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_asin( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_asin( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = arcsin ( Xi )
expanded versions: Yi = C * arcsin (A*Xi + B )
Error handlingReal versions: DOMAIN errors occur for arguments outside the range −1 ≤ Xi ≤ +1; the default result is NAN ("not-a-number").
The complex versions should be error-proof as long as the parameter C in the expanded versions is not already near the OVERFLOW limit; this very rare error is either detected nor handled.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_sin,   VF_acos,   VF_atan,   asin

 

VF_atanVD_atanVE_atan
VCF_atanVCD_atanVCE_atan
VFx_atanVDx_atanVEx_atan
VCFx_atanVCDx_atanVCEx_atan
Functionarcus tangens function
Syntax C/C++#include <VFmath.h>
int VF_atan( fVector Y, fVector X, ui size );
int VFx_atan( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::atan( const vector<T>& X );
int vector<T>::x_atan( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_atan( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_atan( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_atan( fVector d_Y, fVector d_X, ui size );
int cudaVFx_atan( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_atan( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_atan( fVector h_Y, fVector h_X, ui size );
int VFxcu_atan( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_atan( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_atan( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_atan( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_atan( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_atan( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = arctan ( Xi )
expanded versions: Yi = C * arctan (A*Xi + B )
Error handlingThe real versions should be error-proof as long as the parameter C in the expanded versions is not already near the OVERFLOW limit; this very rare error is neither detected nor handled.
In the complex versions, the result for an argument of {0, −1} is set to {0, -p} without notice (and without the program crash resulting from calling the complex atan with this argument in some compilers).
Return valuealways FALSE (0).
See alsoVF_tan,   VF_asin,   VF_acos,   VF_atan2,   atan,   atan2

 

VF_atan2VD_atan2VE_atan2
VFx_atan2VDx_atan2VEx_atan2
Functionarcus tangens function of quotients
Syntax C/C++#include <VFmath.h>
int VF_atan2( fVector Z, fVector X, fVector Y, ui size );
int VFx_atan2( fVector Z, fVector X, fVector Y, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::atan2( const vector<T>& X, const vector<T>& Y );
int vector<T>::x_atan2( const vector<T>& X, const vector<T>& Y, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_atan2( Z, X, Y:fVector; size:UIntSize ): IntBool;
function VFx_atan2( Z, X, Y:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_atan2( fVector d_Z, fVector d_X, fVector d_Y, ui size );
int cudaVFx_atan2( fVector d_Z, fVector d_X, fVector d_Y, ui size, float A, float B, float C );
int cusdVFx_atan2( fVector d_Z, fVector d_X, fVector d_Y, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_atan2( fVector h_Z, fVector h_X, fVector h_Y, ui size );
int VFxcu_atan2( fVector h_Z, fVector h_X, fVector h_Y, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_atan2( d_Z, d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cudaVFx_atan2( d_Z, d_X, d_Y:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_atan2( d_Z, d_X, d_Y:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_atan2( h_Z, h_X, h_Y:fVector; size:UIntSize ): IntBool;
function VFxcu_atan2( h_Z, h_X, h_Y:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Zi = arctan( Yi / Xi )
expanded versions: Zi = C * arctan( Yi / (A*Xi+B) )
From Cartesian X -Y-coordinates, the angle of the corresponding polar coordinates is calculated.
Note: in comparison to the ANSI C function atan2, the ordering of the parameters X and Y is reversed.
Error handlingIf Xi and Yi are both zero, a DOMAIN error results with the default result NAN ("not-a-number").
In C/C++, this error is handled by _matherr and _matherrl with Xi and Yi as e->x and e->y.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_tan,   VF_asin,   VF_acos,   VF_atan,  atan,  atan2

 

VF_autocorrVD_autocorrVE_autocorr
VFb_autocorrVDb_autocorrVEb_autocorr
Functionautocorrelation function
Syntax C/C++#include <VFstd.h>
void VF_autocorr( fVector Y, fVector X, ui size );
void VFb_autocorr( fVector Y, fVector X, ui size, fVector Buf );
C++ VecObj#include <OptiVec.h>
void vector<float>::autocorr( const vector<float>& X );
void vector<float>::b_autocorr( const vector<float>& X, vector<float>& Buf );
Pascal/Delphiuses VFstd;
procedure VF_autocorr( Y, X:fVector; size:UIntSize );
procedure VFb_autocorr( Y, X:fVector; size:UIntSize; Buf:fVector );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_autocorr( fVector d_Y, fVector d_X, ui size );
void VFcu_autocorr( fVector h_Y, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_autocorr( d_Y, d_X:fVector; size:UIntSize ): IntBool;
procedure VFcu_autocorr( h_Y, h_X:fVector; size:UIntSize );
DescriptionThe autocorrelation function (ACF) of X is calculated and stored in Y in wrap-around order: Y0 to Ysize/2−1 contain the ACF for zero and positive lags. Beginning with the most negative lag in Ysize/2+1, the elements up to Ysize−1 contain the ACF for negative lags. Since this function assumes X to be periodic, the ACF for the most positive lag is identical to the ACF for the most negative lag. This element is stored as Ysize/2.
To get the ACF into normal order, you may call
VF_rotate( Y, Y, size, size/2 );
After that, the zero point is at the position size/2.

In case X is non-periodic, you should avoid end effects by the methods described in connection with VF_convolve.

Internally, VF_autocorr allocates and frees additional workspace memory. For repeated calls, this would be inefficient. In such a case, it is recommended to use VFb_autocorr instead. The size of Buf must be ≥ size. Additionally, Buf must be 128-bit (P8) or 256-bit (P9) aligned. This usually means you can only take a vector allocated by the VF_vector family as Buf.

Error handlingIf size is not a power of 2, VF_FFT (on which VF_autocorr is based) complains "Size must be an integer power of 2" and the program is aborted.
Return valuenone
See alsoVF_FFT,   VF_convolve,   VF_xcorr,   VF_spectrum

 

VCF_autoPlotVCD_autoPlotVCE_autoPlot
FunctionAutomatic plot of a complex vector into a Cartesian complex plane.
Syntax C/C++#include <Vgraph.h>
void VCF_autoPlot( cfVector X, ui size, unsigned form, COLORREF color );
C++ VecObj#include <OptiVec.h>
void vector<complex<T>>::autoPlot( unsigned form, COLORREF color );
Pascal/Delphiuses Vgraph;
procedure VCF_autoPlot( X:cfVector; size:UIntSize; form:UInt; color:COLORREF );
DescriptionA Cartesian complex plane is drawn with the axes automatically scaled and the vector X plotted into it. For a description of the parameters form and color, see VF_xyAutoPlot. The plotting routines have to be initialized by V_initPlot prior to calling VCF_autoPlot.
Error handlingnone
Return valuenone
See alsoVCF_2AutoPlot,   VCF_dataPlot,   VF_xyAutoPlot,  chapter 4.12

 

VCF_2AutoPlotVCD_2AutoPlotVCE_2AutoPlot
FunctionAutomatic plot of two complex vectors into a Cartesian complex plane.
Syntax C/C++#include <Vgraph.h>
void VCF_2AutoPlot( cfVector X1, ui size1, unsigned form1, COLORREF color1, cfVector X2, ui size2, unsigned form2, COLORREF color2 );
C++ VecObj#include <OptiVec.h>
void vector<complex<T>>::_2AutoPlot( unsigned form1, COLORREF color1, const vector<complex<T>>& X2, unsigned form2, COLORREF color2 );
Pascal/Delphiuses Vgraph;
procedure VCF_2AutoPlot( X1:cfVector; size1:UIntSize; form1:UInt; color1:COLORREF; X2:cfVector; size2:UIntSize; form2:UInt; color2:COLORREF );
DescriptionA Cartesian complex plane is drawn with the axes automatically scaled and the vectors X1 and X2 plotted into it. For a description of the parameters form1, form2, color1, and color2, see VF_xyAutoPlot. The plotting routines have to be initialized by V_initPlot prior to calling VCF_2AutoPlot.
Note the leading underbar in the VecObj function. (It is necessary, as C/C++ does not allow function names to begin with a number.)
Error handlingnone
Return valuenone
See alsoVCF_autoPlot,   VCF_dataPlot,   VF_xyAutoPlot,  chapter 4.11

 

VF_avdevCVD_avdevCVE_avdevC
Functionaverage deviation from a preset value
Syntax C/C++#include <VFstd.h>
float VF_avdevC( fVector X, ui size, float C );
C++ VecObj#include <OptiVec.h>
T vector<T>::avdevC( const T& C );
Pascal/Delphiuses VFstd;
function VF_avdevC( X:fVector; size:UIntSize; C:Single ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_avdevC( float *h_RetVal, fVector d_X, ui size, float C );
int cusdVF_avdevC( float *d_RetVal, fVector d_X, ui size, float *d_C );
float VFcu_avdevC( fVector X, ui size, float C );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_avdevC( var h_RetVal:Single; d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_avdevC( d_RetVal:PSingle; d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
function VFcu_avdevC( h_X:fVector; size:UIntSize; C:Single ): Single;
DescriptionavdevC = 1/size * sum( |Xi - C| )
The average of the absolute deviation of each element of X from C is calculated and returned.
Error handlingnone
Return valueaverage deviation.
See alsoVF_ssq,   VF_ssqdevC,   VF_avdevV,   VF_sumdevC,   VF_chiabs

 

VF_avdevVVD_avdevVVE_avdevV
Functionaverage deviation of the elements of one vector from the corresponding elements of another vector.
Syntax C/C++#include <VFstd.h>
float VF_avdevV( fVector X, fVector Y, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::avdevV( const vector<T>& Y );
Pascal/Delphiuses VFstd;
function VF_avdevV( X, Y:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_avdevV( float *h_RetVal, fVector X, fVector Y, ui size );
int cusdVF_avdevV( float *d_RetVal, fVector X, fVector Y, ui size );
float VFcu_avdevV( fVector h_X, fVector h_Y, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_avdevV( var h_RetVal:Single; d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cusdVF_avdevV( d_RetVal:PSingle; d_X, d_Y:fVector; size:UIntSize ): IntBool;
function VFcu_avdevC( h_X, h_Y:fVector; size:UIntSize ): Single;
DescriptionavdevV = 1/size * sum( |Xi - Yi| )
The average of the absolute deviation of each element of X from the corresponding element of Y is calculated.
Error handlingnone
Return valueaverage deviation.
See alsoVF_ssq,   VF_ssqdevV,   VF_avdevC,   VF_sumdevV,   VF_chiabs

 

VF_biquadVD_biquadVE_biquad
FunctionBiquadratic filtering
Syntax C/C++#include <VFstd.h>
void VF_biquad( fVector Y, fVector X, ui size, fVector Param );
C++ VecObj#include <OptiVec.h>
void vector<T>::biquad( const vector<T>& X, const vector<T>& Param, );
Pascal/Delphiuses VFstd;
procedure VF_biquad( Y,X:fVector; size:UIntSize; Param:fVector );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_biquad( fVector d_Y, fVector d_X, ui size, fVector h_Param );
int cusdVF_biquad( fVector d_Y, fVector d_X, ui size, fVector d_Param );
float VFcu_biquad( fVector h_Y, fVector h_X, ui size, fVector h_Param );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_biquad( d_Y, d_X:fVector; size:UIntSize; h_Param:fVector ): IntBool;
function cusdVF_biquad( d_Y, d_X:fVector; size:UIntSize; d_Param:fVector ): IntBool;
procedure VFcu_biquad( h_Y, h_X:fVector; size:UIntSize; h_Param:fVector );
DescriptionA bi-quadratic filter, used mostly in audio data processing, calculates output from input values according to the formula:
Y[i] = a0*X[i] + a1*X[i−1] + a2*X[i-2] - b1*Y[i−1] - b2*Y[i-2]
As this is a recursive filter, the function needs not only the filter coefficients themselves, but also the two input and two output values preceding the data passed in the input vector. All these values are passed to VF_biquad in the vector Param, containing nine entries:
Param[0]=a0 Param[1]=a1 Param[2]=a2 Param[3]=b1 Param[4]=b2 Param[5]=X[−1] Param[6]=X[-2] Param[7]=Y[−1] Param[8]=Y[-2]
Error handlingnone
Return valuenone
See alsoVF_filter,   VF_smooth

 

VCF_cabsmaxVCD_cabsmaxVCE_cabsmax
FunctionElement of largest absolute value within one vector
Syntax C/C++#include <VCFstd.h>
fComplex VCF_cabsmax( cfVector X, ui size);
C++ VecObj#include <OptiVec.h>
T vector<complex<T>>::cabsmax();
Pascal/Delphiuses VCFstd;
function VCF_cabsmax( X:cfVector; size:UIntSize ):fComplex;

Alternative syntax (obsolete, but still supported):
procedure VCF_cabsmax( var RetVal:fComplex; X:cfVector; size:UIntSize );

    (similarly VCD_,   VCE_)
CUDA function C/C++#include <cudaVCFstd.h>
int cudaVCF_cabsmax( fComplex *h_RetVal, cfVector d_X, ui size );
int cusdVCF_cabsmax( fComplex *d_RetVal, cfVector d_X, ui size );
fComplex VCFcu_cabsmax( cfVector h_X, ui size );
CUDA function Pascal/Delphiuses VCFstd;
function cudaVCF_cabsmax( var h_RetVal:fComplex; d_X:cfVector; size:UIntSize ): IntBool;
function cusdVCF_cabsmax( d_RetVal:PfComplex; d_X:cfVector; size:UIntSize ): IntBool;
function VCFcu_cabsmax( h_X:cfVector; size:UIntSize ):fComplex;
DescriptionThe absolute values of all elements of a cartesian-complex vector are compared and the element with the largest absolute value is returned. A variant of this function, finding the largest element in terms of the sum |Re| + |Im|, is offered by VCF_sabsmax. The latter function is much faster than VCF_cabsmax.
Error handlingnone
Return valuelargest element in terms of absolute value
See alsoVCF_absmax,   VCF_absmaxReIm,   VCF_sabsmax

 

VCF_cabsminVCD_cabsminVCE_cabsmin
FunctionElement of smallest absolute value within one vector
Syntax C/C++#include <VCFstd.h>
fComplex VCF_cabsmin( cfVector X, ui size);
C++ VecObj#include <OptiVec.h>
T vector<complex<T>>::cabsmin();
Pascal/Delphiuses VCFstd;
function VCF_cabsmin( X:cfVector; size:UIntSize ):fComplex;

Alternative syntax (obsolete, but still supported):
procedure VCF_cabsmin( var RetVal:fComplex; X:cfVector; size:UIntSize );

    (similarly VCD_,   VCE_)
CUDA function C/C++#include <cudaVCFstd.h>
int cudaVCF_cabsmin( fComplex *h_RetVal, cfVector d_X, ui size );
int cusdVCF_cabsmin( fComplex *d_RetVal, cfVector d_X, ui size );
fComplex VCFcu_cabsmin( cfVector h_X, ui size );
CUDA function Pascal/Delphiuses VCFstd;
function cudaVCF_cabsmin( var h_RetVal:fComplex; d_X:cfVector; size:UIntSize ): IntBool;
function cusdVCF_cabsmin( d_RetVal:PfComplex; d_X:cfVector; size:UIntSize ): IntBool;
function VCFcu_cabsmin( h_X:cfVector; size:UIntSize ):fComplex;
DescriptionThe absolute values of all elements of a cartesian-complex vector are compared and the element with the smallest absolute value is returned. A variant of this function, finding the smallest element in terms of the sum |Re| + |Im|, is offered by VCF_sabsmin. The latter function is much faster than VCF_cabsmin.
Error handlingnone
Return valuesmallest element in terms of absolute value
See alsoVCF_absmin,   VCF_absminReIm,   VCF_sabsmin

 

V_CDtoCFV_CDtoCE
V_CEtoCFV_CEtoCD
V_CFtoCDV_CFtoCE
FunctionData type conversions. See V_FtoD.

 

VF_ceilVD_ceilVE_ceil
VF_ceiltoIVD_ceiltoIVE_ceiltoI
VF_ceiltoBIVD_ceiltoBIVE_ceiltoBI
VF_ceiltoSIVD_ceiltoSIVE_ceiltoSI
VF_ceiltoLIVD_ceiltoLIVE_ceiltoLI
VF_ceiltoQIVD_ceiltoQIVE_ceiltoQI
VF_ceiltoUVD_ceiltoUVE_ceiltoU
VF_ceiltoUBVD_ceiltoUBVE_ceiltoUB
VF_ceiltoUSVD_ceiltoUSVE_ceiltoUS
VF_ceiltoULVD_ceiltoULVE_ceiltoUL
VF_ceiltoUQVD_ceiltoUQVE_ceiltoUQ
VF_ceiltoUIVD_ceiltoUIVE_ceiltoUI
FunctionRounding to the next whole number that is greater or equal.
Syntax C/C++#include <VFmath.h>
int VF_ceil( fVector Y, fVector X, ui size );
int VF_ceiltoI( iVector Y, fVector X, ui size );
int VF_ceiltoLI( liVector Y, fVector X, ui size );

    (similarly all other functions of this family)
C++ VecObj#include <OptiVec.h>
int vector<T>::ceil( const vector<T>& X );
int vector<int>::ceiltoI( const vector<T>& X );
int vector<long>::ceiltoLI( const vector<T>& X );
Pascal/Delphiuses VFmath;
function VF_ceil( Y, X:fVector; size:UIntSize ): IntBool;
function VF_ceiltoI( Y:iVector; X:fVector; size:UIntSize ): IntBool;
function VF_ceiltoLI( Y:liVector; X:fVector; size:UIntSize ): IntBool;

    (similarly all other functions of this family)
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_ceil( fVector d_Y, fVector d_X, ui size );
int cudaVF_ceiltoI( iVector d_Y, fVector d_X, ui size );
int VFcu_ceil( fVector h_Y, fVector h_X, ui size );
int VFcu_ceiltoI( iVector h_Y, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_ceil( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVF_ceiltoI( d_Y:iVector; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_ceil( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFcu_ceiltoI( h_Y:iVector; h_X:fVector; size:UIntSize ): IntBool;
DescriptionEach element of X is rounded to the nearest whole number that is greater than or equal to the input number and the result stored in Y. The functions VF_ceiltoI,   VF_ceiltoLI,   VF_ceiltoU etc. convert the result into the various integer data types (in the cases mentioned, to int, long int, and unsigned, resp.).
Error handlingOVERFLOW errors are handled by setting the result to the extreme value possible. Negative numbers in the versions VF_ceiltoU,   VF_ceiltoUS,   VF_ceiltoUL, and VF_ceiltoUI lead to DOMAIN errors; they are handled by setting the result to 0.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_round,   VF_floor,   VF_chop,   VF_trunc,   ceil,   floor (C/C++ only)

 

VF_centerOfGravityIndVD_centerOfGravityIndVE_centerOfGravityInd
FunctionCenter of Gravity of an array, assuming its indices as the abscissa
Syntax C/C++#include <VFstd.h>
float VF_centerOfGravityInd( fVector X, ui siz );
C++ VecObj#include <OptiVec.h>
T vector<T>::centerOfGravityInd();
Pascal/Delphiuses VFstd;
function VF_centerOfGravityInd( X:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_centerOfGravityInd( float *h_RetVal, fVector d_X, ui siz );
int cusdVF_centerOfGravityInd( float *d_RetVal, fVector d_X, ui siz );
float VFcu_centerOfGravityInd( fVector h_X, ui siz );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_centerOfGravityInd( var h_RetVal:Single; d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_centerOfGravityInd( d_RetVal:PSingle; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_centerOfGravityInd( h_X:fVector; size:UIntSize ): Single;
DescriptionThe center of gravity of the vector X is calculated according to the formula:
COG = sum( Xi * i ) / sum( Xi ).
It is assumed that the values of X represent point masses, situated at the positions given by their indices. The center of gravity is returned as a real number, as it will normally fall in between of two adjacent indices. If all elements of X are 0, there is no mass and no gravity; nevertheless, the center of gravity is assumed as the mid-point of X, i.e. (size−1) / 2.
To calculate the center of gravity of a vector over an abscissa explicitly given (rather than over its indices), call VF_centerOfGravityV.
Error handlingnone
Return valueThe position of the center of gravity is returned.
See alsoVF_centerOfGravityV

 

VF_centerOfGravityVVD_centerOfGravityVVE_centerOfGravityV
FunctionCenter of Gravity of an array over an explicitly given abscissa
Syntax C/C++#include <VFstd.h>
float VF_centerOfGravityV( fVector X, fVector Y, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::centerOfGravityV( const vector<T>& X );
Pascal/Delphiuses VFstd;
function VF_centerOfGravityV( X, Y:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_centerOfGravityV( float *h_RetVal, fVector d_X, fVector d_Y, ui siz );
int cusdVF_centerOfGravityV( float *d_RetVal, fVector d_X, fVector d_Y, ui siz );
float VFcu_centerOfGravityV( fVector h_X, fVector h_Y, ui siz );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_centerOfGravityV( var h_RetVal:Single; d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cusdVF_centerOfGravityV( d_RetVal:PSingle; d_X, d_Y:fVector; size:UIntSize ): IntBool;
function VFcu_centerOfGravityV( h_X, h_Y:fVector; size:UIntSize ): Single;
DescriptionThe center of gravity of the vector Y = f(X) is calculated according to the formula:
COG = sum( Yi * Xi ) / sum( Yi ).
It is assumed that the values of Y represent point masses, situated at the positions given by X. If all elements of X are 0, there is no mass and no gravity; nevertheless, the center of gravity is assumed as the mid-point of X, i.e. (X[size−1] - X[0]) / 2.
To calculate the center of gravity of a vector over its indices as the abscissa, call VF_centerOfGravityInd.
Error handlingnone
Return valueThe (interpolated) position of the center of gravity on the X axis is returned.
See alsoVF_centerOfGravityInd

 

V_checkBoundaries
FunctionCheck vector / matrix and associated size parameters for dimension consistency
Syntax C/C++#include <Veclib.h>
void V_checkBoundaries( void *X, ui size, int FlagRW, char *funcname );
Pascal/Delphiuses Veclib;
procedure V_checkBoundaries( X:Pointer; size:UIntSize; FlagRW:Integer; funcname:PChar );
DescriptionThe single-most frequent cause of hard-to-find errors in vector and matrix calculations is dimension mismatch, leading to violations of the vector or matrix boundaries. The resulting corruption of the heap, in turn, usually leads to problems and crashes much later in the program flow, so that it is very difficult to identify the origin of the problem. This is the reason why we developed the dimension-checking debug libraries (VCF4WD.LIB for Borland / CodeGear C++, OVVC4D.LIB for Visual C++, units in LIB4D for Delphi). In these debug libraries, every vector or matrix function of OptiVec calls V_checkBoundaries in order to assert dimension consistency. V_checkBoundaries checks if the allocated size of X is enough for the parameter size which was passed to the respective function. If any irregularity is detected, error and/or warning messages are generated. Thereby, it is made much easier to track and locate the offending code.
Although the primary purpose of this function is its internal use inside the debug libraries of OptiVec, you may call this function also from your own routines for consistency checks.

Input parameters of V_checkBoundaries:
XThe definition as a generalized pointer (void * in C/C++, Pointer in Pascal/Delphi) means that this function will accept any vector or matrix, regardless of type.
sizeThe size in bytes, up to which the respective vector / matrix will be read or written
FlagRWBit 0 of this flag indicates read (0) or write (1). If both read and write will occur for the same vector, write (1) is signaled.
Bit 1 indicates if X is a vector (0) or a matrix (1).
E.g., a vector that will be read only is signaled by FlagRW = 0,  a matrix that will be written is signaled by FlagRW=2+1.
funcnameA string, containing the name of the function under scrutiny
 
V_checkBoundaries identifies the following types of problems and takes the appropriate measures:
Detected problemError messageFurther measures
X = NULL or nilFuncName: read / write at address 0000.Program execution is immediately halted to avoid further damage.
size = 0FuncName: Function called with size = 0 (must be ≥ 1)Program execution is immediately halted to avoid further damage.
size > VectorSizeFuncName: Boundary violation: vector / matrix starting at StartAddress, ending at EndAddress, is read / written up to OffendingAddress.Program execution is continued.
X is a subvector, and size > RemainingVectorSizeFuncName: Boundary violation: subvector / submatrix StartAddress of BasicAddress, ending at EndAddress, is read / written up to OffendingAddress.Program execution is continued.
X not allocated as OptiVec vector / matrixFuncName: Warning: read / write of unallocated or non-OptiVec vector StartAddressProgram execution is continued.
 
In case you have to use static arrays (or arrays dynamic allocated with malloc or the Windows API memory functions) and do not want to see the latter warning message, you may call
V_setBoundaryCheckWarn( 0 );  (C/C++) or
V_setBoundaryCheckWarn( FALSE );  (Pascal / Delphi).
This will switch off only the described warning messages. It does not affect the error messages.

Error handlingnone
Return valuenone
See alsoV_setBoundaryCheckWarn

 

VF_chexprintVD_chexprintVE_chexprint
VCF_chexprintVCD_chexprintVCE_chexprint
VPF_chexprintVPD_chexprintVPE_chexprint
VI_chexprintVBI_chexprintVSI_chexprintVLI_chexprintVQI_chexprint 
VU_chexprintVUB_chexprintVUS_chexprintVUL_chexprintVUQ_chexprintVUI_chexprint
Functionprint a vector in hexadecimal format to the screen. Only for console applications
Syntax C/C++#include <VFstd.h>
void VF_chexprint( fVector X, ui size, unsigned nperline );
C++ VecObj#include <OptiVec.h>
void vector<T>::chexprint( unsigned nperline );
Pascal/Delphiuses VFstd;
procedure VF_chexprint( X:fVector; size:UIntSize; nperline:UInt );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_chexprint( fVector d_X, ui size, unsigned nperline );
int cudaVF_chexprint_buf( fVector d_X, ui size, unsigned nperline, fVector h_Wk );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_chexprint( d_X:fVector; size:UIntSize; nperline:UInt ): IntBool;
function cudaVF_chexprint_buf( d_X:fVector; size:UIntSize; nperline:UInt; h_Wk:fVector ): IntBool;
DescriptionWindows with MS Visual C++ or Borland / Embarcadero compilers:
size elements of X are printed in hexadecimal format to the screen (or "console"), into the actual text window, nperline elements in each line.
The display starts always with a new line. Please note that this may lead to an empty line at the beginning.
Each line begins with the index of the first element printed into that line. The index is followed by a colon and by the requested nperline elements.
Cartesian complex numbers are printed in braces, with the real and imaginary parts separated by a komma: {Re, Im}. Polar complex numbers are also written in braces, with the Mag and Arg parts separated by an at-sign: {Mag @ Arg}.
The display pauses every screenful. The user is prompted after each page to continue or to stop printing.
The number of digits per element is determined by the available space, which depends in turn on the line width and on the parameter nperline.

This family of functions is available only for console applications.
 

CUDA versions only:cudaV?_chexprint_buf takes a host vector h_Wk as additional argument. The latter serves as buffer memory and needs to be (at least) of the same size as X. By avoiding the need of cudaV?_chexprint to allocate its own buffer memory, cudaV?_chexprint_buf is slightly faster.
 
Other Windows compilers as well as Linux: As here the width and height of the text window are not easily available, calls to V?_chexprint are redirected to V?_hexprint.
 
 
GCC Windows specific:While VE_cprint, VCE_cprint, VPE_cprint truncate the long double input numbers to double precision and range, VE_chexprint, VCE_chexprint, and VPE_chexprint work in full 80-bit accuracy.
Error handlingIf nperline exceeds the maximum number of entries possible in the current text mode, an error message "Cannot use requested format (too many entries per line)!" is generated; in this case, the program chooses the maximum possible number nperline.
Return valuenone
See alsoVF_cprint,   VF_hexprint,   VF_write,   VF_store,   cprintf

 

VF_chiabsVD_chiabsVE_chiabs
VF_chiabswSaturationVD_chiabswSaturationVE_chiabswSaturation
FunctionAbsolute-value analogue of the chi-square merit function.
Syntax C/C++#include <VFstd.h>
float VF_chiabs( fVector X, fVector Y, fVector Wt, ui size );
float VF_chiabswSaturation( fVector X, fVector Y, fVector Wt, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::chiabs( const vector<T>& Y, const vector<T>& Wt )
T vector<T>::chiabswSaturation( const vector<T>& Y, const vector<T>& Wt );
Pascal/Delphiuses VFstd;
function VF_chiabs( X, Y, Wt:fVector; size:UIntSize ): Single;
function VF_chiabswSaturation( X, Y, Wt:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_chiabs( float *h_RetVal, fVector d_X, fVector d_Y, fVector d_Wt, ui size );
int cusdVF_chiabs( float *d_RetVal, fVector d_X, fVector d_Y, fVector d_Wt, ui size );
float VFcu_chiabs( fVector h_X, fVector h_Y, fVector h_Wt, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_chiabs( var h_RetVal:Single; d_X, d_Y, d_Wt:fVector; size:UIntSize ): IntBool;
function cusdVF_chiabs( d_RetVal:PSingle; d_X, d_Y, d_Wt:fVector; size:UIntSize ): IntBool;
function VFcu_chiabs( h_X, h_Y, h_Wt:fVector; size:UIntSize ): Single;
Descriptionchiabs = sum( Wti * |Xi - Yi| ).
The chiabs function is a "robust" replacement for the c2 (chi-square) merit function. It is used to judge the quality of a fit in the presence of outlier points. The chiabs function is disturbed by outlier points to a lesser degree than the chi-square function.

V?_chiabswSaturation is almost identical to V?_chiabs, except for the treatment of infinities and NAN values. While V?_chiabs may overflow to INF and will return NAN, if any input element is a NAN, V?_chiabswSaturation will saturate possible overflow into HUGE_VAL and treats input values of ±NAN as ±HUGE_VAL. Thereby, it becomes most suitable for use inside the nonlinear fitting routines. If the fitting routine needs the figure-of-merit for a parameter set, any bad parameter set should give the feedback that the guess was far off; you do not want to raise an exception or crash the programme here.

Error handlingnone
Return valuechiabs merit function.
See alsoVF_chi2

 

VF_chi2VD_chi2VE_chi2
VF_chi2wSaturationVD_chi2wSaturationVE_chi2wSaturation
FunctionChi-square merit function.
Syntax C/C++#include <VFstd.h>
float VF_chi2( fVector X, fVector Y, fVector InvVar, ui size );
float VF_chi2wSaturation( fVector X, fVector Y, fVector InvVar, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::chi2( const vector<T>& Y, const vector<T>& InvVar );
T vector<T>::chi2wSaturation( const vector<T>& Y, const vector<T>& InvVar );
Pascal/Delphiuses VFstd;
function VF_chi2( X, Y, InvVar:fVector; size:UIntSize ): Single;
function VF_chi2wSaturation( X, Y, InvVar:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_chi2( float *h_RetVal, fVector d_X, fVector d_Y, fVector d_InvVar, ui size );
int cusdVF_chi2( float *d_RetVal, fVector d_X, fVector d_Y, fVector d_InvVar, ui size );
float VFcu_chi2( fVector h_X, fVector h_Y, fVector h_InvVar, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_chi2( var h_RetVal:Single; d_X, d_Y, d_InvVar:fVector; size:UIntSize ): IntBool;
function cusdVF_chi2( d_RetVal:PSingle; d_X, d_Y, d_InvVar:fVector; size:UIntSize ): IntBool;
function VFcu_chi2( h_X, h_Y, h_InvVar:fVector; size:UIntSize ): Single;
Descriptionc2 = sum( 1/si2 * (Xi - Yi)2 ).
The c2 (chi-square) merit function is most often used to judge the quality of a fit. One vector (either X or Y) represents experimental values that are obtained with individual standard deviations sigmai, the other contains the values predicted on the basis of a theory or a model. If the experimental data are "normally" distributed, and if s (sigma) is the correct measure for the quality of these data, then c2 is a measure for the quality of the fit. Rather than the standard deviations themselves, the routine needs the inverse of their squares (i.e., the inverse of the variances) to be passed as the vector InvVar.

V?_chi2wSaturation is almost identical to V?_chi2, except for the treatment of infinities and NAN values. While V?_chi2 may overflow to INF and will return NAN, if any input element is a NAN, V?_chi2wSaturation will saturate possible overflow into HUGE_VAL and treats input values of ±NAN as ±HUGE_VAL. Thereby, it becomes most suitable for use inside the nonlinear fitting routines. If the fitting routine needs the figure-of-merit for a parameter set, any bad parameter set should give the feedback that the guess was far off; you do not want to raise an exception or crash the programme here.

Error handlingnone
Return valuechi2 merit function.
See alsoVF_meanwW,   VF_varianceVwW,   VF_varianceV,   VF_varianceCwW,   VF_chiabs,   VF_square,   VF_inv,   VF_linregress

 

VF_chopVD_chopVE_chop
VF_choptoIVD_choptoIVE_choptoI
VF_choptoBIVD_choptoBIVE_choptoBI
VF_choptoSIVD_choptoSIVE_choptoSI
VF_choptoLIVD_choptoLIVE_choptoLI
VF_choptoQIVD_choptoQIVE_choptoQI
VF_choptoUVD_choptoUVE_choptoU
VF_choptoUBVD_choptoUBVE_choptoUB
VF_choptoUSVD_choptoUSVE_choptoUS
VF_choptoULVD_choptoULVE_choptoUL
VF_choptoUQVD_choptoUQVE_choptoUQ
VF_choptoUIVD_choptoUIVE_choptoUI
Function"Chopping" towards zero.
Syntax C/C++#include <VFmath.h>
int VF_chop( fVector Y, fVector X, ui size );
int VF_choptoI( iVector Y, fVector X, ui size );
int VF_choptoLI( liVector Y, fVector X, ui size );

    (similarly all other functions of this family)
C++ VecObj#include <OptiVec.h>
int vector<T>::chop( const vector<T>& X );
int vector<int>::choptoI( const vector<T>& X );
int vector<long>::choptoLI( const vector<T>& X );
Pascal/Delphiuses VFmath;
function VF_chop( Y, X:fVector; size:UIntSize ): IntBool;
function VF_choptoI( Y:iVector; X:fVector; size:UIntSize ): IntBool;
function VF_choptoLI( Y:liVector; X:fVector; size:UIntSize ): IntBool;

    (similarly all other functions of this family)
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_chop( fVector d_Y, fVector d_X, ui size );
int cudaVF_choptoI( iVector d_Y, fVector d_X, ui size );
int VFcu_chop( fVector h_Y, fVector h_X, ui size );
int VFcu_choptoI( iVector h_Y, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_chop( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVF_choptoI( d_Y:iVector; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_chop( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFcu_choptoI( h_Y:iVector; h_X:fVector; size:UIntSize ): IntBool;
DescriptionEach element of X is rounded to an integer number by "chopping off" the fractional part. For example, -3.9 yields -3, and +3.9 yields +3. The result is stored in Y. The functions VF_choptoI,   VF_choptoLI, etc. convert the result into the various integer data types.
Error handlingOVERFLOW errors are handled by setting the result to the extreme value possible. Negative numbers in the versions VF_choptoU,   VF_choptoUS,   VF_choptoUL, and VF_choptoUI lead to DOMAIN errors; they are handled by setting the result to 0.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_round,   VF_floor,   VF_ceil,   ceil,   floor (C/C++ only)

 

V_closeErrorEventFile
FunctionRestore default printing of error messages into stderr.
Syntax C/C++#include <VecLib.h>
void V_closeErrorEventFile( void );
Pascal/Delphiuses VecLib;
procedure V_closeErrorEventFile;
DescriptionAfter error messages have been redirected into an event file by V_setErrorEventFile, the event file is closed by V_closeErrorEventFile and any further messages will be handled according to the parameter ScreenAndFile with which the event file was created (0: no message at all; 1: message box; 2: for console programmes, output into stderr which normally is the screen, see chapter 5.5).

Certain configurations of the compilers supported by OptiVec do not allow the full set of options described above. For some, either output into a message box is missing or output to the console screen. In these cases, an error message is displayed and the output redirected to the available other option.

Error handlingnone
Return valuenone
See alsoV_noteError,   V_setErrorEventFile,   _matherr (C/C++ only)

 

V_closeMT
FunctionClose down the worker threads of the multi-processor optimized library
Syntax C/C++#include <VecLib.h>
int V_closeMT( void );
Pascal/Delphiuses VecLib;
function V_closeMT: IntBool;
DescriptionThis function terminates the worker threads initialized by V_initMT. The call to V_closeMT should be at the end of any programme using the multi-processor libraries of OptiVec. No call to a vector or matrix function fo OptiVec is allowed to follow the closing-down of the worker threads.
To facilitate testing of the various OptiVeclibrary versions, V_closeMT is present as an empty function also in the (non-threaded) general-purpose libraries. Calling it just does not have any effect then.
Return valueFALSE (0), if the threads could be shut down error-free, otherwise TRUE (non-zero).
See alsoV_initMT, chap. 1.1.2.

 

VF_cmp0VD_cmp0VE_cmp0
VI_cmp0VBI_cmp0VSI_cmp0VLI_cmp0VQI_cmp0
FunctionCompares each element of a vector with 0 (signum function).
Syntax C/C++#include <VFmath.h>
void VF_cmp0( fVector Y, fVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::cmp0( const vector<T>& X );
Pascal/Delphiuses VFstd;
procedure VF_cmp0( Y,X:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_cmp0( fVector d_Y, fVector d_X, ui size );
void VFcu_cmp0( fVector h_Y, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_cmp0( d_Y, d_X:fVector; size:UIntSize ): IntBool;
procedure VFcu_cmp0( h_Y, h_X:fVector; size:UIntSize );
DescriptionEach element of X is compared with 0 and the result of the comparison stored in Y:
Yi = +1.0, if Xi > 0
Yi =   0.0, if Xi = 0
Yi =  −1.0, if Xi < 0.
This function may also be called under its synonym VF_sgn.
Error handlingnone
Return valuenone
See alsoVF_cmp_...,   VF_cmpC,   VF_cmpV

 

VF_cmpCVD_cmpCVE_cmpC
VI_cmpCVBI_cmpCVSI_cmpCVLI_cmpCVQI_cmpC 
VU_cmpCVUB_cmpCVUS_cmpCVUL_cmpCVUQ_cmpCVUI_cmpC
FunctionCompares each element of a vector with a constant.
Syntax C/C++#include <VFmath.h>
void VF_cmpC( fVector Y, fVector X, ui size, float C );
void VI_cmpC( iVector Y, iVector X, ui size, int C );
void VU_cmpC( iVector Y, uVector X, ui size, unsigned C );
C++ VecObj#include <OptiVec.h>
void vector<T>::cmpC( const vector<T>& X, const T& C );

unsigned integer types: function belongs to corresponding signed integer class:
void vector<T>::cmpC( const vector<unsigned T>& X, const unsigned T& C );
Pascal/Delphiuses VFstd;
procedure VF_cmpC( Y,X:fVector; size:UIntSize; C:Single );
procedure VI_cmpC( Y,X:iVector; size:UIntSize; C:Integer );
procedure VU_cmpC( Y:iVector; X:uVector; size:UIntSize; C:UInt );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_cmpC( fVector d_Y, fVector d_X, ui size, float C );
int cusdVF_cmpC( fVector d_Y, fVector d_X, ui size, float *d_C );
void VFcu_cmpC( fVector h_Y, fVector h_X, ui size, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_cmpC( d_Y, d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_cmpC( d_Y, d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
procedure VFcu_cmpC( h_Y, h_X:fVector; size:UIntSize; C:Single );
DescriptionEach element of X is compared with C and the result of the comparison stored in Y:
Yi = +1.0, if Xi > C
Yi =   0.0, if Xi = C
Yi =  −1.0, if Xi < C
For unsigned integer input vectors, the output is of the corresponding signed data type.
To compare with C=0, use more efficiently the function VF_cmp0.
Error handlingnone
Return valuenone
See alsoVF_cmp_...,  VF_cmp0,   VF_cmpV,   VF_iselementC

 

VF_cmpVVD_cmpVVE_cmpV
VI_cmpVVBI_cmpVVSI_cmpVVLI_cmpVVQI_cmpV 
VU_cmpVVUB_cmpVVUS_cmpVVUL_cmpVVUQ_cmpVVUI_cmpV
FunctionCompares each element of a vector with the corresponding element of another vector.
Syntax C/C++#include <VFmath.h>
void VF_cmpV( fVector Z, fVector X, fVector Y, ui size );
void VI_cmpV( iVector Z, iVector X, iVector Y, ui size );
void VU_cmpV( iVector Z, uVector X, uVector Y, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::cmpV( const vector<T>& X, const vector<T>& Y );

unsigned integer types: function belongs to corresponding signed integer class:
void vector<T>::cmpV( const vector<unsigned T>& X, const vector<unsigned T>& Y );
Pascal/Delphiuses VFstd;
procedure VF_cmpV( Z, X, Y:fVector; size:UIntSize );
procedure VI_cmpV( Z, X, Y:iVector; size:UIntSize );
procedure VU_cmpV( Z:uVector; X, Y:iVector; size:UIntSize );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_cmpV( fVector d_Z, fVector d_X, fVector d_Y, ui size );
void VFcu_cmpV( fVector h_Z, fVector h_X, fVector h_Y, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_cmpV( d_Z, d_X, d_Y:fVector; size:UIntSize ): IntBool;
procedure VFcu_cmpV( h_Z, h_X, h_Y:fVector; size:UIntSize );
DescriptionEach element of X is compared with the corresponding element of Y and the result of the comparison stored in Z:
Zi = +1.0, if Xi > Yi
Zi =   0.0, if Xi = Yi
Zi =  −1.0, if Xi < Yi.
For unsigned integer input vectors, the output is of the corresponding signed data type.
Error handlingnone
Return valuenone
See alsoVF_cmp_...,  VF_cmp0,   VF_cmpC

 

VF_cmp_...VD_cmp_...VE_cmp_...
VI_cmp_...VBI_cmp_...VSI_cmp_...VLI_cmp_...VQI_cmp_... 
VU_cmp_...VUB_cmp_...VUS_cmp_...VUL_cmp_...VUQ_cmp_...VUI_cmp_...
      ...eq0      ...ne0      ...gt0      ...ge0      ...le0      ...lt0
      ...eqC      ...neC      ...gtC      ...geC      ...leC      ...ltC
      ...eqV      ...neV      ...gtV      ...geV      ...leV      ...ltV      ...stV      ...dtV
      ...eq0ind      ...ne0ind      ...gt0ind      ...ge0ind      ...le0ind      ...lt0ind
      ...eqCind      ...neCind      ...gtCind      ...geCind      ...leCind      ...ltCind
      ...eqVind      ...neVind      ...gtVind      ...geVind      ...leVind      ...ltVind      ...stVind      ...dtVind
        ...inclrange0C        ...exclrange0C
        ...inclrangeCC        ...exclrangeCC
        ...inclrange0Cind        ...exclrange0Cind
        ...inclrangeCCind        ...exclrangeCCind
VCF_cmp_...VCD_cmp_...VCE_cmp_...
VPF_cmp_...VPD_cmp_...VPE_cmp_...
      ...eq0      ...ne0
      ...eqC      ...neC
      ...eqV      ...neV      ...stV      ...dtV
      ...eq0ind      ...ne0ind
      ...eqCind      ...neCind
      ...eqVind      ...neVind      ...stVind      ...dtVind
      ...eq0      ...ne0      ...gt0      ...ge0      ...le0      ...lt0
      ...eqC      ...neC      ...gtC      ...geC      ...leC      ...ltC
      ...eqV      ...neV      ...gtV      ...geV      ...leV      ...ltV      ...stV      ...dtV
      ...eq0ind      ...ne0ind      ...gt0ind      ...ge0ind      ...le0ind      ...lt0ind
      ...eqCind      ...neCind      ...gtCind      ...geCind      ...leCind      ...ltCind
      ...eqVind      ...neVind      ...gtVind      ...geVind      ...leVind      ...ltVind      ...stVind      ...dtVind
        ...inclrange0C        ...exclrange0C
        ...inclrangeCC        ...exclrangeCC
        ...inclrange0Cind        ...exclrange0Cind
        ...inclrangeCCind        ...exclrangeCCind
VCF_cmp_...VCD_cmp_...VCE_cmp_...
VPF_cmp_...VPD_cmp_...VPE_cmp_...
      ...eq0      ...ne0
      ...eqC      ...neC
      ...eqV      ...neV      ...stV      ...dtV
      ...eq0ind      ...ne0ind
      ...eqCind      ...neCind
      ...eqVind      ...neVind      ...stVind      ...dtVind
FunctionComparisons
Syntax C/C++#include <VFmath.h>
ui VF_cmp_eq0( fVector Y, fVector X, ui size );
ui VF_cmp_ne0( fVector Y, fVector X, ui size );
ui VF_cmp_gt0( fVector Y, fVector X, ui size );
ui VF_cmp_ge0( fVector Y, fVector X, ui size );
ui VF_cmp_lt0( fVector Y, fVector X , ui size );
ui VF_cmp_le0( fVector Y, fVector X, ui size );

ui VF_cmp_eqC( fVector Y, fVector X, ui size, float C );
    (similarly: ..._neC, ..._gtC, ..._geC, ..._ltC, ..._leC)

ui VF_cmp_eqV( fVector Z, fVector X, fVector Y, ui size);
    (similarly: ..._neV, ..._gtV, ..._geV, ..._ltV, ..._leV)
ui VF_cmp_stV( fVector Z, fVector X, fVector Y, ui size, float TolRel, float TolAbs );
ui VF_cmp_dtV( fVector Z, fVector X, fVector Y, ui size, float TolRel, float TolAbs );

ui VF_cmp_eq0ind( uiVector Ind, fVector X, ui size );
    (similarly: ..._ne0ind, ..._gt0ind, ..._ge0ind, ..._lt0ind, ..._le0ind)
ui VF_cmp_eqCind( uiVector Ind, fVector X, ui size, float C );
    (similarly: ..._neCind, ..._gtCind, ..._geCind, ..._ltCind, ..._leCind)
ui VF_cmp_eqVind( uiVector Ind, fVector X, fVector Y, ui size );
    (similarly: ..._neVind, ..._gtVind, ..._geVind, ..._ltVind, ..._leVind)
ui VF_cmp_stVind( uiVector Ind, fVector X, fVector Y, ui size, float TolRel, float TolAbs );
ui VF_cmp_dtVind( uiVector Ind, fVector X, fVector Y, ui size, float TolRel, float TolAbs );
    (similarly VD_ and VE_ versions)

ui VF_cmp_inclrange0C( fVector Y, fVector X, ui size, float C );
ui VF_cmp_exclrange0C( fVector Y, fVector X, ui size, float C );
ui VF_cmp_inclrangeCC( fVector Y, fVector X, ui size, float CLo, float CHi );
ui VF_cmp_exclrangeCC( fVector Y, fVector X, ui size, float CLo, float CHi );

    (similarly VD_ and VE_ versions)

ui VF_cmp_inclrange0Cind( uiVector Ind, fVector X, ui size, float C );
ui VF_cmp_exclrange0Cind( uiVector Ind, fVector X, ui size, float C );
ui VF_cmp_inclrangeCCind( uiVector Ind, fVector X, ui size, float CLo, float CHi );
ui VF_cmp_exclrangeCCind( uiVector Ind, fVector X, ui size, float CLo, float CHi );

    (similarly VD_ and VE_ versions)

ui VCF_cmp_eq0( cfVector Y, cfVector X, ui size );
ui VCF_cmp_ne0( cfVector Y, cfVector X, ui size );
ui VCF_cmp_eqC( cfVector Y, cfVector X, ui size, fComplex C );
ui VCF_cmp_neC( cfVector Y, cfVector X, ui size, fComplex C );
ui VCF_cmp_eqV( cfVector Z, cfVector X, cfVector Y, ui size );
ui VCF_cmp_neV( cfVector Z, cfVector X, cfVector Y, ui size );
ui VCF_cmp_stV( cfVector Z, cfVector X, cfVector Y, ui size, fComplex TolRel, fComplex TolAbs );
ui VCF_cmp_dtV( cfVector Z, cfVector X, cfVector Y, ui size, fComplex TolRel, fComplex TolAbs );

ui VCF_cmp_eq0ind( uiVector Ind, cfVector X, ui size );
ui VCF_cmp_ne0ind( uiVector Ind, cfVector X, ui size );
ui VCF_cmp_eqCind( uiVector Ind, cfVector X, ui size, fComplex C );
ui VCF_cmp_neCind( uiVector Ind, cfVector X, ui size, fComplex C );
ui VCF_cmp_eqVind( uiVector Ind, cfVector X, cfVector Y, ui size );
ui VCF_cmp_neVind( uiVector Ind, cfVector X, cfVector Y, ui size );
ui VCF_cmp_stVind( uiVector Ind, cfVector X, cfVector Y, ui size, fComplex TolRel, fComplex TolAbs );
ui VCF_cmp_dtVind( uiVector Ind, cfVector X, cfVector Y, ui size, fComplex TolRel, fComplex TolAbs );

    (similarly VPF_, VPD_, VPE_, VCD_, and VCE_ versions)

C++ VecObj#include <OptiVec.h>
ui vector<T>::cmp_eq0( const vector<T>& X );
ui vector<T>::cmp_ne0( const vector<T>& X );
ui vector<T>::cmp_gt0( const vector<T>& X );
ui vector<T>::cmp_ge0( const vector<T>& X );
ui vector<T>::cmp_lt0( const vector<T>& X );
ui vector<T>::cmp_le0( const vector<T>& X );
ui vector<T>::cmp_eqC( const vector<T>& X, const T& C );
ui vector<T>::cmp_eqV( const vector<T>& X, const vector<T>& Y );
ui vector<T>::cmp_stV( const vector<T>& X, const vector<T>& Y, const T& TolRel, const T& TolAbs );
ui vector<ui>::cmp_eq0ind( const vector<ui>& Ind, const vector<T>& X );
ui vector<ui>::cmp_eqCind( const vector<ui>& Ind, const vector<T>& X );
ui vector<ui>::cmp_eqVind( const vector<ui>& Ind, const vector<T>& X );
ui vector<ui>::cmp_stVind( const vector<ui>& Ind, const vector<T>& X, const T& TolRel, const T& TolAbs );
ui vector<T>::cmp_inclrange0C( const vector<T>& X, const T& C );
ui vector<T>::cmp_exclrange0C( const vector<T>& X, const T& C );
ui vector<T>::cmp_inclrangeCC( const vector<T>& X, const T& CLo, const T& CHi );
ui vector<T>::cmp_exclrangeCC( const vector<T>& X, const T& CLo, const T& CHi );
ui vector<ui>::cmp_inclrange0Cind( const vector<ui>& Ind, const vector<T>& X, const T& C );
ui vector<ui>::cmp_exclrange0Cind( const vector<ui>& Ind, const vector<T>& X, const T& C );
ui vector<ui>::cmp_inclrangeCCind( const vector<ui>& Ind, const vector<T>& X, const T& CLo, const T& CHi );
ui vector<ui>::cmp_exclrangeCCind( const vector<ui>& Ind, const vector<T>& X, const T& CLo, const T& CHi );
ui vector<complex<T>>::cmp_eq0( const vector<complex<T>>& X );
ui vector<complex<T>>::cmp_ne0( const vector<complex<T>>& X );
ui vector<complex<T>>::cmp_eqC( const vector<complex<T>>& X, complex<T> C );
ui vector<complex<T>>::cmp_neC( const vector<complex<T>>& X, complex<T> C );
ui vector<complex<T>>::cmp_eqV( const vector<complex<T>>& X, const vector<complex<T>>& Y );
ui vector<complex<T>>::cmp_neV( const vector<complex<T>>& X, const vector<complex<T>>& Y );
ui vector<complex<T>>::cmp_stV( const vector<complex<T>>& X, const vector<complex<T>>& Y, complex<T>TolRel, complex<T>TolAbs );
ui vector<ui>::cmp_eq0ind( const vector<ui>& Ind, const vector<complex<T>>& X );
ui vector<ui>::cmp_ne0ind( const vector<ui>& Ind, const vector<complex<T>>& X );
ui vector<ui>::cmp_eqCind( const vector<ui>& Ind, const vector<complex<T>>& X );
ui vector<ui>::cmp_neCind( const vector<ui>& Ind, const vector<complex<T>>& X );
ui vector<ui>::cmp_eqVind( const vector<ui>& Ind, const vector<complex<T>>& X );
ui vector<ui>::cmp_neVind( const vector<ui>& Ind, const vector<complex<T>>& X );
ui vector<ui>::cmp_stVind( const vector<ui>& Ind, const vector<complex<T>>& X, complex<T>TolRel, complex<T>TolAbs );
Pascal/Delphiuses VFstd;
function VF_cmp_eq0( Y,X:fVector; size:UIntSize ):UIntSize;
function VF_cmp_ne0( Y,X:fVector; size:UIntSize ):UIntSize;
function VF_cmp_gt0( Y,X:fVector; size:UIntSize ):UIntSize;
function VF_cmp_ge0( Y,X:fVector; size:UIntSize ):UIntSize;
function VF_cmp_lt0( Y,X:fVector; size:UIntSize ):UIntSize;
function VF_cmp_le0( Y,X:fVector; size:UIntSize ):UIntSize;

function VF_cmp_eqC( Y,X:fVector; size:UIntSize; C:Single ):UIntSize;
    (similarly: ..._neC, ..._gtC, ..._geC, ..._ltC, ..._leC)
function VF_cmp_eqV( Z, X, Y:fVector; size:UIntSize ):UIntSize;
    (similarly: ..._neV, ..._gtV, ..._geV, ..._ltV, ..._leV)
function VF_cmp_stV( Z, X, Y:fVector; size:UIntSize; TolRel, TolAbs:Single ):UIntSize;
function VF_cmp_dtV( Z, X, Y:fVector; size:UIntSize; TolRel, TolAbs:Single ):UIntSize;

function VF_cmp_eq0ind( Ind:uVector; X:fVector; size:UIntSize ):UIntSize;
    (similarly: ..._ne0ind, ..._gt0ind, ..._ge0ind, ..._lt0ind, ..._le0ind)
function VF_cmp_eqCind( Ind:uVector; X:fVector; size:UIntSize; C:Single ):UIntSize;
    (similarly: ..._neCind, ..._gtCind, ..._geCind, ..._ltCind, ..._leCind)
function VF_cmp_eqVind( Ind:uVector; X, Y:fVector; size:UIntSize ):UIntSize;
    (similarly: ..._neVind, ..._gtVind, ..._geVind, ..._ltVind, ..._leVind)
function VF_cmp_stVind( Ind:uVector; X, Y:fVector; size:UIntSize; TolRel, TolAbs:Single ):UIntSize;
function VF_cmp_dtVind( Ind:uVector; X, Y:fVector; size:UIntSize; TolRel, TolAbs:Single ):UIntSize;

    (similarly VD_, VE_, VI_, and so on)

function VF_cmp_inclrange0C( Y, X:fVector; size:UIntSize; C:Single ): UIntSize;
function VF_cmp_exclrange0C( Y, X:fVector; size:UIntSize; C:Single ): UIntSize;
function VF_cmp_inclrangeCC( Y, X:fVector; size:UIntSize; CLo, CHi:Single ): UIntSize;
function VF_cmp_exclrangeCC( Y, X:fVector; size:UIntSize; CLo, CHi:Single ): UIntSize;

    (similarly VD_, VE_, VI_, and so on)

function VF_cmp_inclrange0Cind( Ind:uVector; X:fVector; size:UIntSize; C:Single ): UIntSize;
function VF_cmp_exclrange0Cind( Ind:uVector; X:fVector; size:UIntSize; C:Single ): UIntSize;
function VF_cmp_inclrangeCCind( Ind:uVector; X:fVector; size:UIntSize; CLo, CHi:Single ): UIntSize;
function VF_cmp_exclrangeCCind( Ind:uVector; X:fVector; size:UIntSize; CLo, CHi:Single ): UIntSize;

    (similarly VD_, VE_, VI_, and so on)

function VCF_cmp_eq0( Y, X:cfVector; size:UIntSize ):UIntSize;
function VCF_cmp_ne0( Y, X:cfVector; size:UIntSize ):UIntSize;
function VCF_cmp_eqC( Y, X:cfVector; size:UIntSize; C:fComplex ):UIntSize;
function VCF_cmp_neC( Y, X:cfVector; size:UIntSize; C:fComplex ):UIntSize;
function VCF_cmp_eqV( Z, X, Y:cfVector; size:UIntSize ):UIntSize;
function VCF_cmp_neV( Z, X, Y:cfVector; size:UIntSize ):UIntSize;
function VCF_cmp_stV( Z, X, Y:cfVector; size:UIntSize; TolRel, TolAbs:fComplex ):UIntSize;
function VCF_cmp_dtV( Z, X, Y:cfVector; size:UIntSize; TolRel, TolAbs:fComplex ):UIntSize;

function VCF_cmp_eq0ind( Ind:uVector; X:cfVector; size:UIntSize ):UIntSize;
function VCF_cmp_ne0ind( Ind:uVector; X:cfVector; size:UIntSize ):UIntSize;
function VCF_cmp_eqCind( Ind:uVector; X:cfVector; size:UIntSize; C:fComplex ):UIntSize;
function VCF_cmp_neCind( Ind:uVector; X:cfVector; size:UIntSize; C:fComplex ):UIntSize;
function VCF_cmp_eqVind( Ind:uVector; X, Y:cfVector; size:UIntSize ):UIntSize;
function VCF_cmp_neVind( Ind:uVector; X, Y:cfVector; size:UIntSize ):UIntSize;
function VCF_cmp_stVind( Ind:uVector; X, Y:cfVector; size:UIntSize; TolRel, TolAbs:fComplex ):UIntSize;
function VCF_cmp_dtVind( Ind:uVector; X, Y:cfVector; size:UIntSize; TolRel, TolAbs:fComplex ):UIntSize;

    (similarly VPF_, VPD_, VPE_, VCD_, and VCE_ versions)

CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_cmp_eq0( ui *h_nTrue, fVector d_Y, fVector d_X, ui size );
ui VFcu_cmp_eq0( fVector h_Y, fVector h_X, ui size );

    (similarly .._ne0, .._gt0, .._ge0, .._le0, .._lt0)

int cudaVF_cmp_eqC( ui *h_nTrue, fVector d_Y, fVector d_X, ui size, float C );
int cusdVF_cmp_eqC( ui *h_nTrue, fVector d_Y, fVector d_X, ui size, float *d_C );
ui VFcu_cmp_eqC( fVector h_Y, fVector h_X, ui size, float C );

    (similarly: ..._neC, ..._gtC, ..._geC, ..._ltC, ..._leC)

int cudaVF_cmp_eqV( ui *h_nTrue, fVector d_Z, fVector d_X, fVector d_Y, ui size);
ui VFcu_cmp_eqV( fVector h_Z, fVector h_X, fVector h_Y, ui size);

    (similarly: ..._neV, ..._gtV, ..._geV, ..._ltV, ..._leV)

int cudaVF_cmp_stV( ui *h_nTrue, fVector d_Z, fVector d_X, fVector d_Y, ui size, float TolRel, float TolAbs);
int cusdVF_cmp_stV( ui *h_nTrue, fVector d_Z, fVector d_X, fVector d_Y, ui size, float *d_TolRel, float *d_TolAbs);
ui VFcu_cmp_stV( fVector h_Z, fVector h_X, fVector h_Y, ui size, float TolRel, float TolAbs);

    (similarly: ..._dtV)

int cudaVF_cmp_inclrange0C( ui *h_nTrue, fVector d_Y, fVector d_X, ui size, float C );
int cusdVF_cmp_inclrange0C( ui *h_nTrue, fVector d_Y, fVector d_X, ui size, float *d_C );
int cudaVF_cmp_inclrangeCC( ui *h_nTrue, fVector d_Y, fVector d_X, ui size, float CLo, float CHi );
int cusdVF_cmp_inclrangeCC( ui *h_nTrue, fVector d_Y, fVector d_X, ui size, float *d_CLo, float *d_CHi );
ui VFcu_cmp_inclrange0C( fVector h_Y, fVector h_X, ui size, float C );
ui VFcu_cmp_inclrangeCC( fVector h_Y, fVector h_X, ui size, float CLo, float CHi );

    (similarly: ..._exclrange0C and ..._exclrangeCC)
    (no cudaV?_cmp_???ind or V?cu_cmp_???ind functions!)

CUDA function Pascal/Delphiuses VFmath;
function cudaVF_cmp_eq0( var h_nTrue:UIntSize; d_Y, d_X:fVector; size:UIntSize ): IntBool;
function VFcu_cmp_eq0( h_Y, h_X:fVector; size:UIntSize ): UIntSize;

    (similarly .._ne0, .._gt0, .._ge0, .._le0, .._lt0)

function cudaVF_cmp_eqC( var h_nTrue:UIntSize; d_Y, d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_cmp_eqC( var h_nTrue:UIntSize; d_Y, d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
function VFcu_cmp_eqC( h_Y, h_X:fVector; size:UIntSize; C:Single ): UIntSize;

    (similarly: ..._neC, ..._gtC, ..._geC, ..._ltC, ..._leC)

function cudaVF_cmp_eqV( var h_nTrue:UIntSize; d_Z, d_X, d_Y:fVector; size:UIntSize ): IntBool;
function VFcu_cmp_eqV( h_Z, h_X, h_Y:fVector; size:UIntSize ): UIntSize;

    (similarly: ..._neV, ..._gtV, ..._geV, ..._ltV, ..._leV)

function cudaVF_cmp_stV( var h_nTrue:UIntSize; d_Z, d_X, d_Y:fVector; size:UIntSize; TolRel, TolAbs:Single ): IntBool;
function cusdVF_cmp_stV( var h_nTrue:UIntSize; d_Z, d_X, d_Y:fVector; size:UIntSize; d_TolRel, d_TolAbs:PSingle ): IntBool;
function VFcu_cmp_stV( h_Z, h_X, h_Y:fVector; size:UIntSize; TolRel, TolAbs:Single ): UIntSize;

    (similarly: ..._dtV)

function cudaVF_cmp_inclrange0C( var h_nTrue:UIntSize; d_Y, d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_cmp_inclrange0C( var h_nTrue:UIntSize; d_Y, d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
function cudaVF_cmp_inclrangeCC( var h_nTrue:UIntSize; d_Y, d_X:fVector; size:UIntSize; CLo, CHi:Single ): IntBool;
function cusdVF_cmp_inclrangeCC( var h_nTrue:UIntSize; d_Y, d_X:fVector; size:UIntSize; d_CLo, d_CHi:PSingle ): IntBool;
function VFcu_cmp_inclrange0C( h_Y, h_X:fVector; size:UIntSize; C:Single ): UIntSize;
function VFcu_cmp_inclrangeCC( h_Y, h_X:fVector; size:UIntSize; CLo, CHi:Single ): UIntSize;

    (similarly: ..._exclrange0C and ..._exclrangeCC)
    (no cudaV?_cmp_???ind or V?cu_cmp_???ind functions!)

Descriptiona) Simple comparisons:
Each element of X is compared with either 0, or a constant C, or the corresponding element of another vector, Y. The conditions to be tested are denoted by two letters as in ASSEMBLER or FORTRAN:
 
"eq" ("equal")True, if Xi = 0 (C, Yi, resp.)
"ne" ("not equal")True, if Xi ≠ 0 (C, Yi, resp.)
"gt" ("gteater than")True, if Xi > 0 (C, Yi, resp.)
"ge" ("greater or equal")   True, if Xi ≥ 0 (C, Yi, resp.)
"lt" ("less than")True, if Xi < 0 (C, Yi, resp.)
"le" ("less or equal")True, if Xi ≤ 0 (C, Yi, resp.)
"st" ("similar to")True, if Xi ≈ Yi,   i.e. | Xi − Yi | ≤ max( |Yi| * TolRel, TolAbs)
"dt" ("dissimilar to")True, if Xi ≉ Yi,   i.e. | Xi − Yi | > max( |Yi| * TolRel, TolAbs)

For complex numbers, only the tests for equality ("eq"), inequality ("ne"), similarity ("st") and dissimilarity ("dt") make sense and are available. In the tests for similarity ("st") and dissimilarity ("dt") of complex numbers, the parameters TolRel and TolAbs are complex as well, allowing to specify different tolerances for the real and imaginary parts.
For the unsigned integer data types, those functions checking for Xi < 0 or Xi ≤ 0 do not exist, as no unsigned number can possibly be below 0. Likewise, there are no "VU_cmp_ge0" functions, as the condition Xi ≥ 0 is trivially fulfilled for any possible input value.

b) Range-checking functions
Each element of X is checked if it falls into a range which is specified either by 0 and a (positive or negative) constant C, or by two constants, CLo and CHi. One has the choice between two versions, treating the range either as inclusive or as exclusive of the end points:
VF_cmp_inclrange0C checks for 0 ≤ x ≤ C (positive C) or 0 ≥ x ≥ C (negative C), whereas VF_cmp_exclrangeCC checks for CLo < x < CHi.
For the unsigned integer types, there are no functions "VU_cmp_inclrange0C", as the condition Xi ≥ 0 is trivially fulfilled for any possible input number.

a) and b):
There are two different ways how the result of the comparison is treated. The result for each element of X is either stored as 1.0 for TRUE and 0.0 for FALSE in a vector of a floating-point data type (with the imaginary part in the complex versions always set to 0), or the indices of the elements for which the result is TRUE are stored in an index vector; the latter is the case in the functions with the suffix "ind" as the last part of their names, like in VF_cmp_neCind. In any case, the number of TRUE results encountered is returned by the function. The index-finding variant is especially useful to extract the elements for which the condition is TRUE into a sub-vector by VF_indpick; be sure to check that the return value nTrue is non-zero if you wish to do that (remember that the parameter size for any of the functions of the OptiVec libraries must be non-zero!).
Even if you happen to know that the number of TRUE results is small, the allocated size of the Ind vector must still be the full size of X, as the routine might use parts of Ind for intermediate storage.

Error handlingnone
Return valuenumber of elements for which the condition was found to be TRUE.
See alsoVF_cnt_...,   VF_cmp0,   VF_cmpC,   VF_cmpV,   VF_indpick,   VF_iselementC

 

VF_cnt_...VD_cnt_...VE_cnt_...
VI_cnt_...VBI_cnt_...VSI_cnt_...VLI_cnt_...VQI_cnt_... 
VU_cnt_...VUB_cnt_...VUS_cnt_...VUL_cnt_...VUQ_cnt_...VUI_cnt_...
      ...eq0      ...ne0      ...gt0      ...ge0      ...le0      ...lt0
      ...eqC      ...neC      ...gtC      ...geC      ...leC      ...ltC
      ...eqV      ...neV      ...gtV      ...geV      ...leV      ...ltV      ...stV      ...dtV
        ...inclrange0C        ...exclrange0C
        ...inclrangeCC        ...exclrangeCC
VCF_cnt_...VCD_cnt_...VCE_cnt_...
VPF_cnt_...VPD_cnt_...VPE_cnt_...
      ...eq0      ...ne0
      ...eqC      ...neC
      ...eqV      ...neV      ...stV      ...dtV
FunctionCount how often a condition is met
Syntax C/C++#include <VFmath.h>
ui VF_cnt_eq0( fVector X, ui size );
ui VF_cnt_ne0( fVector X, ui size );
ui VF_cnt_gt0( fVector X, ui size );
ui VF_cnt_ge0( fVector X, ui size );
ui VF_cnt_lt0( fVector X , ui size );
ui VF_cnt_le0( fVector X, ui size );

ui VF_cnt_eqC( fVector X, ui size, float C );
    (similarly: ..._neC, ..._gtC, ..._geC, ..._ltC, ..._leC)

ui VF_cnt_eqV( fVector X, fVector Y, ui size);
    (similarly: ..._neV, ..._gtV, ..._geV, ..._ltV, ..._leV)
ui VF_cnt_stV( fVector X, fVector Y, ui size, float TolRel, float TolAbs );
ui VF_cnt_dtV( fVector X, fVector Y, ui size, float TolRel, float TolAbs );

ui VF_cnt_inclrange0C( fVector X, ui size, float C );
ui VF_cnt_exclrange0C( fVector X, ui size, float C );
ui VF_cnt_inclrangeCC( fVector X, ui size, float CLo, float CHi );
ui VF_cnt_exclrangeCC( fVector X, ui size, float CLo, float CHi );

    (similarly VD_, VE_, VI_, and so on)

ui VCF_cnt_eq0( cfVector X, ui size );
ui VCF_cnt_ne0( cfVector X, ui size );
ui VCF_cnt_eqC( cfVector X, ui size, fComplex C );
ui VCF_cnt_neC( cfVector X, ui size, fComplex C );
ui VCF_cnt_eqV( cfVector X, cfVector Y, ui size );
ui VCF_cnt_neV( cfVector X, cfVector Y, ui size );
ui VCF_cnt_stV( cfVector X, cfVector Y, ui size, fComplex TolRel, fComplex TolAbs );
ui VCF_cnt_dtV( cfVector X, cfVector Y, ui size, fComplex TolRel, fComplex TolAbs );

    (similarly VPF_, VPD_, VPE_, VCD_, and VCE_ versions)

C++ VecObj#include <OptiVec.h>
ui vector<T>::cnt_eq0( );
ui vector<T>::cnt_ne0( );
ui vector<T>::cnt_gt0( );
ui vector<T>::cnt_ge0( );
ui vector<T>::cnt_lt0( );
ui vector<T>::cnt_le0( );
ui vector<T>::cnt_eqC( const T& C );
ui vector<T>::cnt_eqV( const vector<T>& Y );
ui vector<T>::cnt_stV( const vector<T>& Y, const T& TolRel, const T& TolAbs );
ui vector<T>::cnt_dtV( const vector<T>& Y, const T& TolRel, const T& TolAbs );
ui vector<T>::cnt_inclrange0C( const T& C );
ui vector<T>::cnt_exclrange0C( const T& C );
ui vector<T>::cnt_inclrangeCC( const T& CLo, const T& CHi );
ui vector<T>::cnt_exclrangeCC( const T& CLo, const T& CHi );
ui vector<complex<T>>::cnt_eq0( );
ui vector<complex<T>>::cnt_ne0( );
ui vector<complex<T>>::cnt_eqC( complex<T> C );
ui vector<complex<T>>::cnt_neC( complex<T> C );
ui vector<complex<T>>::cnt_eqV( const vector<complex<T>>& Y );
ui vector<complex<T>>::cnt_neV( const vector<complex<T>>& Y );
ui vector<complex<T>>::cnt_stV( const vector<complex<T>>& Y, complex<T> TolRel, complex<T> TolAbs );
ui vector<complex<T>>::cnt_dtV( const vector<complex<T>>& Y, complex<T> TolRel, complex<T> TolAbs );
Pascal/Delphiuses VFstd;
function VF_cnt_eq0( X:fVector; size:UIntSize ):UIntSize;
function VF_cnt_ne0( X:fVector; size:UIntSize ):UIntSize;
function VF_cnt_gt0( X:fVector; size:UIntSize ):UIntSize;
function VF_cnt_ge0( X:fVector; size:UIntSize ):UIntSize;
function VF_cnt_lt0( X:fVector; size:UIntSize ):UIntSize;
function VF_cnt_le0( X:fVector; size:UIntSize ):UIntSize;

function VF_cnt_eqC( X:fVector; size:UIntSize; C:Single ):UIntSize;
    (similarly: ..._neC, ..._gtC, ..._geC, ..._ltC, ..._leC)

function VF_cnt_eqV( X, Y:fVector; size:UIntSize ):UIntSize;
    (similarly: ..._neV, ..._gtV, ..._geV, ..._ltV, ..._leV)
function VF_cnt_stV( X, Y:fVector; size:UIntSize; TolRel, TolAbs:Single ):UIntSize;
function VF_cnt_dtV( X, Y:fVector; size:UIntSize; TolRel, TolAbs:Single ):UIntSize;

    (similarly VD_, VE_, VI_, and so on)

function VF_cnt_inclrange0C( X:fVector; size:UIntSize; C:Single ): UIntSize;
function VF_cnt_exclrange0C( X:fVector; size:UIntSize; C:Single ): UIntSize;
function VF_cnt_inclrangeCC( X:fVector; size:UIntSize; CLo, CHi:Single ): UIntSize;
function VF_cnt_exclrangeCC( X:fVector; size:UIntSize; CLo, CHi:Single ): UIntSize;

    (similarly VD_, VE_, VI_, and so on)

function VCF_cnt_eq0( X:cfVector; size:UIntSize ):UIntSize;
function VCF_cnt_ne0( X:cfVector; size:UIntSize ):UIntSize;
function VCF_cnt_eqC( X:cfVector; size:UIntSize; C:fComplex ):UIntSize;
function VCF_cnt_neC( X:cfVector; size:UIntSize; C:fComplex ):UIntSize;
function VCF_cnt_eqV( X, Y:cfVector; size:UIntSize ):UIntSize;
function VCF_cnt_neV( X, Y:cfVector; size:UIntSize ):UIntSize;
function VCF_cnt_stV( X, Y:cfVector; size:UIntSize; TolRel, TolAbs:fComplex ):UIntSize;
function VCF_cnt_dtV( X, Y:cfVector; size:UIntSize; TolRel, TolAbs:fComplex ):UIntSize;

    (similarly VPF_, VPD_, VPE_, VCD_, and VCE_ versions)

CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_cnt_eq0( ui *h_nTrue, fVector d_X, ui size );
ui VFcu_cnt_eq0( fVector h_X, ui size );

    (similarly .._ne0, .._gt0, .._ge0, .._le0, .._lt0)

int cudaVF_cnt_eqC( ui *h_nTrue, fVector d_X, ui size, float C );
int cusdVF_cnt_eqC( ui *h_nTrue, fVector d_X, ui size, float *d_C );
ui VFcu_cnt_eqC( fVector h_X, ui size, float C );

    (similarly: ..._neC, ..._gtC, ..._geC, ..._ltC, ..._leC)

int cudaVF_cnt_eqV( ui *h_nTrue, fVector d_X, fVector d_Y, ui size);
ui VFcu_cnt_eqV( fVector h_X, fVector h_Y, ui size);

    (similarly: ..._neV, ..._gtV, ..._geV, ..._ltV, ..._leV)

int cudaVF_cnt_stV( ui *h_nTrue, fVector d_X, fVector d_Y, ui size, float TolRel, float TolAbs);
int cusdVF_cnt_stV( ui *h_nTrue, fVector d_X, fVector d_Y, ui size, float *d_TolRel, float *d_TolAbs);
ui VFcu_cnt_stV( fVector h_X, fVector h_Y, ui size, float TolRel, float TolAbs);

    (similarly: ..._dtV)

int cudaVF_cnt_inclrange0C( ui *h_nTrue, fVector d_X, ui size, float C );
int cusdVF_cnt_inclrange0C( ui *h_nTrue, fVector d_X, ui size, float *d_C );
int cudaVF_cnt_inclrangeCC( ui *h_nTrue, fVector d_X, ui size, float CLo, float CHi );
int cusdVF_cnt_inclrangeCC( ui *h_nTrue, fVector d_X, ui size, float *d_CLo, float *d_CHi );
ui VFcu_cnt_inclrange0C( fVector h_X, ui size, float C );
ui VFcu_cnt_inclrangeCC( fVector h_X, ui size, float CLo, float CHi );

    (similarly: ..._exclrange0C and ..._exclrangeCC)

CUDA function Pascal/Delphiuses VFmath;
function cudaVF_cnt_eq0( var h_nTrue:UIntSize; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_cnt_eq0( h_X:fVector; size:UIntSize ): UIntSize;

    (similarly .._ne0, .._gt0, .._ge0, .._le0, .._lt0)

function cudaVF_cnt_eqC( var h_nTrue:UIntSize; d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_cnt_eqC( var h_nTrue:UIntSize; d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
function VFcu_cnt_eqC( h_X:fVector; size:UIntSize; C:Single ): UIntSize;

    (similarly: ..._neC, ..._gtC, ..._geC, ..._ltC, ..._leC)

function cudaVF_cnt_eqV( var h_nTrue:UIntSize; d_X, d_Y:fVector; size:UIntSize ): IntBool;
function VFcu_cnt_eqV( h_X, h_Y:fVector; size:UIntSize ): UIntSize;

    (similarly: ..._neV, ..._gtV, ..._geV, ..._ltV, ..._leV)

function cudaVF_cnt_stV( var h_nTrue:UIntSize; d_X, d_Y:fVector; size:UIntSize, TolRel, TolAbs:Single ): IntBool;
function cusdVF_cnt_stV( var h_nTrue:UIntSize; d_X, d_Y:fVector; size:UIntSize, d_TolRel, d_TolAbs:PSingle ): IntBool;
function VFcu_cnt_stV( h_X, h_Y:fVector; size:UIntSize, TolRel, TolAbs:Single ): UIntSize;

    (similarly: ..._dtV)

function cudaVF_cnt_inclrange0C( var h_nTrue:UIntSize; d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_cnt_inclrange0C( var h_nTrue:UIntSize; d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
function cudaVF_cnt_inclrangeCC( var h_nTrue:UIntSize; d_X:fVector; size:UIntSize; CLo, CHi:Single ): IntBool;
function cusdVF_cnt_inclrangeCC( var h_nTrue:UIntSize; d_X:fVector; size:UIntSize; d_CLo, d_CHi:PSingle ): IntBool;
function VFcu_cnt_inclrange0C( h_X:fVector; size:UIntSize; C:Single ): UIntSize;
function VFcu_cnt_inclrangeCC( h_X:fVector; size:UIntSize; CLo, CHi:Single ): UIntSize;

    (similarly: ..._exclrange0C and ..._exclrangeCC)

DescriptionThese functions are similar to the VF_cmp_... functions. Here, however, only the number of TRUE occurrences is counted and returned.

a) Simple comparisons:
Each element of X is compared with either 0, or a constant C, or the corresponding element of another vector, Y. The conditions to be tested are denoted by two letters as in ASSEMBLER or FORTRAN:
 
"eq" ("equal")True, if Xi = 0 (C, Yi, resp.)
"ne" ("not equal")True, if Xi ≠ 0 (C, Yi, resp.)
"gt" ("gteater than")True, if Xi > 0 (C, Yi, resp.)
"ge" ("greater or equal")   True, if Xi ≥ 0 (C, Yi, resp.)
"lt" ("less than")True, if Xi < 0 (C, Yi, resp.)
"le" ("less or equal")True, if Xi ≤ 0 (C, Yi, resp.)
"st" ("similar to")True, if Xi ≈ Yi,   i.e. | Xi − Yi | ≤ max( |Yi| * TolRel, TolAbs)
"dt" ("dissimilar to")True, if Xi ≉ Yi,   i.e. | Xi − Yi | > max( |Yi| * TolRel, TolAbs)

For complex numbers, only the tests for equality ("eq"), inequality ("ne"), similarity ("st") and dissimilarity ("dt") make sense and are available. In the tests for similarity ("st") and dissimilarity ("dt") of complex numbers, the parameters TolRel and TolAbs are complex as well, allowing to specify different tolerances for the real and imaginary parts.
For the unsigned integer data types, those functions checking for Xi < 0 or Xi ≤ 0 do not exist, as no unsigned number can possibly be below 0. Likewise, there are no "VU_cnt_ge0" functions, as the condition Xi ≥ 0 is trivially fulfilled for any possible input value.

b) Range-checking functions
Each element of X is checked if it falls into a range which is specified either by 0 and a (positive or negative) constant C, or by two constants, CLo and CHi. One has the choice between two versions, treating the range either as inclusive or as exclusive of the end points:
VF_cnt_inclrange0C checks for 0 ≤ x ≤ C (positive C) or 0 ≥ x ≥ C (negative C), whereas VF_cnt_exclrangeCC checks for CLo < x < CHi.
For the unsigned integer types, there are no functions "VU_cnt_inclrange0C", as the condition Xi ≥ 0 is trivially fulfilled for any possible input number.

Error handlingnone
Return valuenumber of elements for which the condition was found to be TRUE.
See alsoVF_cmp_...

 

VF_coherenceVD_coherenceVE_coherence
VFb_coherenceVDb_coherenceVEb_coherence
FunctionAmplitude-squared Coherence function of two signals
Syntax C/C++#include <VFstd.h>
float VF_coherence( fVector Coher, ui specsiz, fVector X, fVector Y, ui xsiz, fVector Win );
float VFb_coherence( fVector Coher, ui specsiz, fVector X, fVector Y, ui xsiz, fVector Win, fVector Buf );
C++ VecObj#include <OptiVec.h>
T vector<T>::coherence( const vector<T>& X, const vector<T>& Y, const vector<T>& Win );
T vector<T>::b_coherence( const vector<T>& X, const vector<T>& Y, const vector<T>& Win, vector<T>& Buf );
Pascal/Delphiuses VFstd;
function VF_coherence( Coher:fVector; specsiz:UIntSize; X,Y:fVector; xsiz:UIntSize; Win:fVector ): Single;
function VFb_coherence( Coher:fVector; specsiz:UIntSize; X,Y:fVector; xsiz:UIntSize; Win, Buf:fVector ): Single;
CUDA Function C/C++#include <cudaVFstd.h>
int cudaVF_coherence( float *h_coherfNyq, fVector d_Coher, ui specsiz, fVector d_X, fVector d_Y, ui xsiz, fVector d_Win );
int cusdVF_coherence( float *d_coherfNyq, fVector d_Coher, ui specsiz, fVector d_X, fVector d_Y, ui xsiz, fVector d_Win );
float VFcu_coherence( fVector h_Coher, ui specsiz, fVector h_X, fVector h_Y, ui xsiz, fVector h_Win );
CUDA Function Pascal/Delphiuses VFstd;
function cudaVF_coherence( var h_coherfNyq:Single; d_Coher:fVector; specsiz:UIntSize; d_X, d_Y:fVector; xsiz:UIntSize; d_Win:fVector ): IntBool;
function cusdVF_coherence( d_coherfNyq:PSingle; d_Coher:fVector; specsiz:UIntSize; d_X, d_Y:fVector; xsiz:UIntSize; d_Win:fVector ): IntBool;
function VFcu_coherence( h_Coher:fVector; specsiz:UIntSize; h_X, h_Y:fVector; xsiz:UIntSize; h_Win:fVector ): Single;
DescriptionThe amplitude-squared Coherence function of the two data sets X and Y is calculated. It is defined as the square of the cross-density spectrum of X and Y, divided by the product of the individual power-density spectra of X and Y:
CXY = SXY2 / (SXX * SYY).
As the result is identical for negative and positive frequencies, here the coherence function for 0 and positive frequencies is stored. In order to keep specsiz an integer power of 2, there are only specsiz points stored in Coher and the last one, the Coherence function at the Nyquist frequency fNyquist = 0.5 / sampling_interval, is given as the return value of the function. It may either be neglected (by calling the function like a void function) or stored as the last element in Spc by calling the function as
Coher[specsiz] = VF_coherence( Coher, specsiz, X, X, xsiz, Win );
in this case, Coher must have a length of specsiz+1.

xsiz must be at least 2*specsiz, and specsiz has to be an integer power of 2. Internally, X is divided into (xsiz/specsiz)−1 segments and the average over the spectra of the individual segments is calculated, before calculating the coherence function from these averaged spectra.

Win is a window that is applied to the data segments. The size of the Win vector must be 2*specsiz. Within the VectorLib library, three functions are available that give suitable Windows: VF_Welch,   VF_Parzen, and VF_Hann. A square window (i.e. no windowing at all) is achieved by setting all elements of Win to 1.0 using VF_equ1. Use of the square window is not recommended here, though.

Internally, VF_coherence allocate and frees additional workspace memory. For repeated calls, this would be inefficient. In such a case, it is recommended to use VFb_coherence instead. The size of Buf must be ≥ 4*xsiz + 8*specsiz. Additionally, Buf must be 128-bit (P8) or 256-bit (P9) aligned. This usually means you can only take a vector allocated by the VF_vector family as Buf.

Error handlingIf size is not a power of 2, VF_FFT (on which VF_coherence is based) complains "Size must be an integer power of 2" and the program is aborted.
Return valueCoherence function at the Nyquist frequency
See alsoVF_FFT,   VF_spectrum,   VF_xspectrum,   VF_convolve,   VF_autocorr,   VF_xcorr,   VF_filter

 

VF_combVD_combVE_comb
FunctionInitializes a vector with a comb function.
Syntax C/C++#include <VFstd.h>
void VF_comb( fVector X, ui size, ui spac, float C );
C++ VecObj#include <OptiVec.h>
void vector<T>::comb( ui spac, const T& C );
Pascal/Delphiuses VFstd;
procedure VF_comb( X:fVector; size:UIntSize; spac:Word; C:Single );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_comb( fVector d_X, ui size, ui spac, float C );
int cusdVF_comb( fVector d_X, ui size, ui spac, float *d_C );
void VFcu_comb( fVector h_X, ui size, ui spac, float C );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_comb( d_X:fVector; size:UIntSize; spac:Word; C:Single ): IntBool;
function cusdVF_comb( d_X:fVector; size:UIntSize; spac:Word; d_C:PSingle ): IntBool;
procedure VFcu_comb( h_X:fVector; size:UIntSize; spac:Word; C:Single );
DescriptionXi = C, i = 0, 1*spac, 2*spac,...
Xi = 0, otherwise
Error handlingIf the spacing spac of the comb exceeds size, an error message "Invalid parameter(s)" is displayed and the program aborted.
Return valuenone
See alsoVF_equ1,   VF_equ0,   VF_equC

 

VCF_complexVCD_complexVCE_complex
VPF_complexVPD_complexVPE_complex
FunctionConstructs a complex vector (either cartesian or polar coordinates) from its real and imaginary parts.
Syntax C/C++#include <VCFstd.h>
void VCF_complex( cfVector X, fVector Re, fVector Im, ui size );
C++ VecObj#include <OptiVec.h>
void vector<complex<T>>::complex( vector<T> Re, vector<T> Im );
Pascal/Delphiuses VCFstd;
procedure VCF_complex( X:cfVector; Re, Im:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVCFstd.h>
int cudaVCF_complex( cfVector d_X, fVector d_Re, fVector d_Im, ui size );
void VCFcu_complex( cfVector h_X, fVector h_Re, fVector h_Im, ui size );
CUDA function Pascal/Delphiuses VCFstd;
function cudaVCF_complex( d_X:cfVector; d_Re, d_Im:fVector; size:UIntSize ): IntBool;
procedure VCFcu_complex( h_X:cfVector; h_Re, h_Im:fVector; size:UIntSize );
DescriptionIdentical to VF_ReImtoC,   VD_ReImtoC, and VE_ReImtoC. See these functions for details.

 

VCF_conjVCD_conjVCE_conj
VPF_conjVPD_conjVPE_conj
FunctionFind the complex conjugate of a vector.
Syntax C/C++#include <VCFmath.h>
int VCF_conj( cfVector Y, cfVector X, ui size );
C++ VecObj#include <OptiVec.h>
int vector<complex<T>>::conj( const vector<complex<T>>& X );
Pascal/Delphiuses VCFmath;
function VCF_conj( Y, X:cfVector; size:UIntSize ): IntBool;
CUDA function C/C++#include <cudaVCFmath.h>
int cudaVCF_conj( cfVector d_Y, cfVector d_X, ui size );
void VCFcu_conj( cfVector h_Y, cfVector h_X, ui size );
CUDA function Pascal/Delphiuses VCFmath;
function cudaVCF_conj( d_Y, d_X:cfVector; size:UIntSize ): IntBool;
procedure VCFcu_conj( h_Y, h_X:cfVector; size:UIntSize );
DescriptionRe(Yi) = Re(Xi)
Im(Yi) = -Im(Xi)
Error handlingnone
Return valuealways FALSE (0)
See alsoVCF_neg,   VCF_revconj,   VCF_abs

 

V_continuePlot
FunctionGet back into the last viewport used for plotting
Syntax C/C++#include <Vgraph.h>
void V_continuePlot( void );
Pascal/Delphiuses Vgraph;
procedure V_continuePlot;
DescriptionIf one wants to add new DataPlots to an existing coordinate system after one has already defined a new viewport (e.g., for text output), this function takes one back to the most recently used coordinate system.
Error handlingnone
Return valuenone
See alsoV_getCoordSystem,   V_setCoordSystem,   V_setPlotRegion

 

VF_convolveVD_convolveVE_convolve
VF_convolvewEditVD_convolvewEditVE_convolvewEdit
VFb_convolveVDb_convolveVEb_convolve
VFb_convolvewEditVDb_convolvewEditVEb_convolvewEdit
FunctionCalculates the convolution of a vector with a response function.
Syntax C/C++#include <VFstd.h>
void VF_convolve( fVector Y, fVector Flt, fVector X, fVector Rsp, ui size );
void VF_convolvewEdit( fVector Y, fVector Flt, fVector X, fVector Rsp, ui size; fComplex thresh );
void VFb_convolve( fVector Y, fVector Flt, fVector X, fVector Rsp, ui size, fVector Buf );
void VFb_convolvewEdit( fVector Y, fVector Flt, fVector X, fVector Rsp, ui size; fComplex thresh, fVector Buf );
C++ VecObj#include <OptiVec.h>
void vector<T>::convolve( vector<T> Flt, const vector<T>& X, const vector<T>& Rsp );
void vector<T>::convolvewEdit( vector<T> Flt, const vector<T>& X, const vector<T>& Rsp, complex<T> thresh );
void vector<T>::b_convolve( vector<T> Flt, const vector<T>& X, const vector<T>& Rsp, vector<T> Buf );
void vector<T>::b_convolvewEdit( vector<T> Flt, const vector<T>& X, const vector<T>& Rsp, complex<T> thresh, vector<T> Buf );
Pascal/Delphiuses VFstd;
procedure VF_convolve( Y, Flt, X, Rsp:fVector; size:UIntSize );
procedure VF_convolvewEdit( Y, Flt, X, Rsp:fVector; size:UIntSize; thresh:fComplex );
procedure VFb_convolve( Y, Flt, X, Rsp:fVector; size:UIntSize; Buf:fVector );
procedure VFb_convolvewEdit( Y, Flt, X, Rsp:fVector; size:UIntSize; thresh:fComplex; Buf:fVector );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_convolve( fVector d_Y, fVector d_Flt, fVector d_X, fVector d_Rsp, ui size );
void VFcu_convolve( fVector h_Y, fVector h_Flt, fVector h_X, fVector h_Rsp, ui size );
int cudaVF_convolvewEdit( fVector d_Y, fVector d_Flt, fVector d_X, fVector d_Rsp, ui size, fComplex thresh );
void VFcu_convolvewEdit( fVector h_Y, fVector h_Flt, fVector h_X, fVector h_Rsp, ui size, fComplex thresh );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_convolve( d_Y, d_Flt, d_X, d_Rsp:fVector; size:UIntSize ): IntBool;
procedure VFcu_convolve( h_Y, h_Flt, h_X, h_Rsp:fVector; size:UIntSize );
function cudaVF_convolvewEdit( d_Y, d_Flt, d_X, d_Rsp:fVector; size:UIntSize; thresh:fComplex ): IntBool;
procedure VFcu_convolvewEdit( h_Y, h_Flt, h_X, h_Rsp:fVector; size:UIntSize; thresh:fComplex );
DescriptionThe convolution of X with the response function Rsp is calculated and stored in Y. A filter Flt is also calculated. If more than one vector is to be convolved with the same Rsp, use VF_convolve only once and use VF_filter for the other vectors.
The response has to be stored in Rsp in wrap-around order: the response for zero and positive times (or whatever the independent variable is) is stored in Rsp0 to Rspsize/2 and the response for negative times (beginning with the most negative time) in Rspsize/2+1 to Rspsize−1. You may wish to use VF_rotate or VF_reflect to achieve this wrap-around order and to construct the response vector.

The result of the convolution appears scaled with the sum of all elements of Rsp. Generally, therefore, Rsp should be normalized to 1.0.

X, Y, Rsp, and Flt must all be of the same size, which has to be an integer power of 2. X may be overwritten by Y, Rsp may be overwritten by Flt, but X and Flt as well as Y and Rsp have to be distinct from each other.

A response function which attenuates some frequences so much that any information about them is lost (e.g., high frequencies for a low-cut filter) is marked by very small values in Flt for the respective frequencies. Here, "very small" means that they are in the order of round-off error, i.e. around VF_absmax(Flt, size)*epsilon). In order to minimize round-off error, VF_convolve replaces such small values in Flt by 0. The default threshold for this editing can be retrieved by VF_setRspEdit. If you wish to set a different threshold for all calls to VF_convolve and VF_deconvolve, you may use VF_setRspEdit. However, this method is not thread-safe and should not be used to set different thresholds for different calls to VF_convolve or VF_deconvolve. Here, you have to use the variant VF_convolvewEdit, which takes the desired threshold as the argument thresh (and ignores the default threshold). As Flt consists of complex numbers, and as it is sometimes desirable to treat real and imaginary parts differently, thresh is complex as well.

Internally, VF_convolve / VF_convolvewEdit allocates and frees additional workspace memory. For repeated calls, this would be inefficient. In such a case, it is recommended to use VFb_convolve / VFb_convolvewEdit instead. The size of Buf must be ≥ 2*size. Additionally, Buf must be 128-bit (P8) or 256-bit (P9) aligned. This usually means you can only take a vector allocated by the VF_vector family as Buf.

Example C/C++VF_ramp( Time, 1024, 0.0, 1.0 );
VF_Gauss( Rsp, Time, 513, 10.0, 0.0, 1.0 );
      /* Response function for zero and positive times */
VF_reflect( Rsp+1, 1023 );
      /* ... and for negative times */
VF_divC( Rsp, Rsp, 1024, VF_sum( Rsp, 1024 ) );
      /* Normalisation of Rsp */
VF_convolve( X, Rsp, X, Rsp, 1024 );
      /* Convolution; X is overwritten by the desired result
         and Rsp is overwritten by the frequency filter */
VF_filter( Y, Y, Rsp, 1024 );
      /* Next convolution: instead of another call to
         VF_convolve, Y is filtered using the frequency
         filter just obtained */
 
Example Pascal/DelphiVF_ramp( Time, 1024, 0.0, 1.0 );
VF_Gauss( Rsp, Time, 513, 10.0, 0.0, 1.0 );
      (* Response function for zero and positive times *)
VF_reflect( VF_Pelement(Rsp,1), 1023 );
      (* ... and for negative times *)
VF_divC( Rsp, Rsp, 1024, VF_sum( Rsp, 1024 ) );
      (* Normalisation of Rsp *)
VF_convolve( X, Rsp, X, Rsp, 1024 );
      (* Convolution; X is overwritten by the desired result and Rsp is overwritten by the frequency filter *)
VF_filter( Y, Y, Rsp, 1024 );
      (* Next convolution: instead of another call to VF_convolve, Y is filtered using the frequency filter just obtained   *)

Mathematically, this convolution is based on the assumption that X is periodic; it still works well if X is non-periodic but converges on both ends to the same value X0 = Xsize−1. If that is not the case, the first and the last elements of Y are spoiled by "wrap-around" from elements on the other side. Extrapolate X on both sides in order to imbed the original X in a larger vector, if wrap-around is a problem. The minimum number of elements to be added equals half the width of the response function. (In the case of an asymmetric response function, it is the broader wing that counts.) After convolving the larger vector with the response function, it will be the dummy elements just added which become spoiled by wrap-around. Those elements of the result vector which correspond to the original X will represent the desired convolution of X with Rsp.
If X is smoothly converging on both sides to different values, it is not necessary to employ the procedure just described. Rather, the difference between the end points may be regarded as a linear trend. In this case, remove the trend, convolve the resultant vector and add the trend to the result:

Example C/C++d = (X[size−1] - X[0]) / (size−1);
VF_ramp( Trend, size, 0.0, d );
VF_subV( Y, X, Trend, size );
VF_convolve( Y, Flt, Y, Rsp, size );
VF_addV( Y, Y, Trend, size );
Example for treatment of end effects in Pascal/Delphi d := (VF_element(X,size−1) - X^) / (size−1);
VF_ramp( Trend, size, 0.0, d );
VF_subV( Y, X, Trend, size );
VF_convolve( Y, Flt, Y, Rsp, size );
VF_addV( Y, Y, Trend, size );

You might notice that Flt is declared as fVector rather than cfVector, although the information stored in Flt consists of complex numbers. The reason is that these numbers are stored in the packed complex format (as described for VF_FFT) which is used only in connection with Fourier-Transform operations of real vectors.

Error handlingIf size is not a power of 2, VF_FFT (on which VF_convolve is based) complains "Size must be an integer power of 2" and the program is aborted.
Return valuenone
See alsoVF_filter,   VF_deconvolve,   VF_FFT,   VF_autocorr,   VF_xcorr,   VF_spectrum

 

VF_corrcoeffVD_corrcoeffVE_corrcoeff
FunctionLinear correlation coefficient between two distributions
Syntax C/C++#include <VFstd.h>
float VF_corrcoeff( fVector X, fVector Y, ui size, float Xmean, float Ymean );
C++ VecObj#include <OptiVec.h>
T vector<T>::corrcoeff( const vector<T>& Y, T Xmean, T Ymean );
Pascal/Delphiuses VFstd;
function VF_corrcoeff( X, Y:fVector; size:UIntSize; Xmean, Ymean:Single ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_corrcoeff( ui *h_RetVal, fVector d_X, fVector d_Y, ui size, float Xmean, float Ymean );
int cusdVF_corrcoeff( ui *d_RetVal, fVector d_X, fVector d_Y, ui size, float *d_Xmean, float *d_Ymean );
float VFcu_corrcoeff( fVector h_X, fVector h_Y, ui size, float Xmean, float Ymean );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_corrcoeff( var h_RetVal:Single; d_X, d_Y:fVector; size:UIntSize; Xmean, Ymean:Single ): IntBool;
function cusdVF_corrcoeff( d_RetVal:PSingle; d_X, d_Y:fVector; size:UIntSize; d_Xmean, d_Ymean:PSingle ): IntBool;
procedure VFcu_corrcoeff( h_X, h_Y:fVector; size:UIntSize; Xmean, Ymean:Single );
DescriptionThe linear correlation coefficient ("Pearson's r") takes on values between −1.0 and +1.0. The mean values of both distributions must be known. They are passed to VF_corrcoeff as the parameters Xmean and Ymean.
Example C/C++r = VF_corrcoeff( X, Y, n, VF_mean( X, n ), VF_mean( Y, n ) );
Return valuelinear correlation coefficient r
See alsoVF_mean,   VF_varianceV,   VF_linregress

 

VF_cosVD_cosVE_cos
VFx_cosVDx_cosVEx_cos
VFr_cosVDr_cosVEr_cos
VFrx_cosVDrx_cosVErx_cos
VCF_cosVCD_cosVCE_cos
VCFx_cosVCDx_cosVCEx_cos
FunctionCosine function
Syntax C/C++#include <VFmath.h>
int VF_cos( fVector Y, fVector X, ui size );
int VFx_cos( fVector Y, fVector X, ui size, float A, float B, float C );
int VFr_cos( fVector Y, fVector X, ui size );
int VFrx_cos( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::cos( const vector<T>& X );
int vector<T>::x_cos( const vector<T>& X, const T& A, const T& B, const T& C );
int vector<T>::r_cos( const vector<T>& X );
int vector<T>::rx_cos( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_cos( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_cos( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function VFr_cos( Y, X:fVector; size:UIntSize ): IntBool;
function VFrx_cos( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_cos( fVector d_Y, fVector d_X, ui size );
int cudaVFx_cos( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_cos( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_cos( fVector h_Y, fVector h_X, ui size );
int VFxcu_cos( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_cos( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_cos( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_cos( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_cos( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_cos( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = cos ( Xi )
expanded versions: Yi = C * cos ( A*Xi + B )

For large values of Xi, round-off error becomes very large; if the Xi values are representable as rational multiples of p, it is better to use VF_cosrpi than VF_cos.

If, on the other hand, one can be sure that all Xi are within a reasonable range one can employ the faster reduced-range versions with the prefixes VFr_ and VFrx_. The range requirements for the reduced-range versions are:
64-bit: |Xi| < 232 (roughly 4.2*109)
32-bit: |Xi| ≤ 2p).
The reduced-range versions are not available for CUDA.

Error handlingPrecision errors in the real-value functions lead to a default result of 1.0 (as if the input were 0.0) and to a non-zero return value, but are otherwise ignored; _matherr is not called.
OVERFLOW errors can only occur in the complex versions and lead to a result of ±HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_cos2,   VF_cosrpi,   VF_sin,   VF_cosh,   VF_acos,   cos

 

VF_cos2VD_cos2VE_cos2
VFx_cos2VDx_cos2VEx_cos2
VFr_cos2VDr_cos2VEr_cos2
VFrx_cos2VDrx_cos2VErx_cos2
FunctionSquare of the cosine function
Syntax C/C++#include <VFmath.h>
int VF_cos2( fVector Y, fVector X, ui size );
int VFx_cos2( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::cos2( const vector<T>& X );
int vector<T>::x_cos2( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_cos2( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_cos2( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_cos2( fVector d_Y, fVector d_X, ui size );
int cudaVFx_cos2( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_cos2( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_cos2( fVector h_Y, fVector h_X, ui size );
int VFxcu_cos2( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_cos2( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_cos2( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_cos2( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_cos2( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_cos2( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = cos2( Xi )
expanded versions: Yi = C * cos2( A*Xi + B )

Calculating the squared trigonometric functions directly is faster and sometimes more accurate than first calculating the trigonometric function itself and squaring it afterwards.

If, on the other hand, one can be sure that all Xi are within a reasonable range one can employ the faster reduced-range versions with the prefixes VFr_ and VFrx_. The range requirements for the reduced-range versions are:
64-bit: |Xi| < 232 (roughly 4.2*109)
32-bit: |Xi| ≤ 2p).
The reduced-range versions are not available for CUDA.

Error handlingPrecision errors lead to a default result of 1.0 (as if the input were 0.0) and a non-zero return value, but are otherwise ignored; _matherr is not called.
OVERFLOW errors can only occur in the complex versions and lead to a result of ±HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_cos,   VF_cosrpi,  cos

 

VF_cosecVD_cosecVE_cosec
VFx_cosecVDx_cosecVEx_cosec
FunctionCosecant function
Syntax C/C++#include <VFmath.h>
int VF_cosec( fVector Y, fVector X, ui size );
int VFx_cosec( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::cosec( const vector<T>& X );
int vector<T>::x_cosec( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_cosec( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_cosec( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_cosec( fVector d_Y, fVector d_X, ui size );
int cudaVFx_cosec( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_cosec( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_cosec( fVector h_Y, fVector h_X, ui size );
int VFxcu_cosec( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_cosec( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_cosec( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_cosec( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_cosec( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_cosec( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = cosec ( Xi ) = 1.0 / sin ( Xi )
expanded versions: Yi = C * cosec ( A*Xi + B )
The cosecant is defined as the inverse of the sine (not to be mistaken for the arcus function arcsin!) For large values of Xi, round-off error becomes very large; if the Xi values are representable as rational multiples of p, it is better to use VF_cosecrpi than VF_cosec.
Error handlingFor TLOSS precision errors, the default result is arbitrarily set to 1.0 (as an exception from the general rule which would require the result to be the mean of the results for +0 and −0. This would be 0.0. However, zero is not a valid result for the cosecant function). For SING and OVERFLOW errors, the default result is ±HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_cosec2,   VF_cosecrpi,   VF_sin,   VF_cosech,   sin

 

VF_cosec2VD_cosec2VE_cosec2
VFx_cosec2VDx_cosec2VEx_cosec2
FunctionSquare of the cosecant function
Syntax C/C++#include <VFmath.h>
int VF_cosec2( fVector Y, fVector X, ui size );
int VFx_cosec2( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::cosec2( const vector<T>& X );
int vector<T>::x_cosec2( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_cosec2( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_cosec2( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_cosec2( fVector d_Y, fVector d_X, ui size );
int cudaVFx_cosec2( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_cosec2( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_cosec2( fVector h_Y, fVector h_X, ui size );
int VFxcu_cosec2( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_cosec2( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_cosec2( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_cosec2( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_cosec2( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_cosec2( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = cosec2 ( Xi )
expanded versions: Yi = C * cosec2 ( A*Xi + B )
Calculating the squared trigonometric functions directly is faster and sometimes more accurate than first calculating the trigonometric function itself and squaring it afterwards.
Error handlingFor SING, OVERFLOW, and TLOSS errors, the default result is ±HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_cosec,   VF_cosecrpi,  sin

 

VF_cosechVD_cosechVE_cosech
VFx_cosechVDx_cosechVEx_cosech
FunctionHyperbolic cosecant function
Syntax C/C++#include <VFmath.h>
int VF_cosech( fVector Y, fVector X, ui size );
int VFx_cosech( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::cosech( const vector<T>& X );
int vector<T>::x_cosech( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_cosech( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_cosech( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_cosech( fVector d_Y, fVector d_X, ui size );
int cudaVFx_cosech( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_cosech( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_cosech( fVector h_Y, fVector h_X, ui size );
int VFxcu_cosech( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_cosech( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_cosech( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_cosech( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_cosech( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_cosech( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = cosech ( Xi )
expanded versions: Yi = C * cosech ( A*Xi+B )
Error handlingSING errors lead to a default result of 0 (mean of +HUGE_VAL and -HUGE_VAL); OVERFLOW errors lead to a default result of ±HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_sinh,   VF_exp,   sinh

 

VF_cosecrpiVD_cosecrpiVE_cosecrpi
VF_cosecrpi2VD_cosecrpi2VE_cosecrpi2
VF_cosecrpi3VD_cosecrpi3VE_cosecrpi3
FunctionCosecant function of fractional multiples of p
Syntax C/C++#include <VFmath.h>
int VF_cosecrpi( fVector Y, iVector P, ui size, int q );
int VF_cosecrpi2( fVector Y, iVector P, ui size, int q );
int VF_cosecrpi3( fVector Y, iVector P, ui size, int q );
C++ VecObj#include <OptiVec.h>
int vector<T>::cosecrpi( const vector<int>& P, int q );
int vector<T>::cosecrpi2( const vector<int>& P, int q );
int vector<T>::cosecrpi3( const vector<int>& P, int q );
Pascal/Delphiuses VFmath;
function VF_cosecrpi( Y:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
function VF_cosecrpi2( Y:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
function VF_cosecrpi3( Y:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_cosecrpi( fVector d_Y, iVector d_P, ui size, int q );
int cudaVF_cosecrpi2( fVector d_Y, iVector d_P, ui size, int q );
int cudaVF_cosecrpi3( fVector d_Y, iVector d_P, ui size, int q );
int VFcu_cosecrpi( fVector h_Y, iVector h_P, ui size, int q );
int VFcu_cosecrpi2( fVector h_Y, iVector h_P, ui size, int q );
int VFcu_cosecrpi3( fVector h_Y, iVector h_P, ui size, int q );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_cosecrpi( d_Y:fVector; d_P:iVector; size:UIntSize; q:Integer ): IntBool;
function cudaVF_cosecrpi2( d_Y:fVector; d_P:iVector; size:UIntSize; q:Integer ): IntBool;
function cudaVF_cosecrpi3( d_Y:fVector; d_P:iVector; size:UIntSize; q:Integer ): IntBool;
function VFcu_cosecrpi( h_Y:fVector; h_P:iVector; size:UIntSize; q:Integer ): IntBool;
function VFcu_cosecrpi2( h_Y:fVector; h_P:iVector; size:UIntSize; q:Integer ): IntBool;
function VFcu_cosecrpi3( h_Y:fVector; h_P:iVector; size:UIntSize; q:Integer ): IntBool;
DescriptionYi = cosec( (Pi / q) * p )
The cosecant of fractional multiples of p is calculated. There are three versions: VF_cosecrpi is for general use with any arbitrary denominator q. If q is a power of 2, VF_cosecrpi2 should be used which is a highly optimized version using a look-up table. If q is a multiple of 3, VF_cosecrpi3 should be used. VF_cosecrpi2 and VF_cosecrpi3 work also with q values they are not optimized for; in this case, however, memory space is wasted for the tables.
Error handlingSING errors occur if Pi / q is exactly an integer number; the default result is 0.0 (which is the mean of +HUGE_VAL and -HUGE_VAL; in contrast to VF_cosec, 0.0 is chosen irrespective of the fact that it is not a valid result of the cosecant function); q must be non-zero; this is, however, not tested for.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_cosec,   sin

 

VF_cosectab2VD_cosectab2VE_cosectab2
VF_cosectab3VD_cosectab3VE_cosectab3
 Table of cosecant values for arguments between 0 and p/2.
Syntax C/C++#include <xmath.h>
extern float    VF_cosectab2[ VF_tabsz2+1 ];
extern double   VD_cosectab2[ VD_tabsz2+1 ];
extern extended VE_cosectab2[ VE_tabsz2+1 ];
extern float    VF_cosectab3[ VF_tabsz3+1 ];
extern double   VD_cosectab3[ VD_tabsz3+1 ];
extern extended VE_cosectab3[ VE_tabsz3+1 ];
Pascal/Delphiuses FCSCTAB3, DCSCTAB3, ECSCTAB3;
VF_cosectab2: array[0..VF_tabsz2] of Single;
VD_cosectab2: array[0..VD_tabsz2] of Double;
VE_cosectab2: array[0..VE_tabsz2] of Extended;
VF_cosectab3: array[0..VF_tabsz3] of Single;
VD_cosectab3: array[0..VD_tabsz3] of Double;
VE_cosectab3: array[0..VE_tabsz3] of Extended;
Description VF_cosectab2[ i ] = cosec ( i/(2*VF_tabsz2) * p ),    i=0,...,VF_tabsz2−1
VF_cosectab3[ i ] = cosec ( i/(2*VF_tabsz3) * p ),    i=0,...,VF_tabsz3−1
VF_cosectab2[ VF_tabsz2 ] = VF_cosectab3[ VF_tabsz3 ] = 0

These look-up tables of cosecant values for arguments between 0 and p/2 are used by VF_cosecrpi2 and the other functions of that family and are also available to the user. Since the cosecant of p/2 is not defined, zero is stored at its place.
C/C++: The symbols VF_tabsz2 etc., denoting the size of the tables, are defined in <xmath.h>.
Pascal/Delphi: The symbols VF_tabsz2 etc. are defined in the same units as the tables themselves.
FreePascal/Lazarus: These tables are not available for FreePascal/Lazarus.

 

VF_coshVD_coshVE_cosh
VFx_coshVDx_coshVEx_cosh
VCF_coshVCD_coshVCE_cosh
VCFx_coshVCDx_coshVCEx_cosh
FunctionHyperbolic cosine
Syntax C/C++#include <VFmath.h>
int VF_cosh( fVector Y, fVector X, ui size );
int VFx_cosh( fVector Y, fVector X, ui size, float A, float B, float C );
int VCF_cosh( cfVector Y, cfVector X, ui size );
int VCFx_cosh( cfVector Y, cfVector X, ui size, fComplex A, fComplex B, fComplex C );
C++ VecObj#include <OptiVec.h>
int vector<T>::cosh( const vector<T>& X );
int vector<T>::x_cosh( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_cosh( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_cosh( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_cosh( fVector d_Y, fVector d_X, ui size );
int cudaVFx_cosh( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_cosh( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_cosh( fVector h_Y, fVector h_X, ui size );
int VFxcu_cosh( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_cosh( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_cosh( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_cosh( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_cosh( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_cosh( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = cosh ( Xi )
expanded versions: Yi = C * cosh ( A*Xi+B )
Error handlingOVERFLOW errors lead to a default result of ±HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_sinh,   VF_exp,  cosh

 

VF_cosrpiVD_cosrpiVE_cosrpi
VF_cosrpi2VD_cosrpi2VE_cosrpi2
VF_cosrpi3VD_cosrpi3VE_cosrpi3
FunctionCosine function of fractional multiples of p
Syntax C/C++#include <VFmath.h>
int VF_cosrpi( fVector Y, iVector P, ui size, int q );
int VF_cosrpi2( fVector Y, iVector P, ui size, int q );
int VF_cosrpi3( fVector Y, iVector P, ui size, int q );
C++ VecObj#include <OptiVec.h>
int vector<T>::cosrpi( const vector<int>& P, int q );
int vector<T>::cosrpi2( const vector<int>& P, int q );
int vector<T>::cosrpi3( const vector<int>& P, int q );
Pascal/Delphiuses VFmath;
function VF_cosrpi( Y:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
function VF_cosrpi2( Y:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
function VF_cosrpi3( Y:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_cosrpi( fVector d_Y, iVector d_P, ui size, int q );
int cudaVF_cosrpi2( fVector d_Y, iVector d_P, ui size, int q );
int cudaVF_cosrpi3( fVector d_Y, iVector d_P, ui size, int q );
int VFcu_cosrpi( fVector h_Y, iVector h_P, ui size, int q );
int VFcu_cosrpi2( fVector h_Y, iVector h_P, ui size, int q );
int VFcu_cosrpi3( fVector h_Y, iVector h_P, ui size, int q );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_cosrpi( d_Y:fVector; d_P:iVector; size:UIntSize; q:Integer ): IntBool;
function cudaVF_cosrpi2( d_Y:fVector; d_P:iVector; size:UIntSize; q:Integer ): IntBool;
function cudaVF_cosrpi3( d_Y:fVector; d_P:iVector; size:UIntSize; q:Integer ): IntBool;
function VFcu_cosrpi( h_Y:fVector; h_P:iVector; size:UIntSize; q:Integer ): IntBool;
function VFcu_cosrpi2( h_Y:fVector; h_P:iVector; size:UIntSize; q:Integer ): IntBool;
function VFcu_cosrpi3( h_Y:fVector; h_P:iVector; size:UIntSize; q:Integer ): IntBool;
DescriptionYi = cos( (Pi / q) * p )
The cosine of fractional multiples of p is calculated. There are three versions: VF_cosrpi is for general use with any arbitrary denominator q. If q is a power of 2, VF_cosrpi2 should be used which is a highly optimized version reading the results from a look-up table, if possible. If q is a multiple of 3, VF_cosrpi3 should be used. VF_cosrpi3 offers a convenient way to use degrees instead of radians; if, for example, q is 180, the unit of the elements of P is "degree". VF_cosrpi2 and VF_cosrpi3 work also with q values they are not optimized for; in this case, however, memory space is wasted for the tables.
Error handlingThese functions are error-proof, as long as q ≠ 0.
Return valuealways FALSE (0)
See alsoVF_cos,   cos

 

VF_cotVD_cotVE_cot
VFx_cotVDx_cotVEx_cot
FunctionCotangent function
Syntax C/C++#include <VFmath.h>
int VF_cot( fVector Y, fVector X, ui size );
int VFx_cot( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::cot( const vector<T>& X );
int vector<T>::x_cot( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_cot( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_cot( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_cot( fVector d_Y, fVector d_X, ui size );
int cudaVFx_cot( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_cot( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_cot( fVector h_Y, fVector h_X, ui size );
int VFxcu_cot( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_cot( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_cot( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_cot( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_cot( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_cot( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = cot ( Xi )
expanded versions: Yi = C * cot ( A*Xi+B )
The cotangent is defined as the inverse of the tangent (not to be mistaken for the arcus function arctan!) For large values of Xi, round-off error becomes appreciable; if the Xi values are representable as rational multiples of p, it is better to use VF_cotrpi than VF_cot.
Error handlingFor TLOSS precision errors, the default result is 0.0 (which is the mean of +HUGE_VAL and -HUGE_VAL); for SING and OVERFLOW errors, the default result is ±HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_cot2,   VF_cotrpi,   VF_coth,   VF_atan,   VF_atan2,   tan

 

VF_cot2VD_cot2VE_cot2
VFx_cot2VDx_cot2VEx_cot2
FunctionSquare of the cotangent function
Syntax C/C++#include <VFmath.h>
int VF_cot2( fVector Y, fVector X, ui size );
int VFx_cot2( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::cot2( const vector<T>& X );
int vector<T>::x_cot2( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_cot2( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_cot2( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_cot2( fVector d_Y, fVector d_X, ui size );
int cudaVFx_cot2( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_cot2( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_cot2( fVector h_Y, fVector h_X, ui size );
int VFxcu_cot2( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_cot2( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_cot2( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_cot2( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_cot2( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_cot2( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = cot2( Xi )
expanded versions: Yi = C * cot2( A*Xi+B )
Calculating the squared trigonometric functions directly is faster and sometimes more accurate than first calculating the trigonometric function itself and squaring it afterwards.
Error handlingFor SING, OVERFLOW and TLOSS errors, the default result is +HUGE_VAL (multiplied by the sign of C in the expanded versions).
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_cot,   VF_cotrpi,   tan

 

VF_cothVD_cothVE_coth
VFx_cothVDx_cothVEx_coth
FunctionHyperbolic cotangent function
Syntax C/C++#include <VFmath.h>
int VF_coth( fVector Y, fVector X, ui size );
int VFx_coth( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::coth( const vector<T>& X );
int vector<T>::x_coth( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_coth( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_coth( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_coth( fVector d_Y, fVector d_X, ui size );
int cudaVFx_coth( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_coth( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_coth( fVector h_Y, fVector h_X, ui size );
int VFxcu_coth( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_coth( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_coth( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_coth( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_coth( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_coth( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = coth ( Xi )
expanded versions: Yi = C * coth ( A*Xi+B )
Error handlingSING errors lead to a default result of 0.0 (the mean of +HUGE_VAL and -HUGE_VAL); OVERFLOW errors lead to a default result of ±HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_sinh,   VF_tanh,   VF_exp,   tanh

 

VF_cotrpiVD_cotrpiVE_cotrpi
VF_cotrpi2VD_cotrpi2VE_cotrpi2
VF_cotrpi3VD_cotrpi3VE_cotrpi3
FunctionCotangent function of rational multiples of p
Syntax C/C++#include <VFmath.h>
int VF_cotrpi( fVector Y, iVector P, ui size, int q );
int VF_cotrpi2( fVector Y, iVector P, ui size, int q );
int VF_cotrpi3( fVector Y, iVector P, ui size, int q );
C++ VecObj#include <OptiVec.h>
int vector<T>::cotrpi( const vector<int>& P, int q );
int vector<T>::cotrpi2( const vector<int>& P, int q );
int vector<T>::cotrpi3( const vector<int>& P, int q );
Pascal/Delphiuses VFmath;
function VF_cotrpi( Y:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
function VF_cotrpi2( Y:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
function VF_cotrpi3( Y:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_cotrpi( fVector d_Y, iVector d_P, ui size, int q );
int cudaVF_cotrpi2( fVector d_Y, iVector d_P, ui size, int q );
int cudaVF_cotrpi3( fVector d_Y, iVector d_P, ui size, int q );
int VFcu_cotrpi( fVector h_Y, iVector h_P, ui size, int q );
int VFcu_cotrpi2( fVector h_Y, iVector h_P, ui size, int q );
int VFcu_cotrpi3( fVector h_Y, iVector h_P, ui size, int q );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_cotrpi( d_Y:fVector; d_P:iVector; size:UIntSize; q:Integer ): IntBool;
function cudaVF_cotrpi2( d_Y:fVector; d_P:iVector; size:UIntSize; q:Integer ): IntBool;
function cudaVF_cotrpi3( d_Y:fVector; d_P:iVector; size:UIntSize; q:Integer ): IntBool;
function VFcu_cotrpi( h_Y:fVector; h_P:iVector; size:UIntSize; q:Integer ): IntBool;
function VFcu_cotrpi2( h_Y:fVector; h_P:iVector; size:UIntSize; q:Integer ): IntBool;
function VFcu_cotrpi3( h_Y:fVector; h_P:iVector; size:UIntSize; q:Integer ): IntBool;
DescriptionYi = cot( (Pi / q) * p )
The cotangent of fractional multiples of p is calculated. There are three versions: VF_cotrpi is for general use with any arbitrary denominator q. If q is a power of 2, VF_cotrpi2 should be used which is a highly optimized version using a look-up table. If q is a multiple of 3, VF_cotrpi3 should be used. VF_cotrpi2 and VF_cotrpi3 also work with q values they are not optimized for; in this case, however, memory space is wasted for the tables.
Error handlingSING errors occur if Pi / q is a whole number. The default result is 0.0 (which is the mean of +HUGE_VAL and -HUGE_VAL); q must be non-zero; this is, however, not tested for.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_cot,   tan

 

VF_cprintVD_cprintVE_cprint
VCF_cprintVCD_cprintVCE_cprint
VPF_cprintVPD_cprintVPE_cprint
VI_cprintVBI_cprintVSI_cprintVLI_cprintVQI_cprint 
VU_cprintVUB_cprintVUS_cprintVUL_cprintVUQ_cprintVUI_cprint
Functionprint a vector to the screen. Only for console applications
Syntax C/C++#include <VFstd.h>
void VF_cprint( fVector X, ui size, unsigned nperline );
C++ VecObj#include <OptiVec.h>
void vector<T>::cprint( unsigned nperline );
Pascal/Delphiuses VFstd;
procedure VF_cprint( X:fVector; size:UIntSize; nperline:UInt );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_cprint( fVector d_X, ui size, unsigned nperline );
int cudaVF_cprint_buf( fVector d_X, ui size, unsigned nperline, fVector h_Wk );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_cprint( d_X:fVector; size:UIntSize; nperline:UInt ): IntBool;
function cudaVF_cprint_buf( d_X:fVector; size:UIntSize; nperline:UInt; h_Wk:fVector ): IntBool;
DescriptionWindows with Borland / Embarcadero compilers or MS Visual C++, DLL runtime:
size elements of X are printed to the screen (or "console"), into the actual text window, nperline elements in each line.
The display starts always with a new line. Please note that this may lead to an empty line at the beginning.
Each line begins with the index of the first element printed into that line. The index is followed by a colon and by the requested nperline elements.
Cartesian complex numbers are printed in braces, with the real and imaginary parts separated by a komma: {Re, Im}. Polar complex numbers are also written in braces, with the Mag and Arg parts separated by an at-sign: {Mag @ Arg}.
The display pauses every screenful. The user is prompted after each page to continue or to stop printing.
The number of digits per element is determined by the available space, which depends in turn on the line width and on the parameter nperline.

This family of functions is available only for console applications.
 

CUDA versions only:cudaV?_cprint_buf takes a host vector h_Wk as additional argument. The latter serves as buffer memory and needs to be (at least) of the same size as X. By avoiding the need of cudaV?_cprint to allocate its own buffer memory, cudaV?_cprint_buf is slightly faster.
 
Other Windows compilers as well as Linux: As here the width and height of the text window are not easily available, calls to V?_cprint are redirected to VF_print.
The same is true for Visual C++ with static runtime (here for the reason of version-to-version incompatibilities).
 
 
GCC Windows specific:In principle, the Windows port of GCC supports the 80-bit floating point type long double. However, the I/O routines rely on the runtime libraries of Visual C++, where 80-bit reals have disappeared a long time ago. This means that VE_cprint, VCE_cprint, and VPE_cprint work only with double precision and, more importantly, within double range. Input numbers outside double range are treated as ±DBL_MAX. There is, however, a possibility to get a full-accuracy readout at least in hexadecimal format. To this end, call VE_chexprint etc.
Error handlingIf nperline exceeds the maximum number of entries possible in the current text mode, an error message "Cannot use requested format (too many entries per line)!" is generated; in this case, the program chooses the maximum possible number nperline.
Return valuenone
See alsoVF_fprint,   VF_print,   VF_write,   VF_store,   cprintf

 

V_createCudaWorkspace
FunctionCreate a new workspace (CUDA stream with associated buffer memory)
Syntax C/C++#include <cudaVecLib.h>
V_CUDAWORKSPACE V_createCudaWorkspace( void );
Delphiuses VecLib;
function V_createCudaWorkspace: V_CUDAWORKSPACE;
DescriptionA new workspace, consisting of a CUDA stream and associated buffer memory, is created. When this workspace is no longer needed, it should be destroyed by calling V_destroyCudaWorkspace.
Return valueThe created workspace of type V_CUDAWORKSPACE
See alsoCudaOptiVec.htm, Chapter 5. Streams and Workspaces

 

VF_CtoAbsVD_CtoAbsVE_CtoAbs
FunctionAbsolute value (magnitude) of cartesian complex numbers
Syntax C/C++#include <VCFstd.h>
void VF_CtoAbs( fVector Abs, cfVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::CtoAbs( const vector<complex<T>>& X );
Pascal/Delphiuses VCFstd;
procedure VF_CtoAbs( Abs:fVector; X:cfVector; size:UIntSize );
CUDA function C/C++#include <cudaVCFstd.h>
int cudaVF_CtoAbs( fVector d_Abs, cfVector d_X, ui size ); void VFcu_CtoAbs( fVector h_Abs, cfVector h_X, ui size );
CUDA function Pascal/Delphiuses VCFstd;
function cudaVF_CtoAbs( d_Abs:fVector; d_X:cfVector; size:UIntSize ): IntBool;
procedure VFcu_CtoAbs( h_Abs:fVector; h_X:cfVector; size:UIntSize );
DescriptionAbsi = sqrt( Re2(Xi) + Im2(Xi) )
The absolute value, i.e. the magnitude of each element of the complex vector X is calculated. This function is almost identical to VCF_abs, but does not perform any error handling and requires input values whose real and imaginary parts are both smaller than ±sqrt( HUGE ).
Error handlingnone
Return valuenone
See alsoVCF_abs,   VF_PolartoC,   VF_CtoReIm,   VF_CtoArg,   VF_CtoNorm

 

VF_CtoArgVD_CtoArgVE_CtoArg
FunctionArgument (angle) of cartesian-complex numbers
Syntax C/C++#include <VCFstd.h>
void VF_CtoArg( fVector Arg, cfVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::CtoArg( const vector<complex<T>>& X );
Pascal/Delphiuses VCFstd;
procedure VF_CtoArg( Arg:fVector; X:cfVector; size:UIntSize );
CUDA function C/C++#include <cudaVCFstd.h>
int cudaVF_CtoArg( fVector d_Arg, cfVector d_X, ui size ); void VFcu_CtoArg( fVector h_Arg, cfVector h_X, ui size );
CUDA function Pascal/Delphiuses VCFstd;
function cudaVF_CtoArg( d_Arg:fVector; d_X:cfVector; size:UIntSize ): IntBool;
procedure VFcu_CtoArg( h_Arg:fVector; h_X:cfVector; size:UIntSize );
DescriptionArgi = arctan( Im(Xi) / Re(Xi) )
The argument, i.e. the angle of each element of the complex vector X is calculated. For Cartesian coordinates {0, 0}, the angle is arbitrary and is set to zero.
When necessary, depending on the signs of Re(Xi) and Im(Xi), p is added or subtracted from the arctan to obtain the correct quadrant.
Error handlingnone
Return valuenone
See alsoVF_PolartoC,   VF_CtoPolar,   VF_atan2,   VF_CtoAbs,   VF_CtoReIm

 

VF_CtoImVD_CtoImVE_CtoIm
FunctionExtract the imaginary part from a cartesian-complex vector.
Syntax C/C++#include <VCFstd.h>
void VF_CtoIm( fVector Im, cfVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::CtoIm( const vector<complex<T>>& X );
Pascal/Delphiuses VCFstd;
procedure VF_CtoIm( Im:fVector; X:cfVector; size:UIntSize );
CUDA function C/C++#include <cudaVCFstd.h>
int cudaVF_CtoIm( fVector d_Im, cfVector d_X, ui size ); void VFcu_CtoIm( fVector h_Im, cfVector h_X, ui size );
CUDA function Pascal/Delphiuses VCFstd;
function cudaVF_CtoIm( d_Im:fVector; d_X:cfVector; size:UIntSize ): IntBool;
procedure VFcu_CtoIm( h_Im:fVector; h_X:cfVector; size:UIntSize );
DescriptionThe imaginary part of the complex vector X is extracted and stored in Im.
Error handlingnone
Return valuenone
See alsoVF_CtoReIm,   VF_ReImtoC,   VF_ImtoC,   VF_PolartoC

 

VF_CtoNormVD_CtoNormVE_CtoNorm
FunctionNorm (square of the absolute value) of cartesian-complex numbers
Syntax C/C++#include <VCFstd.h>
void VF_CtoNorm( fVector Norm, cfVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::CtoNorm( const vector<complex<T>>& X );
Pascal/Delphiuses VCFstd;
procedure VF_CtoNorm( Norm:fVector; X:cfVector; size:UIntSize );
CUDA function C/C++#include <cudaVCFstd.h>
int cudaVF_CtoNorm( fVector d_Norm, cfVector d_X, ui size ); void VFcu_CtoNorm( fVector h_Norm, cfVector h_X, ui size );
CUDA function Pascal/Delphiuses VCFstd;
function cudaVF_CtoNorm( d_Norm:fVector; d_X:cfVector; size:UIntSize ): IntBool;
procedure VFcu_CtoNorm( h_Norm:fVector; h_X:cfVector; size:UIntSize );
DescriptionNormi = Re2(Xi) + Im2(Xi)
This definition of the Norm of a complex number is the same as in C++, but it is not consistent with the usual definition in mathematics, where the term "norm" is used as a synomym for "absolute value" or "magnitude". As defined here, the Norm is the square of the absolute value. The absolute value itself is available by the functions VF_CtoAbs (without error handling) and VCF_abs (with error handling).
Error handlingnone
Return valuenone
See alsoVF_PolartoC,   VF_CtoReIm,   VF_CtoArg,   VF_CtoAbs

 

VF_CtoPVD_CtoPVE_CtoP
FunctionTransformation of a cartesian complex into a polar complex vector
Syntax C/C++#include <VPFstd.h>
void VF_CtoP( pfVector Y, cfVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<polar<T>>::CtoP( const vector<complex<T>>& X );
Pascal/Delphiuses VPFstd;
procedure VF_CtoP( Y:pfVector; X:cfVector; size:UIntSize );
CUDA function C/C++#include <cudaVPFstd.h>
int cudaVF_CtoP( pfVector d_Y, cfVector d_X, ui size ); void VFcu_CtoP( pfVector h_Y, cfVector h_X, ui size );
CUDA function Pascal/Delphiuses VPFstd;
function cudaVF_CtoP( d_Y:pfVector; d_X:cfVector; size:UIntSize ): IntBool;
procedure VFcu_CtoP( h_Y:pfVector; h_X:cfVector; size:UIntSize );
DescriptionX is transformed from cartesian coordinates {Re, Im} into polar coordinates {Mag @ Arg}.
Error handlingnone
Return valuenone
See alsoVF_CtoPolar,   VF_PtoC

 

VF_CtoPolarVD_CtoPolarVE_CtoPolar
FunctionTransformation of complex numbers from Cartesian into polar coordinates, stored in separate vectors Mag and Arg.
Syntax C/C++#include <VCFstd.h>
void VF_CtoPolar( fVector Mag, fVector Arg, cfVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::CtoPolar( vector<T> Arg, const vector<complex<T>>& X );
Pascal/Delphiuses VCFstd;
procedure VF_CtoPolar( Mag, Arg:fVector; X:cfVector; size:UIntSize );
CUDA function C/C++#include <cudaVCFstd.h>
int cudaVF_CtoPolar( fVector d_Mag, fVector d_Arg, cfVector d_X, ui size ); void VFcu_CtoPolar( fVector h_Mag, fVector h_Arg, cfVector h_X, ui size );
CUDA function Pascal/Delphiuses VCFstd;
function cudaVF_CtoPolar( d_Mag, d_Arg:fVector; d_X:cfVector; size:UIntSize ): IntBool;
procedure VFcu_CtoPolar( h_Mag, h_Arg:fVector; h_X:cfVector; size:UIntSize );
DescriptionThe polar coordinates Mag (magnitude, absolute value) and Arg (argument, angle) of each element of the Cartesian complex vector X are calculated. For the Cartesian coordinates {0, 0}, the polar coordinates are also set to {0 @ 0}.
This function is similar to VF_CtoP, with the exception that Mag and Arg are stored in separate vectors instead of one polar complex vector, as in VF_CtoP.
Error handlingnone
Return valuenone
See alsoVF_CtoP,   VF_PolartoC,   VF_CtoReIm,   VF_CtoAbs,   VF_CtoArg

 

VF_CtoReVD_CtoReVE_CtoRe
FunctionExtracts the real part from a cartesian-complex vector.
Syntax C/C++#include <VCFstd.h>
void VF_CtoRe( fVector Re, cfVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::CtoRe( const vector<complex<T>>& X );
Pascal/Delphiuses VCFstd;
procedure VF_CtoRe( Re:fVector; X:cfVector; size:UIntSize );
CUDA function C/C++#include <cudaVCFstd.h>
int cudaVF_CtoRe( fVector d_Re, cfVector d_X, ui size ); void VFcu_CtoRe( fVector h_Re, cfVector h_X, ui size );
CUDA function Pascal/Delphiuses VCFstd;
function cudaVF_CtoRe( d_Re:fVector; d_X:cfVector; size:UIntSize ): IntBool;
procedure VFcu_CtoRe( h_Re:fVector; h_X:cfVector; size:UIntSize );
DescriptionThe real part of the complex vector X is extracted and stored in Re.
Error handlingnone
Return valuenone
See alsoVF_CtoReIm,   VF_ReImtoC,   VF_RetoC,   VF_PolartoC

 

VF_CtoReImVD_CtoReImVE_CtoReIm
FunctionExtracts the real and imaginary parts from a cartesian-complex vector.
Syntax C/C++#include <VCFstd.h>
void VF_CtoReIm( fVector Re, fVector Im, cfVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::CtoReIm( vector<T> Im, const vector<complex<T>>& X );
Pascal/Delphiuses VCFstd;
procedure VF_CtoReIm( Re, Im:fVector; X:cfVector; size:UIntSize );
CUDA function C/C++#include <cudaVCFstd.h>
int cudaVF_CtoReIm( fVector d_Re, fVector d_Im, cfVector d_X, ui size ); void VFcu_CtoReIm( fVector h_Re, fVector h_Im, cfVector h_X, ui size );
CUDA function Pascal/Delphiuses VCFstd;
function cudaVF_CtoReIm( d_Re, d_Im:fVector; d_X:cfVector; size:UIntSize ): IntBool;
procedure VFcu_CtoReIm( h_Re, h_Im:fVector; h_X:cfVector; size:UIntSize );
DescriptionThe real and imaginary parts of the complex vector X are extracted and stored in Re and Im, resp.
Error handlingnone
Return valuenone
See alsoVF_CtoRe,   VF_ReImtoC,   VF_RetoC,   VF_PolartoC

 

VF_cubicVD_cubicVE_cubic
VFx_cubicVDx_cubicVEx_cubic
VFu_cubicVDu_cubicVEu_cubic
VFux_cubicVDux_cubicVEux_cubic
VCF_cubicVCD_cubicVCE_cubic
VCFx_cubicVCDx_cubicVCEx_cubic
VCFu_cubicVCDu_cubicVCEu_cubic
VCFux_cubicVCDux_cubicVCEux_cubic
VPF_cubicVPD_cubicVPE_cubic
VPFu_cubicVPDu_cubicVPEu_cubic
FunctionCubic (third power)
Syntax C/C++#include <VFmath.h>
int VF_cubic( fVector Y, fVector X, ui size );
int VFx_cubic( fVector Y, fVector X, ui size, float A, float B );
int VFu_cubic( fVector Y, fVector X, ui size );
int VFux_cubic( fVector Y, fVector X, ui size, float A, float B );
C++ VecObj#include <OptiVec.h>
int vector<T>::cubic( const vector<T>& X );
int vector<T>::x_cubic( const vector<T>& X, const T& A, const T& B );
int vector<T>::u_cubic( const vector<T>& X );
int vector<T>::ux_cubic( const vector<T>& X, const T& A, const T& B );
Pascal/Delphiuses VFmath;
function VF_cubic( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_cubic( Y, X:fVector; size:UIntSize; A, B:Single ): IntBool;
function VFu_cubic( Y, X:fVector; size:UIntSize ): IntBool;
function VFux_cubic( Y, X:fVector; size:UIntSize; A, B:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_cubic( fVector d_Y, fVector d_X, ui size );
int cudaVFx_cubic( fVector d_Y, fVector d_X, ui size, float A, float B );
int cusdVFx_cubic( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B );
int VFucu_cubic( fVector h_Y, fVector h_X, ui size );
int VFuxcu_cubic( fVector h_Y, fVector h_X, ui size, float A, float B );
int cudaVFu_cubic( fVector d_Y, fVector d_X, ui size );
int cudaVFux_cubic( fVector d_Y, fVector d_X, ui size, float A, float B );
int cusdVFux_cubic( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B );
int VFucu_cubic( fVector h_Y, fVector h_X, ui size );
int VFuxcu_cubic( fVector h_Y, fVector h_X, ui size, float A, float B );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_cubic( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_cubic( d_Y, d_X:fVector; size:UIntSize; A, B:Single ): IntBool;
function cusdVFx_cubic( d_Y, d_X:fVector; size:UIntSize; d_A, d_B:PSingle ): IntBool;
function VFcu_cubic( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_cubic( h_Y, h_X:fVector; size:UIntSize; A, B:Single ): IntBool;
function cudaVFu_cubic( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFux_cubic( d_Y, d_X:fVector; size:UIntSize; A, B:Single ): IntBool;
function cusdVFux_cubic( d_Y, d_X:fVector; size:UIntSize; d_A, d_B:PSingle ): IntBool;
function VFucu_cubic( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFuxcu_cubic( h_Y, h_X:fVector; size:UIntSize; A, B:Single ): IntBool;
Descriptionsimple versions: Yi = Xi3
expanded versions: Yi = (A*Xi+B)3

"unprotected" versions (prefix VFu_,   VFux_, etc.):
These functions do not perform any error handling, which makes them much faster than the standard versions. The extended-precision complex (VCEu_ and VCEux_) versions do not take some of the security measures present in the standard version and might fail for results very near the overflow limit; results near the underflow limit might be rendered as 0.

Error handlingOVERFLOW errors lead to a default result of ±HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_square,   VF_quartic,   VF_sqrt,   VF_rcubic,   VF_pow,   VF_ipow,   VF_poly,   VF_ratio

 

VCF_dataPlotVCD_dataPlotVCE_dataPlot
FunctionPlot of a complex vector into an existing Cartesian complex plane.
Syntax C/C++#include <Vgraph.h>
void VCF_dataPlot( cfVector X, ui size, unsigned form, COLORREF color );
C++ VecObj#include <OptiVec.h>
void vector<complex<T>>::dataPlot( unsigned form, COLORREF color );
Pascal/Delphiuses Vgraph;
procedure VCF_dataPlot( X:cfVector; size:UIntSize; form:UInt; color:COLORREF );
DescriptionThe vector X is plotted into a Cartesian complex plane that has been drawn previously by a call to either VCF_autoPlot, or VCF_2AutoPlot or V_drawAxes.
For a description of the parameters form and color, see VF_xyAutoPlot.
Error handlingnone
Return valuenone
See alsoVCF_autoPlot,   VCF_2AutoPlot,   VF_xyAutoPlot,  chapter 4.12

 

VF_decElementVD_decElementVE_decElement
VCF_decElementVCD_decElementVCE_decElement
VCF_decElementReVCD_decElementReVCE_decElementRe
VCF_decElementImVCD_decElementImVCE_decElementIm
VI_decElementVBI_decElementVSI_decElementVLI_decElementVQI_decElement 
VU_decElementVUB_decElementVUS_decElementVUL_decElementVUQ_decElementVUI_decElement
FunctionDecrement a single vector element by a given value
Syntax C/C++#include <VFstd.h>
void VF_decElement( fVector X, ui pos, float C );
#include <VCFstd.h>
void VCF_decElement( cfVector X, ui pos, fComplex C );
void VCF_decElementRe( fVector X, ui pos, float C );
void VCF_decElementIm( fVector X, ui pos, float C );
C++ VecObj#include <OptiVec.h>
vector<T>::decElement( ui pos, T C );
vector<complex<T>>::decElement( ui pos, complex<T> C );
vector<complex<T>>::decElementRe( ui pos, T C );
vector<complex<T>>::decElementIm( ui pos, T C );
Pascal/Delphiuses VFstd;
procedure VF_decElement( X:fVector; pos:UIntSize; C:Single );
uses VCFstd;
procedure VCF_decElement( X:cfVector; pos:UIntSize; C:fComplex );
procedure VCF_decElementRe( X:cfVector; pos:UIntSize; C:Single );
procedure VCF_decElementIm( X:cfVector; pos:UIntSize; C:Single );
CUDA function C/C++#include <cudaVFstd.h>
void cudaVF_decElement( fVector d_X, ui pos, float C );
void cusdVF_decElement( fVector d_X, ui pos, float *d_C );
#include <cudaVCFstd.h>
void cudaVCF_decElement( cfVector d_X, ui pos, fComplex C );
void cusdVCF_decElement( cfVector d_X, ui pos, fComplex *d_C );
void cudaVCF_decElementRe( cfVector d_X, ui pos, float C );
void cusdVCF_decElementRe( cfVector d_X, ui pos, float *d_C );
void cudaVCF_decElementIm( cfVector d_X, ui pos, float C );
void cusdVCF_decElementIm( cfVector d_X, ui pos, float *d_C );
CUDA function Pascal/Delphiuses VFstd;
procedure cudaVF_decElement( d_X:fVector; pos:UIntSize; C:Single );
procedure cusdVF_decElement( d_X:fVector; pos:UIntSize; d_C:PSingle );
uses VCFstd;
procedure cudaVCF_decElement( d_X:cfVector; pos:UIntSize; C:fComplex );
procedure cusdVCF_decElement( d_X:cfVector; pos:UIntSize; d_C:PfComplex );
procedure cudaVCF_decElementRe( d_X:cfVector; pos:UIntSize; C:Single );
procedure cusdVCF_decElementRe( d_X:cfVector; pos:UIntSize; d_C:PSingle );
procedure cudaVCF_decElementIm( d_X:cfVector; pos:UIntSize; C:Single );
procedure cusdVCF_decElementIm( d_X:cfVector; pos:UIntSize; d_C:PSingle );
DescriptionReal versions:
X[i] -= C;
The element at the position pos is decremented by the value C.

Complex versions VCF_decElement etc.:
X[i].Re -= C.Re; X[i].Im -= C.Im;

Complex versions VCF_decElementRe etc.:
X[i].Re -= C.Re;
The imaginary part X[i].Im is left unaffected.

Complex versions VCF_decElementIm etc.:
X[i].Im -= C.Im;
The real part X[i].Re is left unaffected.

Error handlingnone
Return valuenone
See alsoVF_Pelement,   VF_element,   VF_getElement,   VF_setElement,   VF_accElement

 

VF_deconvolveVD_deconvolveVE_deconvolve
VF_deconvolvewEditVD_deconvolvewEditVE_deconvolvewEdit
VFb_deconvolveVDb_deconvolveVEb_deconvolve
VFb_deconvolvewEditVDb_deconvolvewEditVEb_deconvolvewEdit
FunctionDeconvolution
Syntax C/C++#include <VFstd.h>
void VF_deconvolve( fVector Y, fVector Flt, fVector X, fVector Rsp, ui size );
void VF_deconvolvewEdit( fVector Y, fVector Flt, fVector X, fVector Rsp, ui size; fComplex thresh );
void VFb_deconvolve( fVector Y, fVector Flt, fVector X, fVector Rsp, ui size, fVector Buf );
void VFb_deconvolvewEdit( fVector Y, fVector Flt, fVector X, fVector Rsp, ui size; fComplex thresh, fVector Buf );
C++ VecObj#include <OptiVec.h>
void vector<T>::deconvolve( vector<T> Flt, const vector<T>& X, const vector<T>& Rsp );
void vector<T>::deconvolvewEdit( vector<T> Flt, const vector<T>& X, const vector<T>& Rsp, complex<T> thresh );
void vector<T>::b_deconvolve( vector<T> Flt, const vector<T>& X, const vector<T>& Rsp, vector<T> Buf );
void vector<T>::b_deconvolvewEdit( vector<T> Flt, const vector<T>& X, const vector<T>& Rsp, complex<T> thresh, vector<T> Buf );
Pascal/Delphiuses VFstd;
procedure VF_deconvolve( Y, Flt, X, Rsp:fVector; size:UIntSize );
procedure VF_deconvolvewEdit( Y, Flt, X, Rsp:fVector; size:UIntSize; thresh:fComplex );
procedure VFb_deconvolve( Y, Flt, X, Rsp:fVector; size:UIntSize; Buf:fVector );
procedure VFb_deconvolvewEdit( Y, Flt, X, Rsp:fVector; size:UIntSize; thresh:fComplex; Buf:fVector );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_deconvolve( fVector d_Y, fVector d_Flt, fVector d_X, fVector d_Rsp, ui size );
void VFcu_deconvolve( fVector h_Y, fVector h_Flt, fVector h_X, fVector h_Rsp, ui size );
int cudaVF_deconvolvewEdit( fVector d_Y, fVector d_Flt, fVector d_X, fVector d_Rsp, ui size, fComplex thresh );
void VFcu_deconvolvewEdit( fVector h_Y, fVector h_Flt, fVector h_X, fVector h_Rsp, ui size, fComplex thresh );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_deconvolve( d_Y, d_Flt, d_X, d_Rsp:fVector; size:UIntSize ): IntBool;
procedure VFcu_deconvolve( h_Y, h_Flt, h_X, h_Rsp:fVector; size:UIntSize );
function cudaVF_deconvolvewEdit( d_Y, d_Flt, d_X, d_Rsp:fVector; size:UIntSize; thresh:fComplex ): IntBool;
procedure VFcu_deconvolvewEdit( h_Y, h_Flt, h_X, h_Rsp:fVector; size:UIntSize; thresh:fComplex );
DescriptionX is assumed to be the result of a convolution of some "true" profile with the response function Rsp; a deconvolution is attempted and stored in Y. A filter Flt is also calculated; if more than one vector is to be deconvolved with the same Rsp, use VF_deconvolve only once and use the filter Flt thus obtained to deconvolve other vectors by calling VF_filter. The response has to be stored in Rsp in wrap-around order: the elements for zero and positive times (or whatever the independent variable is) are stored as Rsp0 to Rspsize/2 and the elements for negative times as Rspsize/2+1 to Rspsize−1.
You may wish to use VF_rotate or VF_reflect to obtain the correct order when constructing the response vector.

X, Y, Rsp, and Flt must all be of the same size, which has to be an integer power of 2. X may be overwritten by Y, Rsp may be overwritten by Flt, but X and Flt as well as Y and Rsp have to be distinct from each other.

Mathematically, Flt is the inverse of the Fourier transform of Rsp. If the Fourier transform of Rsp contains elements equal to zero, all information is lost for the respective frequency and no reconstruction is possible. The best one can do in this case is to accept this loss and to deconvolve only up to those frequencies where still something is left to be reconstructed.
You are therefore advised not to use this function blindly but rather to inspect the Fourier transform of Rsp and decide what to do on the basis of your specific application. If you wish to use this function nevertheless, you may rely on the automatic editing of the filter, built into VF_deconvolve. Thereby, Flt is set to zero (instead of infinity) at those frequences where all information has been lost.
The default threshold for this editing can be retrieved by VF_setRspEdit. If you wish to set a different threshold for all calls to VF_deconvolve and VF_convolve, you may use VF_setRspEdit. However, this method is not thread-safe and should not be used to set different thresholds for different calls to VF_deconvolve or VF_convolve. Here, you have to use the variant VF_deconvolvewEdit, which takes the desired threshold as the argument thresh (and ignores the default threshold). As Flt consists of complex numbers, and as it is sometimes desirable to treat real and imaginary parts differently, thresh is complex as well.

This deconvolution is based on the implicit assumption that X is periodic; if this is not the case, see the description of VF_convolve about how to avoid end effects.

Internally, VF_deconvolve / VF_deconvolvewEdit allocates and frees additional workspace memory. For repeated calls, this would be inefficient. In such a case, it is recommended to use VFb_deconvolve / VFb_deconvolvewEdit instead. The size of Buf must be ≥ 2*size. Additionally, Buf must be 128-bit (P8) or 256-bit (P9) aligned. This usually means you can only take a vector allocated by the VF_vector family as Buf.

Error handlingIf size is not a power of 2, VF_FFT (on which VF_deconvolve is based) complains "Size must be an integer power of 2" and the program is aborted.
If, by VF_setRspEdit, you specified Trunc.Re = Trunc.Im = 0, or if you call VF_deconvolveEdit with thresh = fcplx(0,0), SING errors may occur that are handled by setting Flt to ±HUGE_VAL at the respective frequency. During multiplication with the transform of X, this may lead to unhandled floating-point overflow errors (in case your guess of Rsp was wrong and there is some information left at the frequencies where you thought it was not).
Return valuenone
See alsoVF_filter,   VF_convolve,   VF_FFT,   VF_xcorr,   VF_spectrum

 

VF_deleteVD_deleteVE_delete
VCF_deleteVCD_deleteVCE_delete
VPF_deleteVPD_deleteVPE_delete
VI_deleteVBI_deleteVSI_deleteVLI_deleteVQI_delete 
VU_deleteVUB_deleteVUS_deleteVUL_deleteVUQ_deleteVUI_delete
FunctionDelete one element from a vector
Syntax C/C++#include <VFstd.h>
void VF_delete( fVector X, ui size, ui pos );
C++ VecObj#include <OptiVec.h>
void vector<T>::delete( ui pos );
Pascal/Delphiuses VFstd;
procedure VF_delete( X:fVector; size, pos:UIntSize );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_delete( fVector d_X, ui size, ui pos );
void VFcu_delete( fVector h_X, ui size, ui pos );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_delete( d_X:fVector; size, pos:UIntSize ): IntBool;
procedure VFcu_delete( h_X:fVector; size, pos:UIntSize );
DescriptionThis is one of the few functions where the input vector itself is changed, instead of being mapped onto an output vector. The element numbered pos is deleted from the vector, and all the following elements are shifted one position lower; the last element is left undefined.
Error handlingnone
Return valuenone
See alsoVF_rotate,   VF_insert

 

VF_derivCVD_derivCVE_derivC
FunctionDerivative of an array with respect to an independent variable sampled at constant intervals
Syntax C/C++#include <VFstd.h>
void VF_derivC( fVector Y, fVector X, ui size, float DeltaT );
C++ VecObj#include <OptiVec.h>
void vector<T>::derivC( const vector<T>& X, T DeltaT );
Pascal/Delphiuses VFstd;
procedure VF_derivC( Y, X:fVector; size:UIntSize; DeltaT:Single );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_derivC( fVector d_Y, fVector d_X, ui size, float DeltaT );
int cusdVF_derivC( fVector d_Y, fVector d_X, ui size, float *d_DeltaT );
void VFcu_derivC( fVector h_Y, fVector h_X, ui size, float DeltaT );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_derivC( d_Y, d_X:fVector; size:UIntSize; DeltaT:Single ): IntBool;
function cusdVF_derivC( d_Y, d_X:fVector; size:UIntSize; d_DeltaT:PSingle ): IntBool;
procedure VFcu_derivC( h_Y, h_X:fVector; size:UIntSize; DeltaT:Single );
DescriptionY(t) = dX(t) / dt.
The vector X is assumed to be a function of a variable t; the t values themselves are equally spaced. Therefore, only the spacing, DeltaT, must be passed to the function. By parabolic interpolation, the derivative of X with respect to t is calculated. This function does the inverse of the integration by VF_runintegralC.
Error handlingnone
Return valuenone
See alsoVF_derivV,   VF_runintegralC

 

VF_derivVVD_derivVVE_derivV
FunctionDerivative of one array with respect to another
Syntax C/C++#include <VFstd.h>
void VF_derivV( fVector Z, fVector X, fVector Y, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::derivV( const vector<T>& X, const vector<T>& Y );
Pascal/Delphiuses VFstd;
procedure VF_derivV( Z, X, Y:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_derivV( fVector d_Z, fVector d_X, fVector d_Y,ui size );
void VFcu_derivV( fVector h_Z, fVector h_X, fVector h_Y,ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_derivV( d_Z, d_X, d_Y:fVector; size:UIntSize ): IntBool;
procedure VFcu_derivV( h_Z, h_X, h_Y:fVector; size:UIntSize );
DescriptionZ(X) = dY(X) / dX.
The derivative of Y with respect to X is calculated by parabolic interpolation and stored in Z. If the elements of X are equally-spaced, it is better to use VF_derivC. The inverse procedure, i.e. integration, is performed by VF_runintegralV.
Error handlingnone
Return valuenone
See alsoVF_derivC,   VF_runintegralV

 

V_destroyCudaWorkspace
FunctionDestroy an OptiVec for CUDA workspace
Syntax C/C++#include <cudaVecLib.h>
overror_t V_destroyCudaWorkspace( V_CUDAWORKSPACE *wsp );
Delphiuses VecLib;
function V_destroyCudaWorkspace( wsp: PV_CUDAWORKSPACE ): Integer;
DescriptionAny OptiVec for CUDA workspaces created by V_createCudaWorkspace must be destroyed by this function, in order to release the allocated resources.
Return value0 if successful; non-zero if the workspace was invalid
See alsoCudaOptiVec.htm, Chapter 5. Streams and Workspaces

 

VF_distributionVD_distributionVE_distribution
VI_distributionVBI_distributionVSI_distributionVLI_distributionVQI_distribution 
VU_distributionVUB_distributionVUS_distributionVUL_distributionVUQ_distributionVUI_distribution
FunctionHistogram or Distribution function
Syntax C/C++#include <VFstd.h>
ui VF_distribution( uiVector Abund, fVector Limits, ui nbins, fVector X, ui sizex, int mode );
C++ VecObj#include <OptiVec.h>
ui vector<ui>::distribution( const vector<T>& Limits, const vector<T>& X, int mode=0 );
Pascal/Delphiuses VFstd;
function VF_distribution( Abund:uiVector; Limits:fVector; bins:UIntSize; X:fVector; sizex:UIntSize; mode:Integer ):UIntSize;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_distribution( ui *h_nOutside, uiVector d_Abund, fVector d_Limits, ui nbins, fVector d_X, ui sizex, int mode );
int cusdVF_distribution( ui *d_nOutside, uiVector d_Abund, fVector d_Limits, ui nbins, fVector d_X, ui sizex, int mode );
ui VFcu_distribution( uiVector h_Abund, fVector h_Limits, ui nbins, fVector h_X, ui sizex, int mode );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_distribution( var h_nOutside:UIntSize; d_Abund:uiVector; d_Limits:fVector; bins:UIntSize; d_X:fVector; sizex:UIntSize; mode:Integer ): IntBool;
function cusdVF_distribution( d_nOutside:PUIntSize; d_Abund:uiVector; d_Limits:fVector; bins:UIntSize; d_X:fVector; sizex:UIntSize; mode:Integer ): IntBool;
function VFcu_distribution( h_Abund:uiVector; h_Limits:fVector; bins:UIntSize; h_X:fVector; sizex:UIntSize; mode:Integer ): UIntSize;
DescriptionThis function counts the number of elements of X falling into each of the intervals defined by Limits. The abundances thus determined are stored in Abund.
nbins is the number of elements of Limits, i.e. the number of intervals. sizex is the size of X.

Limits must be in ascending order. The spacing between the elements of Limits need not necessarily be constant.

The parameter mode specifies how to interpret the values given in Limits.
mode > 0: Limits contains the upper limits of the intervals
mode < 0: Limits contains the lower limits of the intervals
mode = 0: Limits contains the mid-points of the intervals. An element of X belongs to the element of Limits closest to it. In case of exactly equal distances, the interval with the lower index is chosen.
The interval defined by Limits0 extends down to -HUGE_VAL, the interval defined by Limitsnbins−1 reaches up to +HUGE_VAL.

The number of elements of X not falling into one of the intervals is returned. For mode > 0, these are the elements greater than the highest limit. For mode < 0, these are the elements smaller than the lowest limit.
For mode = 0, the return value is always zero, because the intervals are open on both sides. So every element of X is accounted for in Abund.

In order to get the normalized distribution function, use the sequence
VF_distribution( Abund, Limits, nbins, X, sizex, 0 );
V_UItoD( Y, Abund, nbins );
VD_divC( Y, Y, nbins, VD_integralV(Limits,Y,nbins) );

After that, a call to
VD_runintegralC( Y, Y, nbins, 1.0 );
yields the cumulated distribution function.

Batch processing of several vectors of equal size is possible using MF_Rows_distribution (preferred for C/C++) and MF_Cols_distribution (for Delphi).

Error handlingnone
Return valuenumber of elements of X not accounted for in Abund
See alsoVF_searchV

 

VF_divCVD_divCVE_divC
VCF_divCVCD_divCVCE_divC
VCF_divReCVCD_divReCVCE_divReC
VPF_divCVPD_divCVPE_divC
VPF_divReCVPD_divReCVPE_divReC
VI_divCVBI_divCVSI_divCVLI_divCVQI_divC 
VU_divCVUB_divCVUS_divCVUL_divCVUQ_divCVUI_divC
FunctionDivide by a constant
Syntax C/C++#include <VFmath.h>
void VF_divC( fVector Y, fVector X, ui size, float C );
void VCF_divC( cfVector Y, cfVector X, ui size, fComplex C );
void VCF_divReC( cfVector Y, cfVector X, ui size, float CRe );
C++ VecObj#include <OptiVec.h>
void vector<T>::divC( const vector<T>& X, const T& C );
void vector<complex<T>>::divC( const vector<complex<T>>& X, complex<T> C );
void vector<complex<T>>::divReC( const vector<complex<T>>& X, const T& CRe );
Pascal/Delphiuses VFmath;
procedure VF_divC( Y, X:fVector; size:UIntSize; C:Single );
procedure VCF_divC( Y, X:cfVector; size:UIntSize; C:fComplex );
procedure VCF_divReC( Y, X:cfVector; size:UIntSize; CRe:Single );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_divC( fVector d_Y, fVector d_X, ui size, float C );
int cusdVF_divC( fVector d_Y, fVector d_X, ui size, float *d_C );
void VFcu_divC( fVector d_Y, fVector d_X, ui size, float C );
#include <cudaVCFmath.h>
int cudaVCF_divReC( cfVector d_Y, cfVector d_X, ui size, float CRe );
int cusdVCF_divReC( cfVector d_Y, cfVector d_X, ui size, float *d_CRe );
void VCFcu_divReC( cfVector h_Y, cfVector h_X, ui size, float CRe );
CUDA function Pascal/Delphiuses VFmath, VCFmath;
function cudaVF_divC( d_Y, d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_divC( d_Y, d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
procedure VFcu_divC( h_Y, h_X:fVector; size:UIntSize; C:Single );
function cudaVCF_divReC( d_Y, d_X:cfVector; size:UIntSize; CRe:Single );
function cusdVCF_divReC( d_Y, d_X:cfVector; size:UIntSize; d_CRe:PSingle );
procedure VCFcu_divReC( h_Y, h_X:cfVector; size:UIntSize; CRe:Single );
DescriptionYi = Xi / C
The integer versions perform an integer division, discarding the remainder; the remainder itself may be obtained by the functions of the VI_modC family.
The complex floating-point versions exist in two variants, one for complex constants C, the other for real-valued constants CRe by which the complex vector is divided.
Error handlingnone
Return valuenone
See alsoVF_divV,   VF_addC,   VF_subC,   VF_mulC,   VF_divrC,   VF_modC,   VF_visC,   VF_redC

 

VF_divrCVD_divrCVE_divrC
VCF_divrCVCD_divrCVCE_divrC
VCF_divrReCVCD_divrReCVCE_divrReC
VFx_divrCVDx_divrCVEx_divrC
VCFx_divrCVCDx_divrCVCEx_divrC
VPF_divrCVPD_divrCVPE_divrC
VPF_divrReCVPD_divrReCVPE_divrReC
VI_divrCVBI_divrCVSI_divrCVLI_divrCVQI_divrC 
VU_divrCVUB_divrCVUS_divrCVUL_divrCVUQ_divrCVUI_divrC
FunctionReverse division: divide a constant by a vector
Syntax C/C++#include <VFmath.h>
void VF_divrC( fVector Y, fVector X, ui size, float C );
void VFx_divrC( fVector Y, fVector X, ui size, float A, float B, float C );
void VCF_divrC( cfVector Y, cfVector X, ui size, fComplex C );
void VCFx_divrC( cfVector Y, cfVector X, ui size, fComplex A, fComplex B, fComplex C );
void VCF_divrReC( cfVector Y, cfVector X, ui size, float CRe );
C++ VecObj#include <OptiVec.h>
void vector<T>::divrC( const vector<T>& X, const T& C );
void vector<T>::x_divrC( const vector<T>& X, const T& A, const T& B, const T& C );
void vector<complex<T>>::divrC( const vector<complex<T>>& X, complex<T> C );
void vector<complex<T>>::x_divrC( const vector<complex<T>>& X, complex<T> A, complex<T> B, complex<T> C );
void vector<complex<T>>::divrReC( const vector<complex<T>>& X, const T& CRe );
Pascal/Delphiuses VFmath;
procedure VF_divrC( Y, X:fVector; size:UIntSize; C:Single );
procedure VFx_divrC( Y, X:fVector; size:UIntSize; A, B, C:Single );
procedure VCF_divrC( Y, X:cfVector; size:UIntSize; C:fComplex );
procedure VCFx_divrC( Y, X:cfVector; size:UIntSize; A, B, C:fComplex );
procedure VCF_divrReC( Y, X:cfVector; size:UIntSize; CRe:Single );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_divrC( fVector d_Y, fVector d_X, ui size, float C );
int cusdVF_divrC( fVector d_Y, fVector d_X, ui size, float *d_C );
void VFcu_divrC( fVector d_Y, fVector d_X, ui size, float C );
int cudaVFx_divrC( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_divrC( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
void VFxcu_divrC( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
#include <cudaVCFmath.h>
int cudaVCF_divrReC( cfVector d_Y, cfVector d_X, ui size, float CRe );
int cusdVCF_divrReC( cfVector d_Y, cfVector d_X, ui size, float *d_CRe );
void VCFcu_divrReC( cfVector h_Y, cfVector h_X, ui size, float CRe );
CUDA function Pascal/Delphiuses VFmath, VCFmath;
function cudaVF_divrC( d_Y, d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_divrC( d_Y, d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
procedure VFcu_divrC( h_Y, h_X:fVector; size:UIntSize; C:Single );
function cudaVFx_divrC( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single );
function cusdVFx_divrC( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle );
procedure VFxcu_divrC( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single );
function cudaVCF_divrReC( d_Y, d_X:cfVector; size:UIntSize; CRe:Single );
function cusdVCF_divrReC( d_Y, d_X:cfVector; size:UIntSize; d_CRe:PSingle );
procedure VCFcu_divrReC( h_Y, h_X:cfVector; size:UIntSize; CRe:Single );
Descriptionsimple versions: Yi = C / Xi
expanded versions: Yi = C / (A*Xi+B)
The complex floating-point versions exist in two variants, one for complex constants C, the other for real-valued constants CRe which are divided by the complex vector.
Error handlingnone; for the floating-point versions, there are related functions that calculate 1.0 / Xi and 1.0 / (A*Xi+B): VF_inv and VFx_inv, respectively; both of these detect and handle SING errors.
Return valuenone
See alsoVF_divV,   VF_inv,   VF_addC,   VF_subC,   VF_mulC,   VF_divC,   VF_modC,   VF_visC,   VF_redC

 

VF_divrVVD_divrVVE_divrV
VCF_divrVVCD_divrVVCE_divrV
VCF_divrReVVCD_divrReVVCE_divrReV
VFs_divrVVDs_divrVVEs_divrV
VFx_divrVVDx_divrVVEx_divrV
VCFx_divrVVCDx_divrVVCEx_divrV
VCFx_divrReVVCDx_divrReVVCEx_divrReV
VPF_divrVVPD_divrVVPE_divrV
VPF_divrReVVPD_divrReVVPE_divrReV
VI_divrVVBI_divrVVSI_divrVVLI_divrVVQI_divrV 
VU_divrVVUB_divrVVUS_divrVVUL_divrVVUQ_divrVVUI_divrV
FunctionDivide two vectors in reverse order
Syntax C/C++#include <VFmath.h>
void VF_divrV( fVector Z, fVector X, fVector Y, ui size );
void VFx_divrV( fVector Z, fVector X, fVector Y, ui size, float A, float B );
void VCF_divrV( cfVector Z, cfVector X, cfVector Y, ui size );
void VCF_divrReV( cfVector Z, cfVector X, fVector Y, ui size );
void VCFx_divrV( cfVector Z, cfVector X, cfVector Y, ui size, fComplex A, fComplex B );
void VCFx_divrReV( cfVector Z, cfVector X, fVector Y, ui size, fComplex A, fComplex B );
C++ VecObj#include <OptiVec.h>
void vector<T>::divrV( const vector<T>& X, const vector<T>& Y );
void vector<T>::x_divrV( const vector<T>& X, const vector<T>& Y, const T& A, const T& B );
void vector<complex<T>>::divrV( const vector<complex<T>>& X, const vector<complex<T>>& Y );
void vector<complex<T>>::divrReV( const vector<complex<T>>& X, const vector<T>& Y );
void vector<complex<T>>::x_divrV( const vector<complex<T>>& X, const vector<complex<T>>& Y, complex<T> A, complex<T> B );
void vector<complex<T>>::x_divrReV( const vector<complex<T>>& X, const vector<T>& Y, complex<T> A, complex<T> B );
Pascal/Delphiuses VFmath;
procedure VF_divrV( Z, X, Y:fVector; size:UIntSize );
procedure VFx_divrV( Z, X, Y:fVector; size:UIntSize; A, B:Single );
procedure VCF_divrV( Z, X, Y:cfVector; size:UIntSize );
procedure VCF_divrReV( Z, X:cfVector; Y:fVector; size:UIntSize );
procedure VCFx_divrV( Z, X, Y:cfVector; size:UIntSize; A, B:fComplex );
procedure VCFx_divrReV( Z, X:cfVector; Y:fVector; size:UIntSize; A, B:fComplex );
CUDA function C/C++#include <cudaVFmath.h>
#include <cudaVCFmath.h>
int cudaVF_divrV( fVector d_Z, fVector d_X, fVector d_Y,ui size );
int cudaVFs_divrV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float C );
int cusdVFs_divrV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float *d_C );
int cudaVFx_divrV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float A, float B );
int cusdVFx_divrV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float *d_A, float *d_B );
int cudaVCF_divrReV( cfVector d_Z, cfVector d_X, fVector d_Y, ui size );
int cudaVCFx_divrReV( cfVector d_Z, cfVector d_X, fVector d_Y, ui size, fComplex A, fComplex B );
int cusdVCFx_divrReV( cfVector d_Z, cfVector d_X, fVector d_Y, ui size, fComplex *d_A, fComplex *d_B );
void VFcu_divrV( fVector h_Z, fVector h_X, fVector h_Y,ui size );
void VFscu_divrV( fVector h_Z, fVector h_X, fVector h_Y, ui size, float C );
void VFxcu_divrV( fVector h_Z, fVector h_X, fVector h_Y, ui size, float A, float B );
void VCFcu_divrReV( cfVector h_Z, cfVector h_X, fVector h_Y, ui size );
void VCFxcu_divrV( cfVector h_Z, cfVector h_X, cfVector h_Y, ui size, fComplex A, fComplex B );
void VCFxcu_divrReV( cfVector h_Z, cfVector h_X, fVector h_Y, ui size, fComplex A, fComplex B );
CUDA function Pascal/Delphiuses VFmath, VCFmath;
function cudaVF_divrV( d_Z, d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cudaVFs_divrV( d_Z, d_X, d_Y:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVFs_divrV( d_Z, d_X, d_Y:fVector; size:UIntSize; d_C:PSingle ): IntBool;
function cudaVFx_divrV( d_Z, d_X, d_Y:fVector; size:UIntSize; A, B:Single ): IntBool;
function cusdVFx_divrV( d_Z, d_X, d_Y:fVector; size:UIntSize; d_A, d_B:PSingle ): IntBool;
function cudaVCF_divrReV( d_Z, d_X:cfVector; d_Y:fVector; size:UIntSize ): IntBool;
function cudaVCFx_divrReV( d_Z, d_X:cfVector; d_Y:fVector; size:UIntSize; A, B:fComplex ): IntBool;
function cusdVCFx_divrReV( d_Z, d_X:cfVector; d_Y:fVector; size:UIntSize; d_A, d_B:PfComplex ): IntBool;
procedure VFcu_divrV( h_Z, h_X, h_Y:fVector; size:UIntSize );
procedure VFscu_divrV( h_Z, h_X, h_Y:fVector; size:UIntSize; C:Single );
procedure VFxcu_divrV( h_Z, h_X, h_Y:fVector; size:UIntSize; A, B:Single );
procedure VCFcu_divrReV( h_Z, h_X:cfVector; h_Y:fVector; size:UIntSize );
procedure VCFxcu_divrReV( h_Z, h_X:cfVector; h_Y:fVector; size:UIntSize; A, B:fComplex );
Descriptionsimple versions: Zi = Yi / Xi
expanded versions: Zi = Yi / (A*Xi+B)
The complex floating-point versions exist in two variants: in the first variant (e.g., VCF_divrV,   VCFx_divrV), X, Y, and Z are all complex; in the second variant, Y is real-valued (e.g., VCF_divrReV - "division in reverse order: divide a real vector by a complex one").
Error handlingnone
Return valuenone
See alsoVF_divrC,   VF_divrVI,   VF_addV,   VF_mulV,   VF_modV,   VF_visV,   VF_redV

 

VF_divrVIVD_divrVIVE_divrVI
VF_divrVBIVD_divrVBIVE_divrVBI
VF_divrVSIVD_divrVSIVE_divrVSI
VF_divrVLIVD_divrVLIVE_divrVLI
VF_divrVQIVD_divrVQIVE_divrVQI
VF_divrVUVD_divrVUVE_divrVU
VF_divrVUBVD_divrVUBVE_divrVUB
VF_divrVUSVD_divrVUSVE_divrVUS
VF_divrVULVD_divrVULVE_divrVUL
VF_divrVUQVD_divrVUQVE_divrVUQ
VF_divrVUIVD_divrVUIVE_divrVUI
FunctionReverse division: divide the elements of an integer vector by corresponding elements of a floating-point vector
Syntax C/C++#include <VFmath.h>
void VF_divrVI( fVector Z, fVector X, iVector Y,ui size );
void VF_divrVUB( fVector Z, fVector X, ubVector Y, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::divrVI( const vector<T>& X, const vector<int>& Y );
void vector<T>::divrVUS( const vector<T>& X, const vector<unsigned short>& Y, );
Pascal/Delphiuses VFmath;
procedure VF_divrVI( Z, X:fVector; Y:iVector; size:UIntSize );
procedure VF_divrVUL( Z, X:fVector; Y:ulVector; size:UIntSize );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_divrVI( fVector d_Z, fVector d_X, iVector d_Y,ui size );
int cudaVF_divrVUB( fVector d_Z, fVector d_X, ubVector d_Y, ui size );
void VFcu_divrVI( fVector h_Z, fVector h_X, iVector h_Y,ui size );
void VFcu_divrVUB( fVector h_Z, fVector h_X, ubVector h_Y, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_divrVI( d_Z, d_X:fVector; d_Y:iVector; size:UIntSize ): IntBool;
function cudaVF_divrVUL( d_Z, d_X:fVector; d_Y:ulVector; size:UIntSize ): IntBool;
procedure VFcu_divrVI( h_Z, h_X:fVector; h_Y:iVector; size:UIntSize );
procedure VFcu_divrVUL( h_Z, h_X:fVector; h_Y:ulVector; size:UIntSize );
DescriptionZi = Yi / Xi
Error handlingnone
Return valuenone
See alsoVF_divrV,   VF_divVI,   VF_addVI

 

VF_divVVD_divVVE_divV
VFs_divVVDs_divVVEs_divV
VFx_divVVDx_divVVEx_divV
VCF_divVVCD_divVVCE_divV
VCF_divReVVCD_divReVVCE_divReV
VCFx_divVVCDx_divVVCEx_divV
VCFx_divReVVCDx_divReVVCEx_divReV
VPF_divVVPD_divVVPE_divV
VPF_divReVVPD_divReVVPE_divReV
VI_divVVBI_divVVSI_divVVLI_divVVQI_divV 
VU_divVVUB_divVVUS_divVVUL_divVVUQ_divVVUI_divV
FunctionDivide two vectors
Syntax C/C++#include <VFmath.h>
void VF_divV( fVector Z, fVector X, fVector Y, ui size );
void VFs_divV( fVector Z, fVector X, fVector Y, ui size, float C );
void VFx_divV( fVector Z, fVector X, fVector Y, ui size, float A, float B );
void VCF_divV( cfVector Z, cfVector X, cfVector Y, ui size );
void VCF_divReV( cfVector Z, cfVector X, fVector Y, ui size );
void VCFx_divV( cfVector Z, cfVector X, cfVector Y, ui size, fComplex A, fComplex B );
void VCFx_divReV( cfVector Z, cfVector X, fVector Y, ui size, fComplex A, fComplex B );
C++ VecObj#include <OptiVec.h>
void vector<T>::divV( const vector<T>& X, const vector<T>& Y );
void vector<T>::s_divV( const vector<T>& X, const vector<T>& Y, const T& C );
void vector<T>::x_divV( const vector<T>& X, const vector<T>& Y, const T& A, const T& B );
void vector<complex<T>>::divV( const vector<complex<T>>& X, const vector<complex<T>>& Y );
void vector<complex<T>>::divReV( const vector<complex<T>>& X, const vector<T>& Y );
void vector<complex<T>>::x_divV( const vector<complex<T>>& X, const vector<complex<T>>& Y, complex<T> A, complex<T> B );
void vector<complex<T>>::x_divReV( const vector<complex<T>>& X, const vector<T>& Y, complex<T> A, complex<T> B );
Pascal/Delphiuses VFmath;
procedure VF_divV( Z, X, Y:fVector; size:UIntSize );
procedure VFs_divV( Z, X, Y:fVector; size:UIntSize; C:Single );
procedure VFx_divV( Z, X, Y:fVector; size:UIntSize; A, B:Single );
procedure VCF_divV( Z, X, Y:cfVector; size:UIntSize );
procedure VCF_divReV( Z, X:cfVector; Y:fVector; size:UIntSize );
procedure VCFx_divV( Z, X, Y:cfVector; size:UIntSize; A, B:fComplex );
procedure VCFx_divrReV( Z, X:cfVector; Y:fVector; size:UIntSize; A, B:fComplex );
CUDA function C/C++#include <cudaVFmath.h>
#include <cudaVCFmath.h>
int cudaVF_divV( fVector d_Z, fVector d_X, fVector d_Y,ui size );
int cudaVFs_divV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float C );
int cusdVFs_divV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float *d_C );
int cudaVFx_divV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float A, float B );
int cusdVFx_divV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float *d_A, float *d_B );
int cudaVCF_divReV( cfVector d_Z, cfVector d_X, fVector d_Y, ui size );
int cudaVCFx_divReV( cfVector d_Z, cfVector d_X, fVector d_Y, ui size, fComplex A, fComplex B );
int cusdVCFx_divReV( cfVector d_Z, cfVector d_X, fVector d_Y, ui size, fComplex *d_A, fComplex *d_B );
void VFcu_divV( fVector h_Z, fVector h_X, fVector h_Y,ui size );
void VFscu_divV( fVector h_Z, fVector h_X, fVector h_Y, ui size, float C );
void VFxcu_divV( fVector h_Z, fVector h_X, fVector h_Y, ui size, float A, float B );
void VCFcu_divReV( cfVector h_Z, cfVector h_X, fVector h_Y, ui size );
void VCFxcu_divV( cfVector h_Z, cfVector h_X, cfVector h_Y, ui size, fComplex A, fComplex B );
void VCFxcu_divReV( cfVector h_Z, cfVector h_X, fVector h_Y, ui size, fComplex A, fComplex B );
CUDA function Pascal/Delphiuses VFmath, VCFmath;
function cudaVF_divV( d_Z, d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cudaVFs_divV( d_Z, d_X, d_Y:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVFs_divV( d_Z, d_X, d_Y:fVector; size:UIntSize; d_C:PSingle ): IntBool;
function cudaVFx_divV( d_Z, d_X, d_Y:fVector; size:UIntSize; A, B:Single ): IntBool;
function cusdVFx_divV( d_Z, d_X, d_Y:fVector; size:UIntSize; d_A, d_B:PSingle ): IntBool;
function cudaVCF_divReV( d_Z, d_X:cfVector; d_Y:fVector; size:UIntSize ): IntBool;
function cudaVCFx_divReV( d_Z, d_X:cfVector; d_Y:fVector; size:UIntSize; A, B:fComplex ): IntBool;
function cusdVCFx_divReV( d_Z, d_X:cfVector; d_Y:fVector; size:UIntSize; d_A, d_B:PfComplex ): IntBool;
procedure VFcu_divV( h_Z, h_X, h_Y:fVector; size:UIntSize );
procedure VFscu_divV( h_Z, h_X, h_Y:fVector; size:UIntSize; C:Single );
procedure VFxcu_divV( h_Z, h_X, h_Y:fVector; size:UIntSize; A, B:Single );
procedure VCFcu_divReV( h_Z, h_X:cfVector; h_Y:fVector; size:UIntSize );
procedure VCFxcu_divReV( h_Z, h_X:cfVector; h_Y:fVector; size:UIntSize; A, B:fComplex );
Descriptionsimple versions: Zi = Xi / Yi
scaled versions: Zi = C * (Xi / Yi)
expanded versions: Zi = (A*Xi+B) / Yi
The complex floating-point versions exist in two variants: in the first variant (e.g., VCF_divV,   VCFx_divV), X, Y, and Z are all complex; in the second variant, Y is real-valued (e.g., VCF_divReV - "divide by a real vector").
Error handlingnone
Return valuenone
See alsoVF_divC,   VF_divVI,   VF_addV,   VF_mulV,   VF_modV,   VF_visV,   VF_redV

 

VF_divVIVD_divVIVE_divVI
VF_divVBIVD_divVBIVE_divVBI
VF_divVSIVD_divVSIVE_divVSI
VF_divVLIVD_divVLIVE_divVLI
VF_divVQIVD_divVQIVE_divVQI
VF_divVUVD_divVUVE_divVU
VF_divVUBVD_divVUBVE_divVUB
VF_divVUSVD_divVUSVE_divVUS
VF_divVULVD_divVULVE_divVUL
VF_divVUQVD_divVUQVE_divVUQ
VF_divVUIVD_divVUIVE_divVUI
FunctionElement-wise division of a floating-point vector by an integer vector
Syntax C/C++#include <VFmath.h>
void VF_divVI( fVector Z, fVector X, iVector Y,ui size );
void VF_divVUB( fVector Z, fVector X, ubVector Y, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::divVI( const vector<T>& X, const vector<int>& Y );
void vector<T>::divVUS( const vector<T>& X, const vector<unsigned short>& Y, );
Pascal/Delphiuses VFmath;
procedure VF_divVI( Z, X:fVector; Y:iVector; size:UIntSize );
procedure VF_divVUL( Z, X:fVector; Y:ulVector; size:UIntSize );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_divVI( fVector d_Z, fVector d_X, iVector d_Y,ui size );
int cudaVF_divVUB( fVector d_Z, fVector d_X, ubVector d_Y, ui size );
void VFcu_divVI( fVector h_Z, fVector h_X, iVector h_Y,ui size );
void VFcu_divVUB( fVector h_Z, fVector h_X, ubVector h_Y, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_divVI( d_Z, d_X:fVector; d_Y:iVector; size:UIntSize ): IntBool;
function cudaVF_divVUL( d_Z, d_X:fVector; d_Y:ulVector; size:UIntSize ): IntBool;
procedure VFcu_divVI( h_Z, h_X:fVector; h_Y:iVector; size:UIntSize );
procedure VFcu_divVUL( h_Z, h_X:fVector; h_Y:ulVector; size:UIntSize );
DescriptionZi = Xi / Yi
Error handlingnone
Return valuenone
See alsoVF_divV,   VF_divrVI,   VF_addVI

 

V_drawAxes
FunctionDraws a Cartesian coordinate system.
Syntax C/C++#include <Vgraph.h>
void V_drawAxes( long double Xmin, long double Xmax, long double Ymin, long double Ymax );
Pascal/Delphiuses Vgraph;
procedure V_drawAxes( xmin, xmax, ymin, ymax:Extended );
DescriptionA Cartesian coordinate system is drawn with the axes scaled according to the values passed as Xmin, Xmax, Ymin, and Ymax. Ten subdivision lines are drawn on each axis. No adjustment of this scaling is performed; if automatic fine-tuning of the scaling is desired, call V_findAxes instead. Before using this function, V_initPlot has to be called. V_drawAxes is used internally by all functions of the AutoPlot family.
Error handlingnone
Return valuenone
See alsoV_findAxes,   V_initPlot,   VF_xyAutoPlot,   VF_xyDataPlot,  chapter 4.12

 

V_DtoFV_DtoE
FunctionData type conversions. See V_FtoD.

 

VF_elementVD_elementVE_element
VCF_elementVCD_elementVCE_element
VCF_elementReVCD_elementReVCE_elementRe
VCF_elementImVCD_elementImVCE_elementIm
VPF_elementVPD_elementVPE_element
VPF_elementMagVPD_elementMagVPE_elementMag
VPF_elementArgVPD_elementArgVPE_elementArg
VI_elementVBI_elementVSI_elementVLI_elementVQI_element 
VU_elementVUB_elementVUS_elementVUL_elementVUQ_elementVUI_element
FunctionReturns the value of a vector element
Syntax C/C++#include <VFstd.h>
float VF_element( fVector X, ui pos );
#include <VCFstd.h>
fComplex VCF_element( cfVector X, ui pos );
float VCF_elementRe( cfVector X, ui pos );
float VCF_elementIm( cfVector X, ui pos );
C++ VecObj#include <OptiVec.h>
T vector<T>::element( ui pos );
complex<T> vector<complex<T>>::element( ui pos );
T vector<complex<T>>::elementRe( ui pos );
T vector<complex<T>>::elementIm( ui pos );
Pascal/Delphiuses VFstd;
function VF_element( X:fVector; pos:UIntSize ): Single;
uses VCFstd;
function VCF_element( X:cfVector; pos:UIntSize ): fComplex;
function VCF_elementRe( X:cfVector; pos:UIntSize ): Single;
function VCF_elementIm( X:cfVector; pos:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
float cudaVF_element( fVector d_X, ui pos );
#include <cudaVCFstd.h>
fComplex cudaVCF_element( cfVector d_X, ui pos );
float cudaVCF_elementRe( cfVector d_X, ui pos );
float cudaVCF_elementIm( cfVector d_X, ui pos );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_element( d_X:fVector; pos:UIntSize ): Single;
uses VCFstd;
function cudaVCF_element( d_X:cfVector; pos:UIntSize ): fComplex;
function cudaVCF_elementRe( d_X:cfVector; pos:UIntSize ): Single;
function cudaVCF_elementIm( d_X:cfVector; pos:UIntSize ): Single;
DescriptionThe element at the position pos, i.e. X[pos], is returned.

The complex versions come in three variants:
VCF_element returns the complex element X[pos],
VCF_elementRe returns X[pos].Re,
VCF_elementIm returns X[pos].Im.
These function is used to read elements of dynamically allocated vectors in Delphi and in CUDA. Note that the bracket notation, X[pos] does not work for dynamic OptiVec vectors in Pascal/Delphi; also, it does not work for vectors in CUDA device memory.
Additionally, they have to be used as a work-around for a bug in CLang, where extended-precision vector elements are not correctly accessed via the bracket notation X[pos].
VF_element is "read-only". This means, you c a n n o t write something like
VF_element( X, 4 ) := 5;
The correct function for write access is V?_setElement.

Error handlingnone
Return valueX[pos]
See alsoVF_Pelement,   VF_setElement,   VF_getElement,   VF_accElement,   VF_decElement

 

VF_equ0VD_equ0VE_equ0
VCF_equ0VCD_equ0VCE_equ0
VCF_Reequ0VCD_Reequ0VCE_Reequ0
VCF_Imequ0VCD_Imequ0VCE_Imequ0
VPF_equ0VPD_equ0VPE_equ0
VI_equ0VBI_equ0VSI_equ0VLI_equ0VQI_equ0 
VU_equ0VUB_equ0VUS_equ0VUL_equ0VUQ_equ0VUI_equ0
Function(Re-) initialize a vector with zero.
Syntax C/C++#include <VFstd.h>
void VF_equ0( fVector X, ui size );
void VCF_Reequ0( cfVector X, ui size );
void VCF_Imequ0( cfVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::equ0();
void vector<complex<T>>::Reequ0();
void vector<complex<T>>::Imequ0();
Pascal/Delphiuses VFstd;
procedure VF_equ0( X:fVector; size:UIntSize );
procedure VCF_Reequ0( X:cfVector; size:UIntSize );
procedure VCF_Imequ0( X:cfVector; size:UIntSize );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_equ0( fVector d_X, ui size );
int cudaVCF_Reequ0( cfVector d_X, ui size );
int cudaVCF_Imequ0( cfVector d_X, ui size );
void VFcu_equ0( fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_equ0( d_X:fVector; size:UIntSize ): IntBool;
function cudaVCF_Reequ0( d_X:cfVector; size:UIntSize ): IntBool;
function cudaVCF_Imequ0( d_X:cfVector; size:UIntSize ): IntBool;
procedure VFcu_equ0( h_X:fVector; size:UIntSize );
DescriptionV?_equ0: Xi = 0
VC?_Reequ0: Xi.Re = 0 (Xi.Im remains unchanged)
VC?_Imequ0: Xi.Im = 0 (Xi.Re remains unchanged)
Error handlingnone
Return valuenone
See alsoVF_equ1,   VF_equC,   VF_equV

 

VF_equ1VD_equ1VE_equ1
VCF_equ1VCD_equ1VCE_equ1
VPF_equ1VPD_equ1VPE_equ1
FunctionInitialize a vector with 1.0.
Syntax C/C++#include <VFstd.h>
void VF_equ1( fVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::equ1();
Pascal/Delphiuses VFstd;
procedure VF_equ1( X:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_equ1( fVector d_X, ui size );
void VFcu_equ1( fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_equ1( d_X:fVector; size:UIntSize ): IntBool;
procedure VFcu_equ1( h_X:fVector; size:UIntSize );
DescriptionXi = 1.0
In the cartesian complex versions, the imaginary parts are set to zero. In the polar complex versions, all elements are set to {1.0 @ 0}.
Error handlingnone
Return valuenone
See alsoVF_equ0,   VF_equm1,   VF_equC,   VF_equV

 

VF_equCVD_equCVE_equC
VCF_equCVCD_equCVCE_equC
VPF_equCVPD_equCVPE_equC
VI_equCVBI_equCVSI_equCVLI_equCVQI_equC 
VU_equCVUB_equCVUS_equCVUL_equCVUQ_equCVUI_equC
FunctionInitializes a vector with a constant value.
Syntax C/C++#include <VFstd.h>
void VF_equC( fVector X, ui size, float C );
C++ VecObj#include <OptiVec.h>
void vector<T>::equC( const T& C );
Pascal/Delphiuses VFstd;
procedure VF_equC( X:fVector; size:UIntSize; C:Single );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_equC( fVector d_X, ui size, float C );
int cusdVF_equC( fVector d_X, ui size, float *d_C );
void VFcu_equC( fVector h_X, ui size, float C );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_equC( d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_equC( d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
procedure VFcu_equC( h_X:fVector; size:UIntSize; C:Single );
DescriptionXi = C
Error handlingnone
Return valuenone
See alsoVF_equ0,   VF_equ1,   VF_equV,   VF_comb

 

VF_equm1VD_equm1VE_equm1
VCF_equm1VCD_equm1VCE_equm1
VPF_equm1VPD_equm1VPE_equm1
FunctionInitialize a vector with −1.0.
Syntax C/C++#include <VFstd.h>
void VF_equm1( fVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::equm1();
Pascal/Delphiuses VFstd;
procedure VF_equm1( X:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_equm1( fVector d_X, ui size );
void VFcu_equm1( fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_equm1( d_X:fVector; size:UIntSize ): IntBool;
procedure VFcu_equm1( h_X:fVector; size:UIntSize );
DescriptionXi = −1.0
In the cartesian complex versions, the imaginary parts are set to zero. In the polar complex versions, all elements are set to { 1.0 @ p }.
Error handlingnone
Return valuenone
See alsoVF_equ0,   VF_equ1,   VF_equC,   VF_equV

 

VF_equVVD_equVVE_equV
VCF_equVVCD_equVVCE_equV
VFx_equVVDx_equVVEx_equV
VCFx_equVVCDx_equVVCEx_equV
VPF_equVVPD_equVVPE_equV
VI_equVVBI_equVVSI_equVVLI_equVVQI_equV 
VU_equVVUB_equVVUS_equVVUL_equVVUQ_equVVUI_equV
FunctionCopies one vector to another.
Syntax C/C++#include <VFstd.h>
void VF_equV( fVector Y, fVector X, ui size );
void VFx_equV( fVector Y, fVector X, ui size, float A, float B );
C++ VecObj#include <OptiVec.h>
void vector<T>::equV( const vector<T>& X );
void vector<T>::x_equV( const vector<T>& X, const T& A, const T& B );
Pascal/Delphiuses VFstd;
procedure VF_equV( Y, X:fVector; size:UIntSize );
procedure VFx_equV( Y, X:fVector; size:UIntSize; A, B:Single );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_equV( fVector d_Y, fVector d_X, ui size );
int cudaVFx_equV( fVector d_Y, fVector d_X, ui size, float A, float B );
int cusdVFx_equV( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B );
void VFcu_equV( fVector h_Y, fVector h_X, ui size );
void VFxcu_equV( fVector h_Y, fVector h_X, ui size, float A, float B );
 
int cudaVF_equVhost( fVector d_Y, fVector h_X, ui size );
int VF_equVdevice( fVector h_Y, fVector d_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_equV( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_equV( d_Y, d_X:fVector; size:UIntSize; A, B:Single );
function cusdVFx_equV( d_Y, d_X:fVector; size:UIntSize; d_A, d_B:PSingle );
procedure VFcu_equV( h_Y, h_X:fVector; size:UIntSize );
procedure VFxcu_equV( h_Y, h_X:fVector; size:UIntSize; A, B:Single );
 
function cudaVF_equVhost( d_Y, h_X:fVector; size:UIntSize ): IntBool;
function VF_equVdevice( h_Y, d_X:fVector; size:UIntSize ): IntBool;
Descriptionsimple versions: Yi = Xi
expanded versions: Yi = A * Xi + B

CUDA versions: cudaVF_equVhost and VF_equVdevice transfer vectors from host to device memory and vice versa.

Error handlingnone
Return valuenone
See alsoVF_equ0,   VF_equ1,   VF_equC

 

VF_erfVD_erfVE_erf
VFx_erfVDx_erfVEx_erf
FunctionError function
Syntax C/C++#include <VFmath.h>
int VF_erf( fVector Y, fVector X, ui size );
int VFx_erf( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::erf( const vector<T>& X );
int vector<T>::x_erf( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_erf( Y,X:fVector; size:UIntSize ): IntBool;
function VFx_erf( Y,X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_erf( fVector d_Y, fVector d_X, ui size );
int cudaVFx_erf( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_erf( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_erf( fVector h_Y, fVector h_X, ui size );
int VFxcu_erf( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_erf( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_erf( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_erf( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_erf( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_erf( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = erf( Xi )
expanded versions: Yi = C * erf( A*Xi+B )
Error handlingthis function should be error-proof.
Return valuealways FALSE (0)
See alsoVF_erfc,   VF_Gauss

 

VF_erfcVD_erfcVE_erfc
VFx_erfcVDx_erfcVEx_erfc
FunctionComplementary error function
Syntax C/C++#include <VFmath.h>
int VF_erfc( fVector Y, fVector X, ui size );
int VFx_erfc( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::erfc( const vector<T>& X );
int vector<T>::x_erfc( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_erfc( Y,X:fVector; size:UIntSize ): IntBool;
function VFx_erfc( Y,X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_erfc( fVector d_Y, fVector d_X, ui size );
int cudaVFx_erfc( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_erfc( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_erfc( fVector h_Y, fVector h_X, ui size );
int VFxcu_erfc( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_erfc( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_erfc( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_erfc( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_erfc( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_erfc( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = 1.0 - erf( Xi )
expanded versions: Yi = C * (1.0 - erf( A*Xi+B ))
Error handlingthis function should be error-proof.
Return valuealways FALSE (0)
See alsoVF_erf,   VF_Gauss

 

VF_EuclidVD_EuclidVE_Euclid
FunctionCalculates the Euclidean norm of a vector
Syntax C/C++#include <VFstd.h>
float VF_Euclid( fVector X, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::Euclid();
Pascal/Delphiuses VFstd;
function VF_Euclid( X:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_Euclid( float *h_RetVal, fVector d_X, ui size );
int cusdVF_Euclid( float *d_RetVal, fVector d_X, ui size );
float VFcu_Euclid( fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_Euclid( var h_RetVal:Single; d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_Euclid( d_RetVal:PSingle; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_Euclid( h_X:fVector; size:UIntSize ): Single;
Descriptionnorm = sqrt( sum( Xi2 ) )
The Euclidean norm of a vector is defined as the square-root of the scalar product of the vector with itself.
Error handlingnone (but beware of a possible overflow!)
Return valueThe Euclidean norm is returned
See alsoVF_ssq,   VF_rms,   VF_scalprod,   VF_xprod

 

VF_expVD_expVE_exp
VCF_expVCD_expVCE_exp
VFx_expVDx_expVEx_exp
VCFx_expVCDx_expVCEx_exp
VCF_exptoPVCD_exptoPVCE_exptoP
FunctionExponential function
Syntax C/C++#include <VFmath.h>
int VF_exp( fVector Y, fVector X, ui size );
int VFx_exp( fVector Y, fVector X, ui size, float A, float B, float C );
int VCF_exptoP( pfVector Y, cfVector X, ui size );
C++ VecObj#include <OptiVec.h>
int vector<T>::exp( const vector<T>& X );
int vector<T>::x_exp( const vector<T>& X, const T& A, const T& B, const T& C );
int vector<polar<T>>::exptoP( const vector<complex<T>>& X );
Pascal/Delphiuses VFmath;
function VF_exp( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_exp( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function VCF_exptoP( Y:pfVector; X:cfVector; size:UIntSize ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_exp( fVector d_Y, fVector d_X, ui size );
int cudaVFx_exp( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_exp( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_exp( fVector h_Y, fVector h_X, ui size );
int VFxcu_exp( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_exp( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_exp( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_exp( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_exp( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_exp( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = exp( Xi )
expanded versions: Yi = C * exp( A*Xi+B )
Euler's constant e is raised to the Xi'th power.
For cartesian complex numbers, the result can be stored either in cartesian complex format (VCF_exp), or in polar coordinates (VCF_exptoP).
Variants of the exponential function, like its complement (VF_expc), the hyperbolic functions (e.g. VF_sinh), or the Gaussian distribution (VF_Gauss) are also available; see chapter 4.6.7 about "Exponentials" before using VF_exp for sums or other combinations of exponentials - maybe the desired function already exists.
Error handlingOVERFLOW errors lead to a default result of ±HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_log,   VF_expc,   VF_pow,   VF_powexp,   VF_sinh,   VF_exp2,   VF_Gauss,   VPF_logtoC,   exp

 

VF_exp2VD_exp2VE_exp2
VFx_exp2VDx_exp2VEx_exp2
FunctionExponential function to the basis 2
Syntax C/C++#include <VFmath.h>
int VF_exp2( fVector Y, fVector X, ui size );
int VFx_exp2( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::exp2( const vector<T>& X );
int vector<T>::x_exp2( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_exp2( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_exp2( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_exp2( fVector d_Y, fVector d_X, ui size );
int cudaVFx_exp2( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_exp2( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_exp2( fVector h_Y, fVector h_X, ui size );
int VFxcu_exp2( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_exp2( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_exp2( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_exp2( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_exp2( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_exp2( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = 2 Xi
expanded versions: Yi = C * 2 (A*Xi+B)
Two is raised to the Xi'th power. These function names are used as synonyms for VF_pow2 etc.
Error handlingOVERFLOW errors lead to a default result of ±HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_exp,   VF_exp10,   VF_ipow2,   VF_scale2,   VF_log2

 

VF_exp10VD_exp10VE_exp10
VFx_exp10VDx_exp10VEx_exp10
FunctionExponential function to the basis 10
Syntax C/C++#include <VFmath.h>
int VF_exp10( fVector Y, fVector X, ui size );
int VFx_exp10( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::exp10( const vector<T>& X );
int vector<T>::x_exp10( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_exp10( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_exp10( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_exp10( fVector d_Y, fVector d_X, ui size );
int cudaVFx_exp10( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_exp10( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_exp10( fVector h_Y, fVector h_X, ui size );
int VFxcu_exp10( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_exp10( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_exp10( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_exp10( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_exp10( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_exp10( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = 10 Xi
expanded versions: Yi = C * 10 (A*Xi+B)
Ten is raised to the Xi'th power. These function names are used as synonyms for VF_pow10 etc.
Error handlingOVERFLOW errors lead to a default result of ±HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_exp,   VF_exp2,   VF_ipow10,   VF_scale10,   VF_log10

 

VF_expArbBaseVD_expArbBaseVE_expArbBase
VCF_expArbBaseVCD_expArbBaseVCE_expArbBase
VFx_expArbBaseVDx_expArbBaseVEx_expArbBase
VCFx_expArbBaseVCDx_expArbBaseVCEx_expArbBase
FunctionExponential function of an arbitrary base
Syntax C/C++#include <VFmath.h>
int VF_expArbBase( fVector Y, fVector X, ui size, float Base );
int VFx_expArbBase( fVector Y, fVector X, ui size, float Base, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::expArbBase( const vector<T>& X, const T& Base );
int vector<T>::x_expArbBase( const vector<T>& X, const T& Base, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_expArbBase( Y, X:fVector; size:UIntSize; Base:Single ): IntBool;
function VFx_expArbBase( Y, X:fVector; size:UIntSize; Base, A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_expArbBase( fVector d_Y, fVector d_X, ui size, float Base );
int cusdVF_expArbBase( fVector d_Y, fVector d_X, ui size, float *d_Base );
int cudaVFx_expArbBase( fVector d_Y, fVector d_X, ui size, float Base, float A, float B, float C );
int cusdVFx_expArbBase( fVector d_Y, fVector d_X, ui size, float *d_Base, float *d_A, float *d_B, float *d_C );
int VFcu_expArbBase( fVector h_Y, fVector h_X, ui size, float Base );
int VFxcu_expArbBase( fVector h_Y, fVector h_X, ui size, float Base, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_expArbBase( d_Y, d_X:fVector; size:UIntSize; Base:Single ): IntBool;
function cusdVF_expArbBase( d_Y, d_X:fVector; size:UIntSize; d_Base:PSingle ): IntBool;
function cudaVFx_expArbBase( d_Y, d_X:fVector; size:UIntSize; Base, A, B, C:Single ): IntBool;
function cusdVFx_expArbBase( d_Y, d_X:fVector; size:UIntSize; d_Base, d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_expArbBase( h_Y, h_X:fVector; size:UIntSize; Base:Single ): IntBool;
function VFxcu_expArbBase( h_Y, h_X:fVector; size:UIntSize; Base, A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = Base Xi
expanded versions: Yi = C * Base (A*Xi+B)
Base must be positive and non-zero in the real-number versions. In the complex versions, Base must be non-zero.
Error handlingOVERFLOW errors lead to a default result of ±HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_exp,   VF_pow

 

VF_expcVD_expcVE_expc
VFx_expcVDx_expcVEx_expc
FunctionComplementary exponential function
Syntax C/C++#include <VFmath.h>
int VF_expc( fVector Y, fVector X, ui size );
int VFx_expc( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::expc( const vector<T>& X );
int vector<T>::x_expc( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_expc( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_expc( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_expc( fVector d_Y, fVector d_X, ui size );
int cudaVFx_expc( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_expc( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_expc( fVector h_Y, fVector h_X, ui size );
int VFxcu_expc( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_expc( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_expc( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_expc( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_expc( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_expc( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = 1 - exp( Xi )
expanded versions: Yi = C * (1 - exp [A*Xi + B ])
The difference between 1.0 and the exponential function of Xi is calculated. Note that the expc function is directly available from the 80x87 coprocessor in high accuracy; in fact, it is the exponential function itself that is internally calculated via the expc function. The expc function is often encountered in the natural sciences for the description of decay and growth processes.
Error handlingOVERFLOW errors lead to a default result of ±HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_log,   VF_exp,   VF_pow,   VF_sinh,   VF_exp2,   VF_Gauss,  exp

 

VF_expmx2VD_expmx2VE_expmx2
VFx_expmx2VDx_expmx2VEx_expmx2
FunctionExponential function of the negative square of the argument
Syntax C/C++#include <VFmath.h>
int VF_expmx2( fVector Y, fVector X, ui size );
int VFx_expmx2( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::expmx2( const vector<T>& X );
int vector<T>::x_expmx2( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_expmx2( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_expmx2( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_expmx2( fVector d_Y, fVector d_X, ui size );
int cudaVFx_expmx2( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_expmx2( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_expmx2( fVector h_Y, fVector h_X, ui size );
int VFxcu_expmx2( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_expmx2( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_expmx2( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_expmx2( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_expmx2( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_expmx2( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = exp( −Xi2 )
expanded versions: Yi = C * exp( -(A*Xi+B)2 )
This function yields a bell-shaped curve similar to the Gaussian function.
Error handlingThis function should be error-proof.
Return valuealways FALSE (0)
See alsoVF_log,   VF_exp,   VF_Gauss,   VF_sech2,   VF_Lorentz,   exp

 

VF_FFTVD_FFTVE_FFT
VFb_FFTVDb_FFTVEb_FFT
VF_FFTtoCVD_FFTtoCVE_FFTtoC
VFb_FFTtoCVDb_FFTtoCVEb_FFTtoC
VCF_FFTVCD_FFTVCE_FFT
VCFb_FFTVCDb_FFTVCEb_FFT
FunctionFast Fourier transform
Syntax C/C++#include <VFstd.h>
void VF_FFT( fVector Y, fVector X, ui size, int dir );
void VCF_FFT( cfVector Y, cfVector X, ui size, int dir );
void VF_FFTtoC( cfVector Y, fVector X, ui size );
void VFb_FFT( fVector Y, fVector X, ui size, int dir; fVector Buf );
void VCFb_FFT( cfVector Y, cfVector X, ui size, int dir; cfVector Buf );
void VFb_FFTtoC( cfVector Y, fVector X, ui size; cfVector Buf );
C++ VecObj#include <OptiVec.h>
void vector<T>::FFT( const vector<T>& X, int dir=1 );
void vector<complex<T>>::FFT( const vector<complex<T>>& X, int dir=1 );
void vector<complex<T>>::FFTtoC( const vector<T>& X );
void vector<T>::b_FFT( const vector<T>& X, int dir, vector<T>& Buf );
void vector<complex<T>>::b_FFT( const vector<complex<T>>& X, int dir, vector<complex<T>>& Buf );
void vector<complex<T>>::b_FFTtoC( const vector<T>& X, vector<complex<T>>& Buf );
Pascal/Delphiuses VFstd;
procedure VF_FFT( Y, X:fVector; size:UIntSize; dir:Integer );
procedure VCF_FFT( Y, X:cfVector; size:UIntSize; dir:Integer );
procedure VF_FFTtoC( Y:cfVector; X:fVector; size:UIntSize );
procedure VFb_FFT( Y, X:fVector; size:UIntSize; dir:Integer; Buf: fVector );
procedure VCFb_FFT( Y, X:cfVector; size:UIntSize; dir:Integer; Buf: cfVector );
procedure VFb_FFTtoC( Y:cfVector; X:fVector; size:UIntSize; Buf: cfVector );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_FFT( fVector d_Y, fVector d_X, ui size, int dir );
int cudaVCF_FFT( cfVector d_Y, cfVector d_X, ui size, int dir );
int cudaVF_FFTtoC( cfVector d_Y, fVector d_X, ui size );
void VFcu_FFT( fVector h_Y, fVector h_X, ui size, int dir );
void VCFcu_FFT( cfVector h_Y, cfVector h_X, ui size, int dir );
void VFcu_FFTtoC( cfVector h_Y, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd, VCFstd;
function cudaVF_FFT( d_Y, d_X:fVector; size:UIntSize; dir:Integer ): IntBool;
function cudaVCF_FFT( d_Y, d_X:cfVector; size:UIntSize; dir:Integer ): IntBool;
function cudaVF_FFTtoC( d_Y:cfVector; d_X:fVector; size:UIntSize ): IntBool;
procedure VFcu_FFT( h_Y, h_X:fVector; size:UIntSize; dir:Integer );
procedure VCFcu_FFT( h_Y, h_X:cfVector; size:UIntSize; dir:Integer );
procedure VFcu_FFTtoC( h_Y:cfVector; h_X:fVector; size:UIntSize );
DescriptionThe Fourier transform of X is calculated and stored in Y. A Fast Fourier Transform algorithm is used that requires size to be a power of 2. The forward transform is obtained by setting dir = 1, the inverse (or backward) transform by setting dir = −1. By convention, the inverse transform involves scaling the result by the factor 1.0/size (so as to ensure that the resul of one forward and one backward transform yields – within round-off error – the original vector). Since it is sometimes desirable to skip this implicit scaling, VF_FFT offers the possibility to do so: specify dir = -2 in this case.
Complex version: Both X and the output Y are complex vectors.
Real-to-complex version: The input vector X is real. The output vector is complex. As this function can only perform a forward transform, no argument "dir" is needed.
Purely real version: For the forward transform, X is a real vector. The output Y is also defined as fVector, although it consists of complex numbers. These are packed in a special way such as to fit into the same amount of memory as the original real vector X. The order of storage in Y is indicated in the following table (N=size, U is the uncompressed Fourier Transform of X):
 
Y0Y1Y2 Y3  .....   YN-2YN−1
U0.ReUN/2.ReU1.Re U1.Im  .....   UN/2−1.ReUN/2−1.Im

The reason for this packing is the following. If the size real data points of X represent a function of the time, X = g(t), then the forward transform yields a function U = G(f) in the frequency domain. In principle, U consists of size+1 complex data points: size/2 points for positive frequencies, another size/2 points for negative frequencies, and one point at frequency zero.
For the Fourier Transform of a real vector, the symmetry relation G(-f) = |G(f)|* holds (the asterisc denoting the complex conjugate). This means that the points at negative frequencies need not be stored; all information is already contained in the positive frequency half. Moreover, the zeroth and the size2'th element of the transform are both purely real. Therefore, only these two real and size/2−1 complex data points have to be stored - which exactly fit into the same amount of memory as the original size real data points of X. This allows X to be overwritten by its transform, if desired.

For the real version of the inverse transform, X has to be a complex vector packed in the way just described, and a real-valued vector Y is obtained.

For the Fourier Transform of several vectors of equal size, we recommend to copy the individual vectors into the rows (C/C++) or the columns (Pascal/Delphi) of a matrix and to call MF_Rows_FFT or MF_Cols_FFT, respectively. Depending on the size of the individual vectors, this way is more efficient than the individual processing already from about 4 vectors on.

VFb_FFT, VFb_FFTtoC and VCFb_FFT take a buffer vector Buf as an additional argument. They are slightly more efficient than the un-buffered versions. Buf must have (at least) the same size as X and Y. Additionally, Buf must be 128-bit (P8) or 256-bit (P9) aligned. This usually means you can only take a vector allocated by the VF_vector family as Buf.

Error handlingIf size is not a power of 2, an error message "Size must be an integer power of 2" is generated and the program aborted.
Return valuenone
See alsoVF_filter,   VF_convolve,   VF_autocorr,   VF_xcorr,   VF_spectrum,   VF_xspectrum,   VF_xspectrumAbs,   VF_coherence

 

VF_fhexprintVD_fhexprintVE_fhexprint
VCF_fhexprintVCD_fhexprintVCE_fhexprint
VPF_fhexprintVPD_fhexprintVPE_fhexprint
VI_fhexprintVBI_fhexprintVSI_fhexprintVLI_fhexprintVQI_fhexprint 
VU_fhexprintVUB_fhexprintVUS_fhexprintVUL_fhexprintVUQ_fhexprintVUI_fhexprint
Functionprint a vector in hexadecimal format to a stream
Syntax C/C++#include <VFstd.h>
void VF_fhexprint( FILE *stream, fVector X, ui size, unsigned nperline, unsigned linewidth );
C++ VecObj#include <OptiVec.h>
void vector<T>::fhexprint( FILE *stream, unsigned nperline, unsigned linewidth );
Pascal/Delphiuses VFstd;
procedure VF_fhexprint( var Stream:Text; X:fVector; size:UIntSize; nperline, linewidth:UInt );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_fhexprint( FILE *stream, fVector d_X, ui size, unsigned nperline, unsigned linewidth );
int cudaVF_fhexprint_buf( FILE *stream, fVector d_X, ui size, unsigned nperline, unsigned linewidth, fVector h_Wk );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_fhexprint( var Stream:Text; d_X:fVector; size:UIntSize; nperline, linewidth:UInt ): IntBool;
function cudaVF_fhexprint_buf( var Stream:Text; d_X:fVector; size:UIntSize; nperline, linewidth:UInt; h_Wk:fVector ): IntBool;
Descriptionsize elements of X are written in hexadecimal format to stream, nperline in each line of linewidth characters.

Printing starts always with a new line. This may lead to an empty line at the beginning. Especially the first line of a file is reserved for a possible headline.

Each line begins with the index of the first element printed into that line. The index is followed by a colon and by the requested nperline elements.
Cartesian complex numbers are printed in braces, with the real and imaginary parts separated by a komma: {Re, Im}. Polar complex numbers are also written in braces, with the Mag and Arg parts separated by an at-sign: {Mag @ Arg}.
 

CUDA versions only:cudaV?_fhexprint_buf takes a host vector h_Wk as additional argument. The latter serves as buffer memory and needs to be (at least) of the same size as X. By avoiding the need of cudaV?_fhexprint to allocate its own buffer memory, cudaV?_fhexprint_buf is slightly faster.
 
Error handlingif nperline exceeds the maximum number of entries possible for the linewidth chosen, an error message "Cannot use requested format (too many entries per line)!" is generated; in this case, the program chooses the maximum possible number nperline.
Return valuenone
See alsoVF_fprint,   VF_chexprint,   VF_hexprint,   VF_write,   VF_store,   fhexprintf

 

VF_filterVD_filterVE_filter
VCF_filterVCD_filterVCE_filter
VFb_filterVDb_filterVEb_filter
VCFb_filterVCDb_filterVCEb_filter
FunctionFrequency filtering
Syntax C/C++#include <VFstd.h>
void VF_filter(fVector Y, fVector X, fVector Flt, ui size );
void VFb_filter(fVector Y, fVector X, fVector Flt, ui size, fVector Buf );
C++ VecObj#include <OptiVec.h>
void vector<T>::filter( const vector<T>& X, const vector<T>& Flt );
void vector<T>::b_filter( const vector<T>& X, const vector<T>& Flt, vector<T>& Buf );
Pascal/Delphiuses VFstd;
procedure VF_filter( Y, X, Flt:fVector; size:UIntSize );
procedure VFb_filter( Y, X, Flt:fVector; size:UIntSize; Buf:fVector );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_filter(fVector d_Y, fVector d_X, fVector d_Flt, ui size );
void VFcu_filter(fVector h_Y, fVector h_X, fVector h_Flt, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_filter( d_Y, d_X, d_Flt:fVector; size:UIntSize ): IntBool;
procedure VFcu_filter( h_Y, h_X, h_Flt:fVector; size:UIntSize );
DescriptionA frequency filter Flt is applied to the vector X. Internally, this is done by performing a Fourier transform on X, multiplying the transform with Flt and transforming the product back into the time domain.

Complex versions: X, Y and the filter Flt are complex vectors.
Real versions: X and Y are real. Flt has to be in the packed complex format that is obtained by Fourier transforming a real vector with VF_FFT (see that function for the description of the packed complex format) or by using VF_convolve.

Internally, VF_filter allocates and frees additional workspace memory. For repeated calls, this would be inefficient. In such a case, it is recommended to use VFb_filter instead. The size of Buf must be ≥ size. Additionally, Buf must be 128-bit (P8) or 256-bit (P9) aligned. This usually means you can only take a vector allocated by the VF_vector family as Buf.

For purely real filter functions known analytically, construct your filter by first evaluating it for a real vector of size/2+1 elements, and subsequently copy this real vector into Flt, as in the following example (fNyquist = 0.5 / sampling_interval; the desired cutoff frequency is fCutOff):
 

Example C/C++:float Coeffs[3] = {1.0, 1.4142135, 1.0};
fVector Flt = VF_vector0( size );
fVector RealFlt = VF_vector( size/2+1 );
fVector Freq = VF_vector( size/2+1 );
VF_ramp( Freq, size/2+1, 0, (fNyquist / fCutOff) / (size/2) );
    /* reduced frequencies from 0 to fNyquist / fCutOff */
VF_poly( RealFlt, Freq, size/2+1, Coeffs, 2 );
VF_inv( RealFlt, RealFlt, size/2+1 );
    /*  calc. response from coeffs of this 2nd order filter */
VF_RetoC( (cfVector)Flt, RealFlt, size/2 );
    /* the imaginary elements remain 0 */
Flt[1] = RealFlt[ size/2 ]; /* response at Nyquist frequency */
VF_filter( Y, X, Flt, size ); /* apply the just constructed filter */

 
The same example for Pascal/Delphi:const Coeffs: array[0..2] of Single = (1.0, 1.4142135, 1.0);
var Flt, RealFlt, Freq: fVector;
    size_2: UIntSize;
begin
  ...
  size_2 := size div 2;
  Flt := VF_vector0( size );
  RealFlt := VF_vector( size_2+1 );
  Freq := VF_vector( size_2+1 );
  VF_ramp( Freq, size_2+1, 0, (fNyquist / fCutOff) / (size_2) );
      (* reduced frequencies from 0 to fNyquist / fCutOff *)
  VF_poly( RealFlt, Freq, size_2+1, @Coeffs, 2 );
  VF_inv( RealFlt, RealFlt, size_2+1 );
      (*  calc. response from coeffs of this 2nd order filter *)
  VF_RetoC( cfVector(Flt), RealFlt, size_2 );
      (* the imaginary elements remain 0 *)
  VF_Pelement( Flt, 1 )^ := VF_element( RealFlt, size_2 );
      (* response at Nyquist frequency *)
  VF_filter( Y, X, Flt, size ); (* apply the just constructed filter *)
end;

If X is non-periodic, both ends of the filtered function may be spoiled by wrap-around. See VF_convolve about how to avoid end-effects by embedding X in a larger vector or by removing a possible linear trend.

Error handlingIf size is not a power of 2, VF_FFT (on which VF_filter is based) complains "Size must be an integer power of 2" and the program is aborted.
Return valuenone
See alsoVF_FFT,   VF_convolve,   VF_autocorr,   VF_xcorr,   VF_spectrum,   VF_smooth,   VF_biquad

 

V_findAxes
FunctionCalculate an appropriate scaling and draw a Cartesian coordinate system.
Syntax C/C++#include <Vgraph.h>
void V_findAxes( long double Xmin, long double Xmax, long double Ymin, long double Ymax );
Pascal/Delphiuses Vgraph;
procedure V_findAxes( xmin, xmax, ymin, ymax:Extended );
DescriptionThis function will rarely be called by the user, but is used internally in VF_xyAutoPlot and other plotting functions. According to the x- and y ranges given in the parameters Xmin, Xmax, Ymin and Ymax, a linear Cartesian coordinate system is drawn with ten subdivisions both for the abscissa and the ordinate. If necessary, the x and y ranges are enlarged so as to meet the following conditions:
1. Every subdivision line represents an exact (and not only a rounded) value.
2. If the range of one axis or both includes zero, zero falls exactly on a subdivision line.

If the automatic scaling is not desired, use V_drawAxes instead.
Before calling V_findAxes, the plotting routines have to be initialized by V_initPlot.

Error handlingnone
Return valuenone
See alsoV_drawAxes,   V_initPlot,   VF_xyAutoPlot

 

VF_floorVD_floorVE_floor
VF_floortoIVD_floortoIVE_floortoI
VF_floortoBIVD_floortoBIVE_floortoBI
VF_floortoSIVD_floortoSIVE_floortoSI
VF_floortoLIVD_floortoLIVE_floortoLI
VF_floortoQIVD_floortoQIVE_floortoQI
VF_floortoUVD_floortoUVE_floortoU
VF_floortoUBVD_floortoUBVE_floortoUB
VF_floortoUSVD_floortoUSVE_floortoUS
VF_floortoULVD_floortoULVE_floortoUL
VF_floortoUQVD_floortoUQVE_floortoUQ
VF_floortoUIVD_floortoUIVE_floortoUI
FunctionRounding towards minus infinity
Syntax C/C++#include <VFmath.h>
int VF_floor( fVector Y, fVector X, ui size );
int VF_floortoI( iVector Y, fVector X, ui size );
int VF_floortoLI( liVector Y, fVector X, ui size );
int VF_floortoU( uVector Y, fVector X, ui size );

    (similarly all others)
C++ VecObj#include <OptiVec.h>
int vector<T>::floor( const vector<T>& X );
int vector<int>::floortoI( const vector<T>& X );
int vector<long>::floortoLI( const vector<T>& X );
int vector<unsigned>::floortoU( const vector<T>& X );
Pascal/Delphiuses VFmath;
function VF_floor( Y, X:fVector; size:UIntSize ): IntBool;
function VF_floortoI( Y:iVector; X:fVector; size:UIntSize ): IntBool;
function VF_floortoLI( Y:liVector; X:fVector; size:UIntSize ): IntBool;

    (similarly all others)
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_floor( fVector d_Y, fVector d_X, ui size );
int cudaVF_floortoI( iVector d_Y, fVector d_X, ui size );
int VFcu_floor( fVector h_Y, fVector h_X, ui size );
int VFcu_floortoI( iVector h_Y, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_floor( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVF_floortoI( d_Y:iVector; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_floor( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFcu_floortoI( h_Y:iVector; h_X:fVector; size:UIntSize ): IntBool;
DescriptionEach element of X is rounded to the nearest whole number that is less than or equal to the input number and the result stored in Y. The functions VF_floortoI,   VF_floortoLI,   VF_floortoU, etc. convert the result to the various integer data types (in the cases mentioned, to the types int, long int, or unsigned, respectively).
Error handlingOVERFLOW errors are handled by setting the result to the extreme value possible. Negative numbers in the versions VF_floortoU,   VF_floortoUS,   VF_floortoUL, and VF_floortoUI lead to DOMAIN errors; they are handled by setting the result to 0.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_round,   VF_ceil,   VF_chop,   VF_trunc,   ceil,   floor

 

VF_flush0VD_flush0VE_flush0
VCF_flush0VCD_flush0VCE_flush0
FunctionSets vector elements with an absolute value less than a certain threshold to 0.
Syntax C/C++#include <VFmath.h>
void VF_flush0( fVector Y, fVector X, ui size, float AbsMin );
void VCF_flush0( fVector Y, fVector X, ui size, fComplex AbsMin );
C++ VecObj#include <OptiVec.h>
void vector<T>::flush0( const vector<T>& X, const T& AbsMin );
void vector<T>::flush0( const vector<T>& X, complex<T> AbsMin );
Pascal/Delphiuses VFmath;
procedure VF_flush0( Y, X:fVector; size:UIntSize; AbsMin:Single );
procedure VCF_flush0( Y, X:cfVector; size:UIntSize; AbsMin:fComplex );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_flush0( fVector d_Y, fVector d_X, ui size, float AbsMin );
int cusdVF_flush0( fVector d_Y, fVector d_X, ui size, float *d_AbsMin );
void VFcu_flush0( fVector h_Y, fVector h_X, ui size, float AbsMin );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_flush0( d_Y, d_X:fVector; size:UIntSize; AbsMin:Single ): IntBool;
function cusdVF_flush0( d_Y, d_X:fVector; size:UIntSize; d_AbsMin:PSingle ): IntBool;
procedure VFcu_flush0( h_Y, h_X:fVector; size:UIntSize; AbsMin:Single );
DescriptionYi = Xi, if | Xi | ≥ AbsMin,
Yi = 0, otherwise
The complex versions treat the real and imaginary parts separately, using the real and imaginary parts of AbsMin to determine where to cut. If only the imaginary part is to be edited, set the real part of AbsMin to zero, e.g. (for C/C++):
VCF_flush0( Y, X, size, fcplx( 0, 1.e-6 ));
Error handlingnone
Return valuenone
See alsoVF_limit,   VF_flushInv,   VF_absHuge,   VF_maxC

 

VF_flushInvVD_flushInvVE_flushInv
VCF_flushInvVCD_flushInvVCE_flushInv
FunctionTake the inverse of vector elements with an absolute value larger than a certain threshold, set the result to 0 for those below the threshold
Syntax C/C++#include <VFmath.h>
void VF_flushInv( fVector Y, fVector X, ui size, float AbsMin );
void VCF_flushInv( fVector Y, fVector X, ui size, fComplex AbsMin );
C++ VecObj#include <OptiVec.h>
void vector<T>::flushInv( const vector<T>& X, const T& AbsMin );
void vector<T>::flushInv( const vector<T>& X, complex<T> AbsMin );
Pascal/Delphiuses VFmath;
procedure VF_flushInv( Y, X:fVector; size:UIntSize; AbsMin:Single );
procedure VCF_flushInv( Y, X:cfVector; size:UIntSize; AbsMin:fComplex );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_flushInv( fVector d_Y, fVector d_X, ui size, float AbsMin );
int cusdVF_flushInv( fVector d_Y, fVector d_X, ui size, float *d_AbsMin );
void VFcu_flushInv( fVector h_Y, fVector h_X, ui size, float AbsMin );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_flushInv( d_Y, d_X:fVector; size:UIntSize; AbsMin:Single ): IntBool;
function cusdVF_flushInv( d_Y, d_X:fVector; size:UIntSize; d_AbsMin:PSingle ): IntBool;
procedure VFcu_flushInv( h_Y, h_X:fVector; size:UIntSize; AbsMin:Single );
DescriptionYi = 1.0 / Xi, if | Xi | ≥ AbsMin,
Yi = 0, otherwise.

Complex versions:
Yi = 1.0 / Xi, if | Xi.Re | ≥ AbsMin.Re and | Xi.Im | ≥ AbsMin.Im,
   1.0 / Xi.Re, if | Xi.Re | ≥ AbsMin.Re and | Xi.Im | < AbsMin.Im,
   {0.0, −1.0 / Xi.Im}, if | Xi.Re | < AbsMin.Re and | Xi.Im | ≥ AbsMin.Im,
   0, otherwise.

Error handlingnone
Return valuenone
See alsoVF_flush0,   VF_limit,   VF_absHuge,   VF_maxC

 

VF_fmodCVD_fmodCVE_fmodC
VF_fmodVVD_fmodVVE_fmodV
VFx_fmodVVDx_fmodVVEx_fmodV
FunctionFloating-point modulo division
Syntax C/C++#include <VFmath.h>
void VF_fmodC( fVector Y, fVector X, ui size, float C );
void VF_fmodV( fVector Z, fVector X, fVector Y, ui size );
void VFx_fmodV( fVector Z, fVector X, fVector Y, ui size, float A, float B );
C++ VecObj#include <OptiVec.h>
void vector<T>::fmodC( const vector<T>& X, const T& C );
void vector<T>::fmodV( const vector<T>& X, const vector<T>& Y );
void vector<T>::x_fmodV( const vector<T>& X, const vector<T>& Y, const T& A, const T& B );
Pascal/DelphiThese functions are not defined. Use VF_modC,   VF_modV, etc.
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_fmodC( fVector d_Y, fVector d_X, ui size, float C );
int cusdVF_fmodC( fVector d_Y, fVector d_X, ui size, float *d_C );
int cudaVF_fmodV( fVector d_Z, fVector d_X, fVector d_Y, ui size );
int cudaVFx_fmodV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float A, float B );
int cusdVFx_fmodV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float *d_A, float *d_B );
void VFcu_fmodC( fVector h_Y, fVector h_X, ui size, float C );
void VFcu_fmodV( fVector h_Z, fVector h_X, fVector h_Y, ui size );
void VFxcu_fmodV( fVector h_Z, fVector h_X, fVector h_Y, ui size, float A, float B );
DescriptionThese functions have been included in order to provide consistency with ANSI C function names. They are implemented as macros that call VF_modC,   VF_modV,   VFx_modV etc. See these functions for details.

 

VF_fprintVD_fprintVE_fprint
VCF_fprintVCD_fprintVCE_fprint
VPF_fprintVPD_fprintVPE_fprint
VI_fprintVBI_fprintVSI_fprintVLI_fprintVQI_fprint 
VU_fprintVUB_fprintVUS_fprintVUL_fprintVUQ_fprintVUI_fprint
Functionprint a vector to a stream
Syntax C/C++#include <VFstd.h>
void VF_fprint( FILE *stream, fVector X, ui size, unsigned nperline, unsigned linewidth );
C++ VecObj#include <OptiVec.h>
void vector<T>::fprint( FILE *stream, unsigned nperline, unsigned linewidth );
Pascal/Delphiuses VFstd;
procedure VF_fprint( var Stream:Text; X:fVector; size:UIntSize; nperline, linewidth:UInt );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_fprint( FILE *stream, fVector d_X, ui size, unsigned nperline, unsigned linewidth );
int cudaVF_fprint_buf( FILE *stream, fVector d_X, ui size, unsigned nperline, unsigned linewidth, fVector h_Wk );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_fprint( var Stream:Text; d_X:fVector; size:UIntSize; nperline, linewidth:UInt ): IntBool;
function cudaVF_fprint_buf( var Stream:Text; d_X:fVector; size:UIntSize; nperline, linewidth:UInt; h_Wk:fVector ): IntBool;
Descriptionsize elements of X are written to stream, nperline in each line of linewidth characters.

Printing starts always with a new line. This may lead to an empty line at the beginning. Especially the first line of a file is reserved for a possible headline.

Each line begins with the index of the first element printed into that line. The index is followed by a colon and by the requested nperline elements.
Cartesian complex numbers are printed in braces, with the real and imaginary parts separated by a komma: {Re, Im}. Polar complex numbers are also written in braces, with the Mag and Arg parts separated by an at-sign: {Mag @ Arg}.

In contrast to VF_write and VF_nwrite, it is not possible to override the automatic choice of the format used for printing. The number of digits per element is determined by the available space, which depends in turn on the parameters nperline and linewidth.
 

CUDA versions only:cudaV?_fprint_buf takes a host vector h_Wk as additional argument. The latter serves as buffer memory and needs to be (at least) of the same size as X. By avoiding the need of cudaV?_fprint to allocate its own buffer memory, cudaV?_fprint_buf is slightly faster.
 
GCC Windows specific:In principle, the Windows port of GCC supports the 80-bit floating point type long double. However, the I/O routines rely on the runtime libraries of Visual C++, where 80-bit reals have disappeared a long time ago. This means that VE_fprint, VCE_fprint, and VPE_fprint work only with double precision and, more importantly, within double range. Input numbers outside double range are treated as ±DBL_MAX.
Error handlingif nperline exceeds the maximum number of entries possible for the linewidth chosen, an error message "Cannot use requested format (too many entries per line)!" is generated; in this case, the program chooses the maximum possible number nperline.
Return valuenone
See alsoVF_cprint,   VF_print,   VF_write,   VF_store,   fprintf

 

V_free
FunctionDe-allocate a single vector
Syntax C/C++#include <VecLib.h>
void V_free( void *X );
Pascal/Delphiuses VecLib;
procedure V_free( Ptr:Pointer );
CUDA function C/C++#include <cudaVecLib.h>
int cudaV_free( void *d_X );
CUDA function Pascal/Delphiuses VecLib;
function cudaV_free( d_X:Pointer ): IntBool;
DescriptionThe vector X is freed (i.e. de-allocated). V_free should be used only for the de-allocation of vectors which have previously be allocated by one of the functions of the VF_vector or VF_vector0 family. To free several vectors simultaneously, use V_nfree (C/C++ only).
Error handlingTrying to free a vector that has already been freed, or that has never been allocated memory, leads to a warning message "Cannot free non-existent vector". Program execution is continued without freeing anything in this case.
Return valuenone
See alsoV_nfree,   V_freeAll,   cudaV_pinnedFree,   VF_vector,   VF_vector0

 

V_freeAll
FunctionDe-allocate all vectors (and matrices)
Syntax C/C++#include <VecLib.h>
void V_freeAll( void );
Pascal/Delphiuses VecLib;
procedure V_freeAll;
CUDA function C/C++#include <cudaVecLib.h>
int cudaV_freeAll( void );
CUDA function Pascal/Delphiuses VecLib;
function cudaV_freeAll: IntBool;
DescriptionAll vectors and matrices previously allocated by one of the functions of the VF_vector,   VF_vector0, or MF_matrix families are freed.
Error handlingnone
Return valuenone
See alsoV_free,   V_pinnedFreeAll,   V_nfree,   VF_vector,   VF_vector0

 

VF_frexpVD_frexpVE_frexp
FunctionSplit up the elements of a vector into their mantissa and exponent parts.
Syntax C/C++#include <VFmath.h>
int VF_frexp( fVector Mant, iVector Exp, fVector X, ui size );
C++ VecObj#include <OptiVec.h>
int vector<T>::frexp( vector<int> Exp, const vector<T>& X );
Pascal/DelphiThese functions are not available for Pascal/Delphi;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_frexp( fVector d_Mant, iVector d_Exp, fVector d_X, ui size );
int VFcu_frexp( fVector h_Mant, iVector h_Exp, fVector h_X, ui size );
DescriptionThe function is implemented as a macro calling VF_mantexp; the name VF_frexp is included only to maintain consistency with the ANSI C function name frexp. For details, see VF_mantexp and frexp.

 

VI_fsumVBI_fsumVSI_fsumVLI_fsumVQI_fsum 
VU_fsumVUB_fsumVUS_fsumVUL_fsumVUQ_fsumVUI_fsum
Functionsum of the elements of an integer vector, returned in floating-point
Syntax C/C++#include <VIstd.h>
double VI_fsum( iVector X, ui size );

    (similarly VBI_,   VSI_,   VLI_,   VU_,   VUB_,   VUS_,   VUL_,   VUI_)
extended VQI_fsum( qiVector X, ui size );
C++ VecObj#include <OptiVec.h>
double vector<int>::fsum();
extended vector<quad>::fsum();
Pascal/Delphiuses VIstd;
function VI_fsum( X:iVector; size:UIntSize ): Double;

    (similarly VBI_,   VSI_,   VLI_,   VU_,   VUB_,   VUS_,   VUL_)
function VQI_fsum( X:qiVector; size:UIntSize ): Extended;
CUDA function C/C++#include <cudaVIstd.h>
int cudaVI_fsum( double *h_RetVal, iVector d_X, ui size );
int cusdVI_fsum( double *d_RetVal, iVector d_X, ui size );
double VIcu_fsum( iVector h_X, ui size );
int cudaVQI_fsum( double *h_RetVal, qiVector d_X, ui size );
int cusdVQI_fsum( double *d_RetVal, qiVector d_X, ui size );
double VQIcu_fsum( qiVector h_X, ui size );
CUDA function Pascal/Delphiuses VIstd;
function cudaVI_fsum( var h_RetVal:Double; d_X:iVector; size:UIntSize ): IntBool;
function cusdVI_fsum( d_RetVal:PDouble; d_X:iVector; size:UIntSize ): IntBool;
function VIcu_fsum( h_X:iVector; size:UIntSize ): Double;
function cudaVQI_fsum( var h_RetVal:Double; d_X:qiVector; size:UIntSize ): IntBool;
function cusdVQI_fsum( d_RetVal:PDouble; d_X:qiVector; size:UIntSize ): IntBool;
function VQIcu_fsum( h_X:qiVector; size:UIntSize ): Double;
DescriptionThe elements of X are summed up. In order to avoid possible overflow, the sum is accumulated in a floating-point number. The 8, 16, and 32 bit variants return the result in double precision, whereas the 64 bit variant, VQI_fsum, returns an extended.
Error handlingnone
Return valuethe sum in floating-point format
See alsoVF_sum,   VF_mean

 

V_FtoDV_FtoEV_CFtoCDV_CFtoCE
V_DtoFV_DtoEV_CDtoCFV_CDtoCE
V_EtoFV_EtoDV_CEtoCFV_CEtoCD
FunctionData type interconversions.
Syntax C/C++#include <VDstd.h>
    (always include the <V..std.h> file of the destination data-type!)
void V_FtoD( dVector Y, fVector X, ui size );
    (similarly all other functions of this family)
C++ VecObj#include <OptiVec.h>
void vector<double>::FtoD( const vector<float>& X );
Pascal/Delphiuses VDstd;
    (always include the unit of the destination data-type!)
procedure V_FtoD( Y:dVector; X:fVector; size:UIntSize );
    (similarly all other functions of this family)
CUDA function C/C++#include <cudaVDstd.h>
int cudaV_FtoD( dVector d_Y, fVector d_X, ui size );
void Vcu_FtoD( dVector h_Y, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VDstd;
function cudaV_FtoD( d_Y:dVector; d_X:fVector; size:UIntSize ): IntBool;
procedure Vcu_FtoD( h_Y:dVector; h_X:fVector; size:UIntSize );
DescriptionEach element of X is converted from the data type specified for X to the data type specified for Y and stored in Y.
Error handlingOVERFLOW errors in the course of the "down-conversions" (e.g., V_EtoF); are silently handled: the extreme value possible for the destination data type is stored in Y with the correct sign. _matherr is not called.
Return valuenone
See alsoV_ItoF,   V_roundtoI,   V_roundtoLI

 

VF_GaussVD_GaussVE_Gauss
FunctionGaussian normal distribution function.
Syntax C/C++#include <VFmath.h>
int VF_Gauss( fVector Y, fVector X, ui size, float Wid, float Cent, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::Gauss( const vector<T>& X, T Wid, const T& Cent, const T& C );
Pascal/Delphiuses VFmath;
function VF_Gauss( Y, X:fVector; size:UIntSize; Wid, Cent, C:Single ): IntBool;
CUDA function C/C++#include <cudaVDstd.h>
int cudaVF_Gauss( fVector d_Y, fVector d_X, ui size, float Wid, float Cent, float C );
int cusdVF_Gauss( fVector d_Y, fVector d_X, ui size, float *d_Wid, float *d_Cent, float *d_C );
int VFcu_Gauss( fVector h_Y, fVector h_X, ui size, float Wid, float Cent, float C );
CUDA function Pascal/Delphiuses VDstd;
function cudaVF_Gauss( d_Y, d_X:fVector; size:UIntSize; Wid, Cent, C:Single ): IntBool;
function cusdVF_Gauss( d_Y, d_X:fVector; size:UIntSize; d_Wid, d_Cent, d_C:PSingle ): IntBool;
function VFcu_Gauss( h_Y, h_X:fVector; size:UIntSize; Wid, Cent, C:Single ): IntBool;
DescriptionYi = C / (Wid * sqrt(2*p)) * exp( −0.5*((Xi−Cent) / Wid)2 )
Wid = width of the distribution
Cent = center of the distribution
C is a scaling factor; for C = 1.0, the distribution is normalized.
For Wid = 0, the normal distribution is in fact a delta distribution with Y = C * INF at X = Cent and Y = 0 at all other values of X.
Since infinities are not supported, the existence of a point X = Cent will lead to a SING error in case Wid is zero.
Error handlingSING errors may occur only for a Wid of zero. They are handled with the default result set to ±HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_expmx2,   VF_erf,   VF_sech2,   VF_Lorentz

 

V_getCoordSystem
FunctionStore the scalings and position of the current coordinate system used for VectorLib plotting operations
Syntax C/C++#include <Vgraph.h>
void V_getCoordSystem( VCOORDSYSTEM *csys );
Pascal/Delphiuses Vgraph;
procedure V_getCoordSystem( var csys: VCOORDSYSTEM );
DescriptionIf one wants to "hop" between several coordinate systems, displayed in one and the same window, one has to store the specifications (position and scalings) of each coordinate system separately, using this function.
The address of a struct VCOORDSYSTEM is needed as the argument. VCOORDSYSTEM is defined in <Vgraph.h> (C/C++) or the unit Vgraph (Pascal/Delphi).
Example C/C++VCOORDSYSTEM csys1;
   ....
  /* create the first plot: */
V_setPlotRegion( 0, 0, 339, 200 );
VF_xyAutoPlot( X1, Y1, size1, PS_SOLID, LightGreen );
V_getCoordSystem( &csys1 ); /* store for later */
   /* create the second plot: */
V_setPlotRegion( 340, 0, 679, 200 );
VF_xyAutoPlot( X2, Y2, size2, PS_SOLID, LightRed );
   /* go back to the first plot: */
VF_setCoordSystem( &csys1 );
   /* add an additional DataPlot: */
VF_xyDataPlot( X1, Z1, size1, PS_SOLID, LightBlue );
Example Pascal/Delphivar cxyx1: VCOORDSYSTEM;
begin
   ....
     (* create the first plot: *)
   V_setPlotRegion( 0, 0, 339, 200 );
   VF_xyAutoPlot( X1, Y1, size1, PS_SOLID, LightGreen );
   V_getCoordSystem( csys1 ); (* store for later *)
      (* create the second plot: *)
   V_setPlotRegion( 340, 0, 679, 200 );
   VF_xyAutoPlot( X2, Y2, size2, PS_SOLID, LightRed );
      (* go back to the first plot: *)
   VF_setCoordSystem( csys1 );
      (* add an additional DataPlot: *)
   VF_xyDataPlot( X1, Z1, size1, PS_SOLID, LightBlue );
end;
Return valuenone
See alsoV_setCoordSystem,   V_setPlotRegion,   V_continuePlot

 

V_getCudaWorkspace
FunctionRetrieve the currently used OptiVec for CUDA workspace
Syntax C/C++#include <cudaVecLib.h>
V_CUDAWORKSPACE V_getCudaWorkspace( void );
Delphiuses VecLib;
function V_getCudaWorkspace: V_CUDAWORKSPACE;
DescriptionThe currently used OptiVec for CUDA workspace is retrieved.
Return valueThe current workspace of type V_CUDAWORKSPACE
See alsoCudaOptiVec.htm, Chapter 5. Streams and Workspaces

 

V_getDefaultCudaWorkspace
FunctionRetrieve the default OptiVec for CUDA workspace of the current host thread
Syntax C/C++#include <cudaVecLib.h>
V_CUDAWORKSPACE V_getDefaultCudaWorkspace( void );
Delphiuses VecLib;
function V_getDefaultCudaWorkspace: V_CUDAWORKSPACE;
DescriptionThe default OptiVec for CUDA workspace is retrieved. As described in CudaOptiVec.htm, Chapter 5, the OptiVec for CUDA initialization creates one default workspace for each host thread. V_getDefaultCudaWorkspace can be called to retrieve this default workspace.
Return valueThe default workspace of type V_CUDAWORKSPACE
See alsoCudaOptiVec.htm, Chapter 5. Streams and Workspaces

 

VF_getElementVD_getElementVE_getElement
VCF_getElementVCD_getElementVCE_getElement
VPF_getElementVPD_getElementVPE_getElement
VI_getElementVBI_getElementVSI_getElementVLI_getElementVQI_getElement 
VU_getElementVUB_getElementVUS_getElementVUL_getElementVUQ_getElementVUI_getElement
FunctionCopies a vector element to a specified location
Syntax C/C++#include <VFstd.h>
void VF_getElement( float *y, fVector X, ui pos );
C++ VecObj#include <OptiVec.h>
void vector<T>::getElement( T *y, ui pos );
Pascal/Delphiuses VFstd;
procedure VF_getElement( var y:Single; X:fVector; pos:UIntSize );
CUDA function C/C++#include <cudaVDstd.h>
void cudaVF_getElement( float *y, fVector d_X, ui pos );
void cusdVF_getElement( float *d_y, fVector d_X, ui pos );
CUDA function Pascal/Delphiuses VDstd;
procedure cudaVF_getElement( var y:Single; d_X:fVector; pos:UIntSize );
procedure cusdVF_getElement( d_y:PSingle; d_X:fVector; pos:UIntSize );
DescriptionThe element at the position pos is copied into the location specified by the pointer Y.
Error handlingnone
Return valuenone
See alsoVF_element,   VF_setElement,   VF_Pelement,   VF_accElement,   VF_decElement

 

V_getFPAccuracy
FunctionTest the actual precision the coprocessor is switched to
Syntax C/C++#include <VecLib.h>
unsigned V_getFPAccuracy( void );
Pascal/Delphiuses VecLib;
function V_getFPAccuracy: UInt;
DescriptionThis function reads the FPU Control-Word. If the FPU is set to float / Single precision, 1 is returned. In case of double precision, the return value is 2, and extended precision yields 3. In order to change the coprocessor precision, use the (non-standardized) functions offered by the various compilers, or the OptiVec function V_setFPAccuracy.
Return value1, 2, or 3
See alsoV_setFPAccuracy

 

V_getLibVersion
FunctionQuery version of OptiVec libraries
Syntax C/C++#include <VecLib.h>
const char * V_getLibVersion( void );
Delphiuses VecLib;
function V_getLibVersion: PChar;
DescriptionThe version of the OptiVec libraries, used in a program (base library, processor-specific library, if applicable: cudaOptiVec DLL) is written into a string and returned as the address of that string.
Return valueDescription of the OptiVec libraries linked with a program
Example
  • C/C++:
    printf( "\nOptiVec libraries used: %s", V_getLibVersion() );
  • Pascal / Delphi:
    writeln( 'OptiVec libraries used: ', V_getLibVersion );

 

VF_getRspEditVD_getRspEditVE_getRspEdit
FunctionRead the present threshold for the editing of the filter in VF_convolve and VF_deconvolve
Syntax C/C++#include <VFstd.h>
fComplex VF_getRspEdit( void );
C++ VecObj#include <OptiVec.h>
complex <T> vector<T>::getRspEdit();
Pascal/Delphiuses VFstd;
procedure VF_getRspEdit( var Trunc:fComplex );
CUDA function C/C++#include <cudaVFstd.h>
fComplex cudaVF_getRspEdit( void );
CUDA function Pascal/Delphiuses VDstd;
procedure cudaVF_getRspEdit( var Trunc:fComplex );
DescriptionThe threshold for the treatment of round-off errors in the functions for convolution and deconvolution is returned.
Error handlingnone
Return valuepresent threshold.
real part: acts on the real parts of the filter elements
imaginary part: acts on the imaginary parts of the filter elements
See alsoVF_setRspEdit,   VF_convolve,   VF_deconvolve

 

VF_HannVD_HannVE_Hann
Function"Hann" window for use in spectral analysis
Syntax C/C++#include <VFstd.h>
void VF_Hann( fVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::Hann();
Pascal/Delphiuses VFstd;
procedure VF_Hann( X:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_Hann( fVector d_X, ui size );
void VFcu_Hann( fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_Hann( d_X:fVector; size:UIntSize ): IntBool;
procedure VFcu_Hann( h_X:fVector; size:UIntSize );
DescriptionXi = 0.5 * (1 - cos( 2 p i / (size−1) )).
This function provides a window for power-spectrum estimation with Welch's method of overlapping segments, here implemented as VF_spectrum. The Hann window goes down to zero at the edges. Therefore, it requires a minimum size of 4 elements. Otherwise, X will contain only zeros. For window functions with non-zero values at the edges, see VF_Parzen and VF_Welch.
Error handlingnone
Return valuenone
See alsoVF_Welch,   VF_Parzen,   VF_spectrum

 

VF_hexprintVD_hexprintVE_hexprint
VCF_hexprintVCD_hexprintVCE_hexprint
VI_hexprintVBI_hexprintVSI_hexprintVLI_hexprintVQI_hexprint 
VU_hexprintVUB_hexprintVUS_hexprintVUL_hexprintVUQ_hexprintVUI_hexprint
FunctionPrint a vector in hexadecimal format to stdout. Only for console applications.
Syntax C/C++#include <VFstd.h>
void VF_hexprint( fVector X, ui size, unsigned nperline );
C++ VecObj#include <OptiVec.h>
void vector<T>::hexprint( unsigned nperline );
Pascal/Delphiuses VFstd;
procedure VF_hexprint( X:fVector; size:UIntSize; nperline:UInt );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_hexprint( fVector d_X, ui size, unsigned nperline );
int cudaVF_hexprint_buf( fVector d_X, ui size, unsigned nperline, fVector h_Wk );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_hexprint( d_X:fVector; size:UIntSize; nperline:UInt ): IntBool;
function cudaVF_hexprint_buf( d_X:fVector; size:UIntSize; nperline:UInt; h_Wk:fVector ): IntBool;
Descriptionsize elements of X are printed to stdout in hexadecimal format, nperline in each line. or in the unit VecLib with a default value of 150 characters.
C/C++: The linewidth is determined by the symbolic constant V_consoleWindowWidth, defined in <VecLib.h> with a default value of 150 characters. If you wish to change this default value, either change it in <VecLib.h> or write #define V_consoleWindowWidth xxxx before you #include <VecLib.h>.
Pascal/Delphi: The linewidth is determined by the variable V_consoleWindowWidth in the unit VecLib with a default value of 150 characters. If you wish to change this default value, you may simply assign a new value to V_consoleWindowWidth, e.g., V_consoleWindowWidth := 80;

Each line begins with the index of the first element printed into that line. The index is followed by a colon and by the requested nperline elements.

Cartesian complex numbers are hexprinted in braces, with the real and imaginary parts separated by a komma: {Re, Im}. Polar complex numbers are also written in braces, with the Mag and Arg parts separated by an at-sign: {Mag @ Arg}.

In contrast to VF_chexprint, no paging is performed.

This family of functions can be used only for console applications.

Error handlingIf nperline exceeds the maximum number of entries possible within V_consoleWindowWidth, an error message "Cannot use requested format (too many entries per line)" is generated; in this case, the program chooses the maximum number nperline possible.

CUDA versions only: cudaV?_hexprint_buf takes a host vector h_Wk as additional argument. The latter serves as buffer memory and needs to be (at least) of the same size as X. By avoiding the need of cudaV?_hexprint to allocate its own buffer memory, cudaV?_hexprint_buf is slightly faster.

Return valuenone
See alsoVF_print,   VF_chexprint,   VF_fhexprint,   VF_write,   VF_store,   printf (C/C++ only)

 

VF_hypCVD_hypCVE_hypC
FunctionQuotient of Xi over the sum of Xi and a constant.
Syntax C/C++#include <VFmath.h>
void VF_hypC( fVector Y, fVector X, ui size, float C );
C++ VecObj#include <OptiVec.h>
void vector<T>::hypC( const vector<T>& X, const T& C );
Pascal/Delphiuses VFmath;
procedure VF_hypC( Y, X:fVector; size:UIntSize; C:Single );
CUDA function C/C++#include <cudaVFmath.h>
#include <cudaVDmath.h>
int cudaVF_hypC( fVector d_Y, fVector d_X, ui size, float C );
int cusdVF_hypC( fVector d_Y, fVector d_X, ui size, float *d_C );
void VFcu_hypC( fVector d_Y, fVector d_X, ui size, float C );
CUDA function Pascal/Delphiuses VFmath, VDmath;
function cudaVF_hypC( d_Y, d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_hypC( d_Y, d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
procedure VF_hypC( Y, X:fVector; size:UIntSize; C:Single );
DescriptionYi = hyp( Xi, C ) = Xi / (Xi + C)
The function calculating Yi according to this formula is dubbed "hyp" for its formal similarity to the expression constructing a hyperbola.
Error handlingnone
Return valuenone
See alsoVF_hypV,   VF_redC,   VF_addC,   VF_subC,   VF_divC,   VF_visC

 

VF_hypVVD_hypVVE_hypV
VFx_hypVVDx_hypVVEx_hypV
FunctionQuotient of Xi over the sum of Xi and Yi
Syntax C/C++#include <VFmath.h>
void VF_hypV( fVector Z, fVector X, fVector Y, ui size );
void VFx_hypV( fVector Z, fVector X, fVector Y, ui size, float A, float B );
C++ VecObj#include <OptiVec.h>
void vector<T>::hypV( const vector<T>& X, const vector<T>& Y );
void vector<T>::x_hypV( const vector<T>& X, const vector<T>& Y, const T& A, const T& B );
Pascal/Delphiuses VFmath;
procedure VF_hypV( Z, X, Y:fVector; size:UIntSize );
procedure VFx_hypV( Z, X, Y:fVector; size:UIntSize; A, B:Single );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_hypV( fVector d_Z, fVector d_X, fVector d_Y,ui size );
int cudaVFx_hypV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float A, float B );
int cusdVFx_hypV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float *d_A, float *d_B );
void VFcu_hypV( fVector h_Z, fVector h_X, fVector h_Y,ui size );
void VFxcu_hypV( fVector h_Z, fVector h_X, fVector h_Y, ui size, float A, float B );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_hypV( d_Z, d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cudaVFx_hypV( d_Z, d_X, d_Y:fVector; size:UIntSize; A, B:Single ): IntBool;
function cusdVFx_hypV( d_Z, d_X, d_Y:fVector; size:UIntSize; d_A, d_B:PSingle ): IntBool;
procedure VFcu_hypV( h_Z, h_X, h_Y:fVector; size:UIntSize );
procedure VFxcu_hypV( h_Z, h_X, h_Y:fVector; size:UIntSize; A, B:Single );
Descriptionsimple versions: Zi = hyp( Xi, Yi ) = Xi / (Xi + Yi)
expanded versions: Zi = hyp( A*Xi+B), Yi )
Error handlingnone
Return valuenone
See alsoVF_hypC,   VF_redV,   VF_addV,   VF_subV,   VF_divV,   VF_visV

 

VF_hypotCVD_hypotCVE_hypotC
FunctionPythagoras "hypotenuse" function.
Syntax C/C++#include <VFmath.h>
int VF_hypotC( fVector Y, fVector X, ui size, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::hypotC( const vector<T>& X, const T& C );
Pascal/Delphiuses VFmath;
function VF_hypotC( Y, X:fVector; size:UIntSize; C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_hypotC( fVector d_Y, fVector d_X, ui size, float C );
int cusdVF_hypotC( fVector d_Y, fVector d_X, ui size, float *d_C );
int VFcu_hypotC( fVector d_Y, fVector d_X, ui size, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_hypotC( d_Y, d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_hypotC( d_Y, d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
function VF_hypotC( Y, X:fVector; size:UIntSize; C:Single ): IntBool;
DescriptionYi = sqrt( Xi2 + C2 )
This is a variant of the famous Pythagorean theorem for the hypotenuse of a right triangle.
Error handlingOVERFLOW errors lead to a default result of HUGE_VAL. Unlike the treatment of the ANSI C function hypot by several compilers, only an overflowing final result is regarded as an error. Intermediate overflows (by the calculation of the square) are avoided by appropriate scaling.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_hypotV,   VF_redC,   VF_visC,   VCF_abs,   hypot

 

VF_hypotVVD_hypotVVE_hypotV
VFx_hypotVVDx_hypotVVEx_hypotV
FunctionPythagoras "hypotenuse" function.
Syntax C/C++#include <VFmath.h>
int VF_hypotV( fVector Z, fVector X, fVector Y, ui size );
int VFx_hypotV( fVector Z, fVector X, fVector Y, ui size, float A, float B );
C++ VecObj#include <OptiVec.h>
int vector<T>::hypotV( const vector<T>& X, const vector<T>& Y );
int vector<T>::x_hypotV( const vector<T>& X, const vector<T>& Y, const T& A, const T& B );
Pascal/Delphiuses VFmath;
function VF_hypotV( Z, X, Y:fVector; size:UIntSize ): IntBool;
function VFx_hypotV( Z, X, Y:fVector; size:UIntSize; A, B:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
#include <cudaVCFmath.h>
int cudaVF_hypotV( fVector d_Z, fVector d_X, fVector d_Y,ui size );
int cudaVFx_hypotV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float A, float B );
int cusdVFx_hypotV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float *d_A, float *d_B );
void VFcu_hypotV( fVector h_Z, fVector h_X, fVector h_Y,ui size );
void VFxcu_hypotV( fVector h_Z, fVector h_X, fVector h_Y, ui size, float A, float B );
CUDA function Pascal/Delphiuses VFmath, VCFmath;
function cudaVF_hypotV( d_Z, d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cudaVFx_hypotV( d_Z, d_X, d_Y:fVector; size:UIntSize; A, B:Single ): IntBool;
function cusdVFx_hypotV( d_Z, d_X, d_Y:fVector; size:UIntSize; d_A, d_B:PSingle ): IntBool;
procedure VFcu_hypotV( h_Z, h_X, h_Y:fVector; size:UIntSize );
procedure VFxcu_hypotV( h_Z, h_X, h_Y:fVector; size:UIntSize; A, B:Single );
Descriptionsimple version: Yi = sqrt( Xi2 + Yi2 )
expanded version: Yi = sqrt( (A*Xi+B)2 + Yi2 )
These are variants of the Pythagoras formula for the hypotenuse of a right triangle.
Error handlingOVERFLOW errors lead to a default result of HUGE_VAL. (Intermediate overflows are avoided by appropriate scaling.)
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_redC,   VF_visC,   VCF_abs,   hypot

 

VCF_imagVCD_imagVCE_imag
VPF_imagVPD_imagVPE_imag
FunctionExtracts the imaginary part from a complex vector.
Syntax C/C++#include <VCFstd.h>
void VCF_imag( fVector Im, cfVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::imag( const vector<complex<T>>& X );
Pascal/Delphiuses VCFstd;
procedure VCF_imag( Im:fVector; X:cfVector; size:UIntSize );
CUDA function C/C++#include <cudaVCFstd.h>
int cudaVCF_imag( fVector d_Im, cfVector d_X, ui size );
void VCFcu_imag( fVector h_Im, cfVector h_X, ui size );
CUDA function Pascal/Delphiuses VCFstd;
function cudaVCF_imag( d_Im:fVector; d_X:cfVector; size:UIntSize ): IntBool;
procedure VCFcu_imag( h_Im:fVector; h_X:cfVector; size:UIntSize );
DescriptionIdentical to the VF_CtoIm and VF_PtoIm families. See these functions for details.

 

VF_ImtoCVD_ImtoCVE_ImtoC
FunctionOverwrites the imaginary part of a cartesian-complex vector with a real-valued vector.
Syntax C/C++#include <VCFstd.h>
void VF_ImtoC( cfVector Y, fVector Im, ui size );
C++ VecObj#include <OptiVec.h>
void vector<complex<T>>::ImtoC( const vector<T>& Im );
Pascal/Delphiuses VCFstd;
procedure VF_ImtoC( X:cfVector; Im:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVCFstd.h>
int cudaVF_ImtoC( cfVector d_Y, fVector d_Im, ui size );
void VFcu_ImtoC( cfVector h_Y, fVector h_Im, ui size );
CUDA function Pascal/Delphiuses VCFstd;
function cudaVF_ImtoC( d_X:cfVector; d_Im:fVector; size:UIntSize ): IntBool;
procedure VFcu_ImtoC( h_X:cfVector; h_Im:fVector; size:UIntSize );
DescriptionThe imaginary part of the complex vector Y is overwritten with the elements of the real-valued vector Im. The real part of Y is not affected.
Error handlingnone
Return valuenone
See alsoVF_CtoReIm,   VF_ReImtoC,   VF_RetoC,   VF_CtoIm,   VF_PolartoC

 

VF_indpickVD_indpickVE_indpick
VCF_indpickVCD_indpickVCE_indpick
VPF_indpickVPD_indpickVPE_indpick
VI_indpickVBI_indpickVSI_indpickVLI_indpickVQI_indpick 
VU_indpickVUB_indpickVUS_indpickVUL_indpickVUQ_indpickVUI_indpick
FunctionFill a vector with elements "picked" from another one according to their indices.
Syntax C/C++#include <VFstd.h>
void VF_indpick( fVector Y, uiVector Ind, ui size, fVector X );
C++ VecObj#include <OptiVec.h>
void vector<T>::indpick( const vector<ui>& Ind, const vector<T>& X );
Pascal/Delphiuses VFstd;
procedure VF_indpick( Y:fVector; Ind:uVector; size:UIntSize; X:fVector );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_indpick( fVector d_Y, uiVector d_Ind, ui size, fVector d_X );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_indpick( d_Y:fVector; d_Ind:uVector; size:UIntSize; d_X:fVector ): IntBool;

   (no VFcu_indpick function available - neither for C/C++ nor for Pascal/Delphi!)
DescriptionYi = X[ Indi ],   i=0,..size−1
The vector Y is filled with size elements taken from X according to their indices specified in Ind. The parameter size refers to Y and Ind. The size of X is unimportant, as long as the elements specified in Ind exist.
Error handlingnone
Return valuenone
See alsoVF_indput,   VF_subvector,   VF_sortind

 

VF_indputVD_indputVE_indput
VCF_indputVCD_indputVCE_indput
VPF_indputVPD_indputVPE_indput
VI_indputVBI_indputVSI_indputVLI_indputVQI_indput 
VU_indputVUB_indputVUS_indputVUL_indputVUQ_indputVUI_indput
FunctionDistribute the elements of one vector to the places within another vector specified by their indices.
Syntax C/C++#include <VFstd.h>
void VF_indput( fVector Y, fVector X, uiVector Ind, ui sizex );
C++ VecObj#include <OptiVec.h>
void vector<T>::indput( const vector<T>& X, const vector<ui>& Ind );
Pascal/Delphiuses VFstd;
procedure VF_indput( Y, X:fVector; Ind:uVector; sizex:UIntSize );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_indput( fVector d_Y, fVector d_X, uiVector d_Ind, ui sizex );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_indput( d_Y, d_X:fVector; d_Ind:uVector; sizex:UIntSize ): IntBool;

   (no VFcu_indput function available - neither for C/C++ nor for Pascal/Delphi!)
DescriptionY[ Indi ] = Xi,   i=0,..sizex−1
The sizex elements of X are put into the places of Y according to the indices specified in Ind. The parameter sizex refers to X and Ind. The size of Y is unimportant, as long as the elements specified in Ind exist.
Error handlingnone
Return valuenone
See alsoVF_indpick,   VF_subvector,   VF_sortind

 

VU_indrampVUQ_indrampVUI_indramp
FunctionInitialize each vector element with its index.
Syntax C/C++#include <VUIstd.h>
void VUI_indramp( uiVector X, ui size );

    (similarly VU_)
C++ VecObj#include <OptiVec.h>
void vector<T>::indramp( void );
Pascal/Delphiuses VUIstd;
procedure VUI_indramp( X:uiVector; size:UIntSize );

    (similarly VU_)
CUDA function C/C++#include <cudaVUIstd.h>
int cudaVUI_indramp( uiVector d_X, ui size );
void VUIcu_indramp( uiVector h_X, ui size );
CUDA function Pascal/Delphiuses VUIstd;
function cudaVUI_indramp( d_X:uiVector; size:UIntSize ): IntBool;
procedure VUIcu_indramp( h_X:uiVector; size:UIntSize );
DescriptionXi = i
Each element of X is filled with its index, resulting in a "ramp" 0, 1, 2, 3, ...
For starting values different from 0 or for intervals different from 1, or for other data types than ui / UIntSize, use VF_ramp.
Error handlingnone
Return valuenone
See alsoVF_ramp,   VF_Parzen,   VF_Welch,   VF_equ1,   VF_random

 

V_initMT
FunctionInitialize multi-processor optimized library
Syntax C/C++#include <VecLib.h>
int V_initMT( unsigned nProcCores );
Pascal/Delphiuses VecLib;
function V_initMT( nProcCores:UInt ): IntBool;
DescriptionThis function initializes the multi-processor libraries. It takes the number of processor cores as argument and creates the appropriate number of additional worker threads, so that subsequent OptiVec functions can distribute their work-load over the available processor cores. nProcCores can presently take on values of 2 up to 128. When Intel, AMD or others shall announce the development of systems with even more processor cores, future versions of OptiVec shall make provisions for as many cores as may become available.

On computers with many processor cores (from about 8 or 16 on), one might wish to limit the number of threads which each called OptiVec function may claim for itself. This is especially true, if an application generates several worker threads, and if each (or several) of them calls OptiVec functions. In the interest of a well-balanced use of the processor capacities, call V_limitThreadsPerFunc to set the number of threads available to each call of an OptiVec function. Be, however, rather generous: For example, with 16 cores and 4 application threads, give the OptiVec functions not only 16/4=4, but rather 8 threads each. The OS will take care of optimum scheduling of all these threads.

V_initMT must be called once (and only once), before any of the OptiVec routines present in the multi-processor libraries can be executed. On the other hand, calling V_initMT, when you are using a general-purpose (non-threaded) OptiVec library, does not harm. V_initMT is present as an empty function also in these libraries. Calling it just does not have any effect. Thereby, switching back and forth between the various versions of OptiVec libraries for testing purposes is facilitated.

In case you use V_setFPAccuracy in order to modify the floating-point accuracy of the FPU, be sure that the call to V_initMT stands after the call to V_setFPAccuracy. The reason is that V_initMT creates the additional threads with the same FPU settings as found at the moment when the function is invoked.

nProcCores need not be your actual number of processor cores. For testing purposes, you can enter any of the legal values. Of course, optimum performance will be attained only for the correct value. For applications distributed to others, where you do not have control over the configuration of the systems they will ultimately run on, it is recommended to determine nProcCores either through user input or more elegantly through a system detection routine. Consult the processor documentations by Intel and AMD for details.
Although it is not absolutely necessary, it is recommended that you delete the extra threads by calling V_closeMT at the end of your programme.
V_initMT stores the number of processor cores in the public variable V_nProcCores which is defined as (extern "C") unsigned in C/C++, and as UInt in Delphi. Reading this variable, one can determine if V_initMT has already been called.

MT in DLL'sUsing the multi-processor libraries with DLL's requires some additional thoughts:
  • DLL for distribution to third parties:
    If you do not have control over the main program (.exe) which shall invoke your DLL(s), each DLL you bind with the "M" library must have its own call to V_initMT in its initialization.
  • One or a few DLL's are invoked by your own main program (.exe):
    For simplicity and re-usability of the DLL's, you may proceed as above and call V_initMT in the initialization of each DLL. Then, each DLL will work with its own threads, and the Operating System usually will be able to optimize their scheduling.
  • Simultaneous use of several or many DLL's:
    If you have your own main program (.exe) which calls several or even many DLL's, all of which use OptiVec routines, you should think about keeping the number of threads under control. In this case, two strategies may be employed:
    Either one links the less time-critical DLL's with a "general-purpose" library of OptiVec, and only those DLL's, for which auto-threading really leads to a gain in performance, get linked with an "M" library.
    Or one installs a callback in each of the DLL's, so that the thread handler of the main program is also employed in the DLL's. That is the most efficient, however somewhat cumbersome solution. For that, one has to write and to export a function in each participating DLL:
    • C/C++:
      #include <VecLib.h>

      int V_DLLxxx_setThreadHandler( V_THREADHANDLERFUNC ThreadHandler )
      { return V_setThreadHandler( ThreadHandler ); }

      Here, "DLLxxx" must be a unique marker for each single DLL.

      In the main program then, one calls these functions one after the other for all DLL's:

      int main( ..... )
      {   ....
          V_initMT( nProcCores ); // Initialize threads in main program
          V_DLL001_setThreadHandler( V_threadHandler ); // Install callback in DLL 1
          V_DLL002_setThreadHandler( V_threadHandler ); // Install callback in DLL 2
          // etc. for all DLL's which use OptiVec functions
          ....
      }

    • Pascal/Delphi:
      uses VecLib.h;

      function V_DLLxxx_setThreadHandler( ThreadHandler:V_THREADHANDLERFUNC ): IntBool;
      begin V_DLLxxx_setThreadHandler := V_setThreadHandler( ThreadHandler ); end;

      Here, "DLLxxx" must be a unique marker for each single DLL.

      In the main program then, one calls these functions one after the other for all DLL's:

      begin   ....
          V_initMT( nProcCores ); // Initialize threads in main program
          V_DLL001_setThreadHandler( V_threadHandler ); // Install callback in DLL 1
          V_DLL002_setThreadHandler( V_threadHandler ); // Install callback in DLL 2
          // etc. for all DLL's which use OptiVec functions
          ....
      end.

Return valueFALSE (0), if the threads could be initialized error-free, otherwise TRUE (non-zero).
See alsoV_closeMT,  V_limitThreadsPerFunc,  V_setThreadHandler,  chap. 1.1.2.

 

V_initPlot
FunctionInitialize the global variables used by the plotting functions
Syntax C/C++#include <Vgraph.h>
void V_initPlot( HWND vwindow, HDC vdc );
Delphiuses Vgraph;
procedure V_initPlot( VPaintBox: TPaintBox );
Descriptionvwindow is the handle for a window and vdc the handle of a device context. As long as these handles remain valid, future plotting operations (like VF_xyAutoPlot) will be directed to the window specified by vwindow and use the fonts defined in the device context vdc. Be sure that vwindow and vdc are still valid when a plotting operation is performed; if in doubt, call V_initPlot again.
C++ Builder with OWL: The natural place to call V_initPlot is in the virtual element function Paint. Then, the handle of the actual window is made available as "HWindow" by OWL, and the device context is the same as passed as a parameter to Paint.

Delphi programs:
VPaintBox is the paint box into which you wish to get a VectorLib plot. All future VectorLib plotting operations are directed into this paint box, unless you call V_initPlot again, with a new paint box as parameter.

V_initPlot reserves the rightmost about 2/3 of the screen for following plotting operations, leaving one line empty at the top of the screen and a few lines at the bottom. To override this, call V_setPlotRegion after V_initPlot.

Error handlingnone
Return valuenone
See alsoVF_xyAutoPlot,   V_findAxes,   V_drawAxes,   V_setPlotRegion,   V_initPrint

 

V_initPrint
FunctionInitialize VectorLib plotting functions for use with a printer
Syntax C/C++#include <Vgraph.h>
void V_initPrint( HDC printdc );
Pascal/Delphiuses Vgraph;
procedure V_initPrint( printdc: HDC );
DescriptionThis function tells the VectorLib plotting functions to send their output to the printer context specified as printdc. By default, one whole page is reserved for the printout. To change this, call V_setPlotRegion after V_initPrint.
To switch back to screen output, call V_initPlot.
Error handlingnone
Return valuenone
See alsoV_initPlot,   V_setPlotRegion,   VF_xyAutoPlot

 

VF_insertVD_insertVE_insert
VCF_insertVCD_insertVCE_insert
VPF_insertVPD_insertVPE_insert
VI_insertVBI_insertVSI_insertVLI_insertVQI_insert 
VU_insertVUB_insertVUS_insertVUL_insertVUQ_insertVUI_insert
FunctionInsert 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/Delphiuses 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/Delphiuses 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!)
DescriptionThis 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.)
Error handlingnone
Return valuenone
See alsoVF_delete,   VF_rotate

 

VF_integralCVD_integralCVE_integralC
FunctionIntegral of an array plotted over an equally-spaced abscissa.
Syntax C/C++#include <VFstd.h>
float VF_integralC( fVector X, ui size, float DeltaT );
C++ VecObj#include <OptiVec.h>
T vector<T>::integralC( T DeltaT );
Pascal/Delphiuses VFstd;
function VF_integralC( X:fVector; size:UIntSize; DeltaT:Single ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_integralC( float *h_RetVal, fVector X, ui size, float C );
int cusdVF_integralC( float *d_RetVal, fVector X, ui size, float *d_C );
float VFcu_integralC( fVector X, ui size, float C );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_integralC( var h_RetVal:Single; d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_integralC( d_RetVal:PSingle; d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
function VFcu_integralC( h_X:fVector; size:UIntSize; C:Single ): Single;
DescriptionThe vector X is assumed to be a function of a variable t; the t values themselves are equally spaced, so that only the spacing DeltaT is needed. The area under X, i.e. the integral of X over t from t0 to tsize−1 is calculated. If not only the value of the integral is of interest, but a point-by-point integration has to be performed, VF_runintegralC should be used.
Error handlingnone
Return valueThe value of the integral is returned.
See alsoVF_integralV,   VF_runintegralC,   VF_derivC

 

VF_integralVVD_integralVVE_integralV
FunctionIntegral
Syntax C/C++#include <VFstd.h>
float VF_integralV( fVector X, fVector Y, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::integralV( const vector<T>& X );
Pascal/Delphiuses VFstd;
function VF_integralV( X, Y:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_integralV( float *h_RetVal, fVector X, fVector Y, ui size );
int cusdVF_integralV( float *d_RetVal, fVector X, fVector Y, ui size );
float VFcu_integralV( fVector h_X, fVector h_Y, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_integralV( var h_RetVal:Single; d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cusdVF_integralV( d_RetVal:PSingle; d_X, d_Y:fVector; size:UIntSize ): IntBool;
function VFcu_integralV( h_X, h_Y:fVector; size:UIntSize ): Single;
DescriptionThe vector Y is assumed to be a function of X; the integral of Y over X is calculated. If the elements of X are regularly spaced with a constant difference between them, the integral is obtained more efficiently by VF_integralC. If not only the value of the integral is of interest, but a point-by-point integration has to be performed, VF_runintegralV may be used.
Error handlingnone
Return valueThe value of the integral is returned.
See alsoVF_integralC,   VF_runintegralV,   VF_derivV

 

VF_intfracVD_intfracVE_intfrac
FunctionSplit up the elements of a vector into their integer and fractional parts.
Syntax C/C++#include <VFmath.h>
int VF_intfrac( fVector IntPart, fVector FracPart, fVector X, ui size );
C++ VecObj#include <OptiVec.h>
int vector<T>::intfrac( vector<T> FracPart, const vector<T>& X );
Pascal/Delphiuses VFmath;
function VF_intfrac( IntPart, FracPart, X:fVector; size:UIntSize ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_intfrac( fVector d_IntPart, fVector d_FracPart, fVector d_X, ui size );
int VFcu_intfrac( fVector h_IntPart, fVector h_FracPart, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_intfrac( d_IntPart, d_FracPart, d_X:fVector; size:UIntSize ): IntBool;
function VFcu_intfrac( h_IntPart, h_FracPart, h_X:fVector; size:UIntSize ): IntBool;
DescriptionThe integer parts of the elements of X are stored in IntPart, the fractional parts in FracPart. Notice that IntPart is a floating-point vector, even though it contains integer numbers (which might be larger than could be stored in the integer data types).
Error handlingnone
Return valuealways FALSE (0)
See alsoVF_mantexp,  modf (C/C++ only)

 

VF_invVD_invVE_inv
VFx_invVDx_invVEx_inv
VFu_invVDu_invVEu_inv
VFux_invVDux_invVEux_inv
VCF_invVCD_invVCE_inv
VCFx_invVCDx_invVCEx_inv
VPF_invVPD_invVPE_inv
FunctionInverse (Reciprocal)

int VFu_inv( fVector Y, fVector X, ui size );
int VFux_inv( fVector Y, fVector X, ui size, float A, float B );
Syntax C/C++#include <VFmath.h>
int VF_inv( fVector Y, fVector X, ui size );
int VFx_inv( fVector Y, fVector X, ui size, float A, float B );
C++ VecObj#include <OptiVec.h>
int vector<T>::inv( const vector<T>& X );
int vector<T>::x_inv( const vector<T>& X, const T& A, const T& B );
int vector<T>::u_inv( const vector<T>& X );
int vector<T>::ux_inv( const vector<T>& X, const T& A, const T& B );
Pascal/Delphiuses VFmath;
function VF_inv( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_inv( Y, X:fVector; size:UIntSize; A, B:Single ): IntBool;
function VFu_inv( Y, X:fVector; size:UIntSize ): IntBool;
function VFux_inv( Y, X:fVector; size:UIntSize; A, B:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_inv( fVector d_Y, fVector d_X, ui size );
int cudaVFx_inv( fVector d_Y, fVector d_X, ui size, float A, float B );
int cusdVFx_inv( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B );
int VFcu_inv( fVector h_Y, fVector h_X, ui size );
int VFxcu_inv( fVector h_Y, fVector h_X, ui size, float A, float B );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_inv( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_inv( d_Y, d_X:fVector; size:UIntSize; A, B:Single ): IntBool;
function cusdVFx_inv( d_Y, d_X:fVector; size:UIntSize; d_A, d_B:PSingle ): IntBool;
function VFcu_inv( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_inv( h_Y, h_X:fVector; size:UIntSize; A, B:Single ): IntBool;
Descriptionsimple versions: Yi = 1.0 / Xi
expanded versions: Yi = 1.0 / (A*Xi+B)
Error handlingNormal versions (VF_, VFx_ etc.): SING and OVERFLOW errors lead to a result of ±HUGE_VAL.
Unprotected versions (VFu_, VFux_ etc.): no error handling.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_divrC,   VF_divrV

 

VF_ipowVD_ipowVE_ipow
VFx_ipowVDx_ipowVEx_ipow
VFu_ipowVDu_ipowVEu_ipow
VFux_ipowVDux_ipowVEux_ipow
VCF_ipowVCD_ipowVCE_ipow
VCFx_ipowVCDx_ipowVCEx_ipow
VCFu_ipowVCDu_ipowVCEu_ipow
VCFux_ipowVCDux_ipowVCEux_ipow
VPF_ipowVPD_ipowVPE_ipow
VPFu_ipowVPDu_ipowVPEu_ipow
FunctionRaise each element of a vector to a specified integer power.
Syntax C/C++#include <VFmath.h>
int VF_ipow( fVector Y, fVector X, ui size, int Expo );
int VFx_ipow( fVector Y, fVector X, ui size, int Expo, float A, float B, float C );
int VFu_ipow( fVector Y, fVector X, ui size, int Expo );
int VFux_ipow( fVector Y, fVector X, ui size, int Expo, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::ipow( const vector<T>& X );
int vector<T>::x_ipow( const vector<T>& X, const T& A, const T& B, const T& C );
int vector<T>::u_ipow( const vector<T>& X );
int vector<T>::ux_ipow( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_ipow( Y, X:fVector; size:UIntSize; Expo:Integer ): IntBool;
function VFx_ipow( Y, X:fVector; size:UIntSize; Expo:Integer; A, B, C:Single ): IntBool;
function VFu_ipow( Y, X:fVector; size:UIntSize; Expo:Integer ): IntBool;
function VFux_ipow( Y, X:fVector; size:UIntSize; Expo:Integer; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_ipow( fVector d_Y, fVector d_X, ui size, int Expo );
int cudaVFx_ipow( fVector d_Y, fVector d_X, ui size, int Expo, float A, float B, float C );
int cusdVFx_ipow( fVector d_Y, fVector d_X, ui size, int Expo, float *_dA, float *d_B, float *d_C );
int cudaVFu_ipow( fVector d_Y, fVector d_X, ui size, int Expo );
int cudaVFux_ipow( fVector d_Y, fVector d_X, ui size, int Expo, float A, float B, float C );
int cusdVFux_ipow( fVector d_Y, fVector d_X, ui size, int Expo, float *_dA, float *d_B, float *d_C );
int VFcu_ipow( fVector h_Y, fVector h_X, ui size, int Expo );
int VFxcu_ipow( fVector h_Y, fVector h_X, ui size, int Expo, float A, float B, float C );
int VFucu_ipow( fVector h_Y, fVector h_X, ui size, int Expo );
int VFuxcu_ipow( fVector h_Y, fVector h_X, ui size, int Expo, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_ipow( d_Y, d_X:fVector; size:UIntSize; Expo:Integer ): IntBool;
function cudaVFx_ipow( d_Y, d_X:fVector; size:UIntSize; Expo:Integer; A, B, C:Single ): IntBool;
function cusdVFx_ipow( d_Y, d_X:fVector; size:UIntSize; Expo:Integer; d_A, d_B, d_C:PSingle ): IntBool;
function cudaVFu_ipow( d_Y, d_X:fVector; size:UIntSize; Expo:Integer ): IntBool;
function cudaVFux_ipow( d_Y, d_X:fVector; size:UIntSize; Expo:Integer; A, B, C:Single ): IntBool;
function cusdVFux_ipow( d_Y, d_X:fVector; size:UIntSize; Expo:Integer; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_ipow( h_Y, h_X:fVector; size:UIntSize; Expo:Integer ): IntBool;
function VFxcu_ipow( h_Y, h_X:fVector; size:UIntSize; Expo:Integer; A, B, C:Single ): IntBool;
function VFucu_ipow( h_Y, h_X:fVector; size:UIntSize; Expo:Integer ): IntBool;
function VFuxcu_ipow( h_Y, h_X:fVector; size:UIntSize; Expo:Integer; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = XiExpo
expanded versions: Yi = C * (A*Xi+B)Expo
If Expo is larger than a data-type dependent threshold (which will be a very rare occasion), VF_ipow does not calculate the result itself, but calls VF_pow, which is safer and faster in this case.
The "unprotected" versions (prefix VFu_ and VFux_) do not perform any error handling and do not redirect calls to VF_pow. These simplifications make them very fast, but also risky; they should be used very carefully.
Error handlingSING errors occur, if zero is raised to a negative power; the default result is ±HUGE_VAL, as in the case of OVERFLOW errors.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_pow,   VF_poly,   VF_ratio,   VF_pow2,   VF_exp,  pow

 

VF_ipow10VD_ipow10VE_ipow10
FunctionInteger powers of 10
Syntax C/C++#include <VFmath.h>
int VF_ipow10( fVector Y, iVector X, ui size );
C++ VecObj#include <OptiVec.h>
int vector<T>::ipow10( const vector<T>& X );
Pascal/Delphiuses VFmath;
function VF_ipow10( Y:fVector; X:iVector; size:UIntSize ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_ipow10( fVector d_Y, iVector d_X, ui size );
int VFcu_ipow10( fVector h_Y, iVector h_X, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_ipow10( d_Y:fVector; d_X:iVector; size:UIntSize ): IntBool;
function VFcu_ipow10( h_Y:fVector; h_X:iVector; size:UIntSize ): IntBool;
DescriptionYi = 10Xi
Notice: this function (and not VF_pow10 !) is the vectorized form of the function pow10 defined in Borland C/C++.
Error handlingOVERFLOW errors lead to a default result of HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_pow10,   VF_scale10,   VF_log10,   VF_ipow,   VF_exp,   pow

 

VF_ipow2VD_ipow2VE_ipow2
FunctionInteger powers of 2
Syntax C/C++#include <VFmath.h>
int VF_ipow2( fVector Y, iVector X, ui size );
C++ VecObj#include <OptiVec.h>
int vector<T>::ipow2( const vector<T>& X );
Pascal/Delphiuses VFmath; function VF_ipow2( Y:fVector; X:iVector; size:UIntSize ):
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_ipow2( fVector d_Y, iVector d_X, ui size );
int VFcu_ipow2( fVector h_Y, iVector h_X, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_ipow2( d_Y:fVector; d_X:iVector; size:UIntSize ): IntBool;
function VFcu_ipow2( h_Y:fVector; h_X:iVector; size:UIntSize ): IntBool;
DescriptionYi = 2Xi
Error handlingOVERFLOW errors lead to a default result of HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_pow2,   VF_scale2,   VF_log2,   VF_pow,   VF_exp,   pow

 

VF_iselementCVD_iselementCVE_iselementC
VCF_iselementCVCD_iselementCVCE_iselementC
VPF_iselementCVPD_iselementCVPE_iselementC
VI_iselementCVBI_iselementCVSI_iselementCVLI_iselementCVQI_iselementC 
VU_iselementCVUB_iselementCVUS_iselementCVUL_iselementCVUQ_iselementCVUI_iselementC
FunctionTest if one or more elements of a table are equal to C.
Syntax C/C++#include <VFstd.h>
int VF_iselementC( fVector Tab, ui size, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::iselementC( const T& C );
Pascal/Delphiuses VFstd;
function VF_iselementC( Tab:fVector; size:UIntSize; C:Single ): IntBool;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_iselementC( fVector d_Tab, ui size, float C );
int cusdVF_iselementC( fVector d_Tab, ui size, float *d_C );
int VFcu_iselementC( fVector h_Tab, ui size, float C );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_iselementC( d_Tab:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_iselementC( d_Tab:fVector; size:UIntSize; d_C:PSingle ): IntBool;
function VFcu_iselementC( h_Tab:fVector; size:UIntSize; C:Single ): IntBool;
DescriptionThe vector Tab is searched for the value C. If one or more elements are equal to C, TRUE (+1) is returned, otherwise FALSE (0). No ordering of Tab is assumed and a linear search performed. In contrast to the comparison and counting functions, VF_cmp_eqC, VF_cnt_eqC, +0.0 and –0.0 are treated as different numbers here, as this functions searches for the exact bit-representation given by C.
A related function that finds the table element closest (but not necessarily equal) to C is VF_searchC.
Error handlingnone
Return valueTRUE (+1), if C is an element of X, otherwise FALSE (0).
See alsoVF_searchC,   VF_iselementV,   lfind,   lsearch

 

VF_iselementVVD_iselementVVE_iselementV
VCF_iselementVVCD_iselementVVCE_iselementV
VPF_iselementVVPD_iselementVVPE_iselementV
VI_iselementVVBI_iselementVVSI_iselementVVLI_iselementVVQI_iselementV 
VU_iselementVVUB_iselementVVUS_iselementVVUL_iselementVVUQ_iselementVVUI_iselementV
FunctionTest for each element of a vector, if an identical element is present in a table.
Syntax C/C++#include <VFstd.h>
ui VF_iselementV( fVector Y, fVector X, ui sizex, fVector Tab, ui sizetab );
C++ VecObj#include <OptiVec.h>
ui vector<T>::iselementV( const vector<T>& X, const vector<T>& Tab );
Pascal/Delphiuses VFstd;
function VF_iselementV( Y, X:fVector; sizex:UIntSize; Tab:fVector; sizetab:UIntSize ): UIntSize;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_iselementV( ui *h_nFound, fVector d_Y, fVector d_X, ui sizex, fVector d_Tab, ui sizetab );
ui VFcu_iselementV( fVector h_Y, fVector h_X, ui sizex, fVector h_Tab, ui sizetab );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_iselementV( var h_nFound:UIntSize; d_Y, d_X:fVector; sizex:UIntSize; d_Tab:fVector; sizetab:UIntSize ): IntBool;
function VFcu_iselementV( h_Y, h_X:fVector; sizex:UIntSize; h_Tab:fVector; sizetab:UIntSize ): UIntSize;
DescriptionThe table Tab is searched for each of the elements of X. For those elements of X which are found in Tab, the corresponding element of Y is set to +1 (in the complex versions: {1, 0} ). No ordering of X and Tab is assumed and a linear search for each Xi performed. In contrast to the comparison and counting functions, VF_cmp_eqV, VF_cnt_eqV, +0.0 and –0.0 are treated as different numbers here, as this functions searches for the exact bit-representation given by Tab[i].
A related function that finds the table element closest (but not necessarily equal) to each element of X is VF_searchV.
Error handlingnone
Return valueThe number of elements of X for which an element of Tab was found is returned.
See alsoVF_searchV,   VF_iselementC

 

VF_ismonotonVD_ismonotonVE_ismonoton
FunctionTest if the elements of a vector are monotonously increasing or decreasing
Syntax C/C++#include <VFstd.h>
int VF_ismonoton( fVector X, ui size );
C++ VecObj#include <OptiVec.h>
int vector<T>::ismonoton( const vector<T>& X );
Pascal/Delphiuses VFstd;
function VF_ismonoton( X:fVector; size:UIntSize ): Integer;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_ismonoton( int *h_isSorted, fVector d_X, ui size );
int VFcu_ismonoton( fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_ismonoton( var h_isSorted:Integer; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_ismonoton( h_X:fVector; size:UIntSize ): Integer;
DescriptionThe vector X is analyzed. If the elements are in strict descending order, −1 is returned; if they are either constant or in strict ascending order, +1 is returned. Otherwise the return value is 0. If X contains passages that are increasing as well as passages that remain at a constant value, X is regarded as monotonous only if the increasing passage follows the constant passage, but not the other way round. Thus, the series 0, 0, 0, 1, 2, 3 will be accepted as monotonous (return value +1), whereas the series 1, 2, 3, 4, 4, 4 will not (return value 0). Also the initially constant, then falling series 0, 0, 0, −1, -2, -3 will not be regarded as monotonous.
Error handlingnone
Return value+1 in case of monotonous rise, or if all elements are identical, −1 in case of monotonously falling values, 0 if neither of these conditions is fulfilled.
See alsoVF_sort

 

V_ItoFV_ItoDV_ItoE
V_BItoFV_BItoDV_BItoE
V_SItoFV_SItoDV_SItoE
V_LItoFV_LItoDV_LItoE
V_QItoFV_QItoDV_QItoE
V_UtoFV_UtoDV_UtoE
V_UBtoFV_UBtoDV_UBtoE
V_UStoFV_UStoDV_UStoE
V_ULtoFV_ULtoDV_ULtoE
V_UQtoFV_UQtoDV_UQtoE
V_UItoFV_UItoDV_UItoE
FunctionConvert integer numbers into floating-point data types.
Syntax C/C++#include <VFstd.h>
    (always the include-file belonging to the destination type!)
void V_ItoF( fVector Y, iVector X, ui size );
    (all other functions of this family are similar)
C++ VecObj#include <OptiVec.h>
void vector<float>::ItoF( const vector<int>& Y );
Pascal/Delphiuses VFstd;
    (always the unit belonging to the destination type!)
procedure V_ItoF( Y:fVector; X:iVector; size:UIntSize );
    (all other functions of this family are similar)
CUDA function C/C++#include <cudaVFstd.h>
int cudaV_ItoF( fVector d_Y, iVector d_X, ui size );
void Vcu_ItoF( fVector h_Y, iVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaV_ItoF( d_Y:fVector; d_X:iVector; size:UIntSize ): IntBool;
procedure Vcu_ItoF( h_Y:fVector; h_X:iVector; size:UIntSize );
DescriptionEach element of X is converted from the data type int, byte, short int, long int, quad, unsigned, unsigned byte, unsigned short, unsigned long, or ui, resp., into the data type float, double, or extended, resp., and stored in Y. For the inverse procedure, i.e. the conversion of floating-point numbers to integers, the functions of the VF_roundtoI,   VF_floortoI,   VF_ceiltoI, and VF_choptoI families have to be used.
Error handlingnone
Return valuenone
See alsoVF_roundtoI,   VF_floortoI,   VF_ceiltoI,   VF_choptoI,   VF_trunctoI,   V_ItoLI

 

V_ItoBIV_ItoSIV_ItoLIV_ItoQI
V_BItoIV_BItoSIV_BItoLIV_BItoQI
V_SItoIV_SItoBIV_SItoLIV_SItoQI
V_LItoIV_LItoBIV_LItoSIV_LItoQI
V_QItoIV_QItoBIV_QItoSIV_QItoLI
V_UtoUBV_UtoUSV_UtoULV_UtoUI
V_UBtoUV_UBtoUSV_UBtoULV_UBtoUI
V_UStoUV_UStoUBV_UStoULV_UStoUI
V_ULtoUV_ULtoUBV_ULtoUSV_ULtoUI
V_UItoUV_UItoUBV_UItoUSV_UItoUL
V_ItoUV_BItoUBV_SItoUSV_LItoUL
V_UtoIV_UBtoBIV_UStoSIV_ULtoLI
FunctionInterconversion of the integer data types
Syntax C/C++#include <VLIstd.h>
    (or <VIstd.h>, <VUstd.h>,..., resp., depending on the destination data type!)
void V_ItoLI( liVector Y, iVector X, ui size );
    (all other functions of this family are similar)
C++ VecObj#include <OptiVec.h>
void vector<long>::ItoLI( const vector<long>& Y );
Pascal/Delphiuses VLIstd;
    (always the unit belonging to the destination type!)
procedure V_ItoLI( Y:liVector; X:iVector; size:UIntSize );
    (all other functions of this family are similar)
CUDA function C/C++#include <cudaVLIstd.h>
int cudaV_ItoLI( liVector d_Y, iVector d_X, ui size );
void Vcu_ItoLI( liVector h_Y, iVector h_X, ui size );
CUDA function Pascal/Delphiuses VLIstd;
function cudaV_ItoLI( d_Y:liVector; d_X:iVector; size:UIntSize ): IntBool;
procedure Vcu_ItoLI( h_Y:liVector; h_X:iVector; size:UIntSize );
DescriptionEach element of the vector X is converted into the desired data type and stored in Y.
Error handlingsee chapter 5.2.
Return valuenone
See alsoV_ItoF

 

VF_KeplerVD_KeplerVE_Kepler
VFx_KeplerVDx_KeplerVEx_Kepler
FunctionAngular position of a planet according to Kepler's Second Law
Syntax C/C++#include <VFmath.h>
int VF_Kepler( fVector Y, fVector X, ui size, float T, float e );
int VFx_Kepler( fVector Y, fVector X, ui size, float T, float e, float A, float B );
C++ VecObj#include <OptiVec.h>
int vector<T>::Kepler( const vector<T>& X, T t, T e );
int vector<T>::x_Kepler( const vector<T>& X, T t, T e, const T& A, const T& B );
Pascal/Delphi#include <VFmath.h>
function VF_Kepler( Y, X:fVector; size:UIntSize; T, e:Single ): IntBool;
function VFx_Kepler( Y, X:fVector; size:UIntSize; T, e, A, B:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_Kepler( fVector d_Y, fVector d_X, ui size, float T, float e );
int cusdVF_Kepler( fVector d_Y, fVector d_X, ui size, float *d_T, float *d_e );
int cudaVFx_Kepler( fVector d_Y, fVector d_X, ui size, float T, float e, float A, float B );
int cusdVFx_Kepler( fVector d_Y, fVector d_X, ui size, float *d_T, float *d_e, float *d_A, float *d_B );
int VFcu_Kepler( fVector h_Y, fVector h_X, ui size, float T, float e );
int VFxcu_Kepler( fVector h_Y, fVector h_X, ui size, float T, float e, float A, float B );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_Kepler( d_Y, d_X:fVector; size:UIntSize; T, e:Single ): IntBool;
function cusdVF_Kepler( d_Y, d_X:fVector; size:UIntSize; d_T, d_e:PSingle ): IntBool;
function cudaVFx_Kepler( d_Y, d_X:fVector; size:UIntSize; T, e, A, B:Single ): IntBool;
function cusdVFx_Kepler( d_Y, d_X:fVector; size:UIntSize; d_T, d_e, d_A, d_B:PSingle ): IntBool;
function VFcu_Kepler( h_Y, h_X:fVector; size:UIntSize; T, e:Single ): IntBool;
function VFxcu_Kepler( h_Y, h_X:fVector; size:UIntSize; T, e, A, B:Single ): IntBool;
Descriptionsimple versions: Yi = Kepler( Xi/T, e );
expanded versions: Yi = Kepler( (A*Xi+B)/T, e );
The time-dependent angular position of a planet is calculated from its round-trip time T and its eccentricity e.
T must be non-zero; e may take on values 0 ≤ e ≤ 1. While there is no analytic solution to this problem, described by Johannes Kepler's Second Law, an efficient iterative algorithm is known and is used here. This algorithm is fast and stable up to the hyperbolic limit, e = 1.0.
Rather than treating the problem in terms of the reduced time m = t/T (like it is done in Astronomy textbooks), VF_Kepler expects the real times in X and divides them internally by T.

As there may hardly be any occasions when one might wish to scale the obtained angular position by a constant, no multiplication by C is included in the VFx_ version which, consequently, has only A and B as additional arguments (unlike most of the other "expanded versions" of VectorLib math functions).

This function may not be called while the FPU is set to reduced accuracy, or else it might hang in an infinite loop. See V_setFPAccuracy. As seome versions of Windows (from XP x64 on) automatically reduce the FPU to double precision, a call to the VE_ version should be preceded by a call to V_setFPAccuracy( 3 );

Error handlinge negative or e greater than 1.0 leads to an "Invalid parameter(s)" error. T = 0 leads to all Yi = 0.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)

 

VF_LangevinVD_LangevinVE_Langevin
VFx_LangevinVDx_LangevinVEx_Langevin
FunctionLangevin function of dielectric relaxation
Syntax C/C++#include <VFmath.h>
int VF_Langevin( fVector Y, fVector X, ui size );
int VFx_Langevin( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::Langevin( const vector<T>& X );
int vector<T>::x_Langevin( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphi#include <VFmath.h>
function VF_Langevin( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_Langevin( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_Langevin( fVector d_Y, fVector d_X, ui size );
int cudaVFx_Langevin( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_Langevin( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_Langevin( fVector h_Y, fVector h_X, ui size );
int VFxcu_Langevin( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_Langevin( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_Langevin( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_Langevin( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_Langevin( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_Langevin( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = cot( Xi ) - 1/Xi;
expanded versions: x = A * Xi + B;
                                Yi = C * (cot(x) - 1/x);
The Langevin function has an S-shaped graph and describes, e.g., dielectric relaxation phenomena.
Error handlingThis function should be error-proof.
Return valuealways FALSE (0).

 

VF_ldexpVD_ldexpVE_ldexp
FunctionScale by an integer power of 2.
Syntax C/C++#include <VFmath.h>
int VF_ldexp( fVector Y, fVector X, ui size, int expo );
C++ VecObj#include <OptiVec.h>
int vector<T>::ldexp( const vector<T>& X );
Pascal/DelphiThese functions are absent. Use VF_scale2 etc.
DescriptionThese functions are implemented as alias names for VF_scale2 etc., in order to maintain consistency with the ANSI C function name ldexp. For details, see VF_scale2.

 

VF_limitVD_limitVE_limit
VCF_limitVCD_limitVCE_limit
FunctionLimit the values of the elements of a vector to a specified range.
Syntax C/C++#include <VFmath.h>
void VF_limit( fVector Y, fVector X, ui size, float Min, float Max );
void VCF_limit( cfVector Y, cfVector X, ui size, fComplex Min, fComplex Max );
C++ VecObj#include <OptiVec.h>
void vector<T>::limit( const vector<T>& X, T Min, T Max );
void vector<complex<T>>::limit( const vector<complex<T>>& X, complex<T> Min, complex<T> Max );
Pascal/Delphiuses VFmath;
procedure VF_limit( Y, X:fVector; size:UIntSize; Min, Max:Single );
procedure VCF_limit( Y, X:cfVector; size:UIntSize; Min, Max:fComplex );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_limit( fVector d_Y, fVector d_X, ui size, float Min, float Max );
int cusdVF_limit( fVector d_Y, fVector d_X, ui size, float *d_Min, float *d_Max );
void VFcu_limit( fVector h_Y, fVector h_X, ui size, float Min, float Max );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_limit( d_Y, d_X:fVector; size:UIntSize; Min, Max:Single ): IntBool;
function cusdVF_limit( d_Y, d_X:fVector; size:UIntSize; d_Min, d_Max:PSingle ): IntBool;
procedure VFcu_limit( h_Y, h_X:fVector; size:UIntSize; Min, Max:Single );
DescriptionReal version:
Yi = Xi , if Min ≤ Xi ≤ Max
Yi = Max, if Xi > Max
Yi = Min, if Xi < Min
This function may be seen as a combination of VF_maxC and VF_minC.
Complex version:
Similar to the real version, but the real and imaginary parts are limited separately to the ranges specified in the respective parts of Min and Max.
Error handlingnone
Return valuenone
See alsoVF_maxC,   VF_minC,   VF_min,   VF_flush0,   VF_absHuge

 

V_limitThreadsPerFunc
FunctionLimit the number of threads which each call of an OptiVec function may use for itself in the multi-thread libraries
Syntax C/C++#include <VecLib.h>
int V_limitThreadsPerFunc( unsigned nMaxThreads );
Pascal/Delphiuses VecLib;
function V_limitThreadsPerFunc( nMaxThreads:UInt ): IntBool;
DescriptionAs described for V_initMT, on computers with many processor cores (from about 8 or 16 on), one might wish to limit the number of threads which each called OptiVec function may claim for itself. This is especially true, if an application generates several worker threads, and if each (or several) of them calls OptiVec functions. In the interest of a well-balanced use of the processor capacities, call V_limitThreadsPerFunc to set the number of threads available to each call of an OptiVec function. Be, however, rather generous: For example, with 16 cores and 4 application threads, give the OptiVec functions not only 16/4=4, but rather 8 threads each. The OS will take care of optimum scheduling of all these threads.

V_limitThreadsPerFunc should be called immediately after V_initMT. The number of threads thus set will be valid for all calls to OptiVec functions out of all application threads. In principle, it is possible to call V_limitThreadsPerFunc again to modify that number at some point in the application. Note, however, that V_limitThreadsPerFunc is not thread-safe, and it would be a matter of chance, which function calls would employ the "new" value and for which the "old" one would still be applied.

Return valuealways FALSE(0)
See alsoV_initMT,   V_closeMT, Kap. 1.1.2.

 

VF_lincombVD_lincombVE_lincomb
VCF_lincombVCD_lincombVCE_lincomb
Functionlinear combination of two vectors
Syntax C/C++#include <VFmath.h>
void VF_lincomb( fVector Z, fVector X, fVector Y, ui size, float CX, float CY );
C++ VecObj#include <OptiVec.h>
void vector<T>::lincomb( const vector<T>& X, const vector<T>& Y, const T& CX, const T& CY );
Pascal/Delphiuses VFmath;
procedure VF_lincomb( Z, X, Y:fVector; size:UIntSize; CX, CY:Single );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_lincomb( fVector d_Z, fVector d_X, fVector d_Y, ui size, float CX, float CY );
int cusdVF_lincomb( fVector d_Z, fVector d_X, fVector d_Y, ui size, float *d_CX, float *d_CY );
void VFcu_lincomb( fVector h_Z, fVector h_X, fVector h_Y, ui size, float CX, float CY );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_lincomb( d_Z, d_X, d_Y:fVector; size:UIntSize; CX, CY:Single ): IntBool;
function cusdVF_lincomb( d_Z, d_X, d_Y:fVector; size:UIntSize; d_CX, d_CY:PSingle ): IntBool;
procedure VFcu_lincomb( h_Z, h_X, h_Y:fVector; size:UIntSize; CX, CY:Single );
DescriptionZi = CX * Xi + CY * Yi
Error handlingnone
Return valuenone
See alsoVFx_addV,   VF_rotateCoordinates

 

VF_linregressVD_linregressVE_linregress
FunctionLinear regression
Syntax C/C++#include <VFstd.h>
void VF_linregress( fVector Param, fVector X, fVector Y, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::linregress( const vector<T>& X, const vector<T>& Y );
Pascal/Delphiuses VFstd;
procedure VF_linregress( Param, X, Y:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_linregress( fVector h_Param, fVector d_X, fVector d_Y, ui size );
int cusdVF_linregress( fVector d_Param, fVector d_X, fVector d_Y, ui size );
void VF_linregress( fVector h_Param, fVector h_X, fVector h_Y, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_linregress( h_Param, d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cusdVF_linregress( d_Param, d_X, d_Y:fVector; size:UIntSize ): IntBool;
procedure VFcu_linregress( h_Param, h_X, h_Y:fVector; size:UIntSize );
DescriptionThe X-Y data are fitted to a straight line y = ax + b; the parameters a and b are determined in such a way that the quantity
h2 = sum( (Yi - y(x=Xi) )2 )
is minimized. Uncertainties da and db are also determined. On output, Param is filled with the 5 elements {a, da, b, db, h2} in the order indicated.
Error handlingnone
Return valuenone
See alsoVF_linregresswW,   VF_corrcoeff,   VF_chi2,   VF_linfit,   VF_nonlinfit

 

VF_linregresswWVD_linregresswWVE_linregresswW
FunctionLinear regression with weights
Syntax C/C++#include <VFstd.h>
void VF_linregresswW( fVector Param, fVector X, fVector Y, fVector InvVar, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::linregresswW( const vector<T>& X, const vector<T>& Y, const vector<T>& InvVar );
Pascal/Delphiuses VFstd;
procedure VF_linregresswW( Param, X, Y, InvVar:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_linregresswW( fVector h_Param, fVector d_X, fVector d_Y, fVector d_InvVar, ui size );
int cusdVF_linregresswW( fVector d_Param, fVector d_X, fVector d_Y, fVector d_InvVar, ui size );
void VF_linregresswW( fVector h_Param, fVector h_X, fVector h_Y, fVector h_InvVar, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_linregresswW( h_Param, d_X, d_Y, d_InvVar:fVector; size:UIntSize ): IntBool;
function cusdVF_linregresswW( d_Param, d_X, d_Y, d_InvVar:fVector; size:UIntSize ): IntBool;
procedure VFcu_linregresswW( h_Param, h_X, h_Y, h_InvVar:fVector; size:UIntSize );
DescriptionThe X-Y data are weighted with the inverse of their variances and fitted to a straight line y = ax + b; the parameters a and b are determined in such a way as to minimize the merit function
c2 = sum( (1 / Vari) * (Yi - y(x=Xi) )2 )
(see also VF_chi2). The inverse of the variance of each data point has to be passed to the function in the vector InvVar. Uncertainties da and db are also determined. On output, Param is filled with the 5 elements {a, da, b, db, c2} in the order indicated.
Error handlingnone
Return valuenone
See alsoVF_linregress,   VF_corrcoeff,   VF_chi2

 

V_LItoFV_LItoDV_LItoE
FunctionData type interconversions. See V_ItoF!

 

VF_lnVD_lnVE_ln
VCF_lnVCD_lnVCE_ln
VFx_lnVDx_lnVEx_ln
VCFx_lnVCDx_lnVCEx_ln
VPF_lntoCVPD_lntoCVPE_lntoC
FunctionNatural logarithm
Syntax C/C++#include <VFmath.h>
int VF_ln( fVector Y, fVector X, ui size );
int VFx_ln( fVector Y, fVector X, ui size, float A, float B, float C );
int VPF_lntoC( cfVector Y, pfVector X, ui size );
C++ VecObj#include <OptiVec.h>
int vector<T>::ln( const vector<T>& X );
int vector<T>::x_ln( const vector<T>& X, const T& A, const T& B, const T& C );
int vector<complex<T>>::lntoC( const vector<polar<T>>& X );
Pascal/Delphiuses VFmath;
function VF_ln( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_ln( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function VPF_lntoC( Y:cfVector; X:pfVector; size:UIntSize ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_ln( fVector d_Y, fVector d_X, ui size );
int cudaVFx_ln( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_ln( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_ln( fVector h_Y, fVector h_X, ui size );
int VFxcu_ln( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_ln( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_ln( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_ln( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_ln( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_ln( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
DescriptionThese function names are synonyms for the functions of the VF_log family. See VF_log for details.

 

VF_localmaximaVD_localmaximaVE_localmaxima
FunctionFind the indices of local maxima
Syntax C/C++#include <VFstd.h>
ui VF_localmaxima( uiVector Ind, fVector X, ui size );
C++ VecObj#include <OptiVec.h>
ui vector<ui>::localmaxima( const vector<T>& X );
Pascal/Delphiuses VFstd;
function VF_localmaxima( Ind:uiVector; X:fVector; size:UIntSize ):UIntSize;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_localmaxima( ui *h_nFound, uiVector d_Ind, fVector d_X, ui size );
ui VFcu_localmaxima( uiVector h_Ind, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_localmaxima( var h_nFound:UIntSize; d_Ind:uiVector; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_localmaxima( h_Ind:uiVector; h_X:fVector; size:UIntSize ): UIntSize;
DescriptionThe indices of local maxima in X are stored in Ind and the number of local maxima is returned (this is the number of elements of Ind). A local maximum is defined as one element of X that is greater than both its neighbours to the right and to the left. That means that the zero'th and the last element of X (which have only one neighbour) cannot be local maxima. Also, if two adjacent elements are equal, none of them can be a local maximum.
Error handlingnone
Return valuenumber of local maxima found
See alsoVF_maxind,   VF_max,   VF_indpick,   VF_localminima

 

VF_localminimaVD_localminimaVE_localminima
FunctionFind the indices of local minima
Syntax C/C++#include <VFstd.h>
ui VF_localminima( uiVector Ind, fVector X, ui size );
C++ VecObj#include <OptiVec.h>
ui vector<ui>::localminima( const vector<T>& Ind );
Pascal/Delphiuses VFstd;
function VF_localminima( Ind:uiVector; X:fVector; size:UIntSize ):UIntSize;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_localminima( ui *h_nFound, uiVector d_Ind, fVector d_X, ui size );
ui VFcu_localminima( uiVector h_Ind, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_localminima( var h_nFound:UIntSize; d_Ind:uiVector; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_localminima( h_Ind:uiVector; h_X:fVector; size:UIntSize ): UIntSize;
DescriptionThe indices of local minima in X are stored in Ind and the number of local minima is returned (this is the number of elements of Ind). A local minimum is defined as one element of X that is smaller than both its neighbours to the right and to the left. That means that the zero'th and the last element of X (which have only one neighbour) cannot be local minima. Also, if two adjacent elements are equal, none of them can be a local minimum.
Error handlingnone
Return valuenumber of local minima found
See alsoVF_minind,   VF_min,   VF_indpick,   VF_localmaxima

 

VF_logVD_logVE_log
VCF_logVCD_logVCE_log
VFx_logVDx_logVEx_log
VCFx_logVCDx_logVCEx_log
VPF_logtoCVPD_logtoCVPE_logtoC
FunctionNatural logarithm
Syntax C/C++#include <VFmath.h>
int VF_log( fVector Y, fVector X, ui size );
int VFx_log( fVector Y, fVector X, ui size, float A, float B, float C );
int VPF_logtoC( cfVector Y, pfVector X, ui size );
C++ VecObj#include <OptiVec.h>
int vector<T>::log( const vector<T>& X );
int vector<T>::x_log( const vector<T>& X, const T& A, const T& B, const T& C );
int vector<complex<T>>::logtoC( const vector<polar<T>>& X );
Pascal/Delphiuses VFmath;
function VF_log( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_log( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function VPF_logtoC( Y:cfVector; X:pfVector; size:UIntSize ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_log( fVector d_Y, fVector d_X, ui size );
int cudaVFx_log( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_log( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_log( fVector h_Y, fVector h_X, ui size );
int VFxcu_log( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_log( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_log( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_log( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_log( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_log( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = ln( Xi )
expanded versions: Yi = C * ln( A*Xi+B )
The "logarithmus naturalis", i.e. the logarithm to the basis of Euler's constant e is calculated.
The logarithm of polar complex numbers is most naturally stored in cartesian format, as log{Mag@Arg} = {Mag,Arg}. Therefore, the VPF_ version exists only with the result in a cfVector.
Error handlingReal versions: DOMAIN errors occur in the case of negative Xi (including −0.0), with NAN ("not-a-number") as the default result. SING errors occur for Xi= +0.0 and yield a result of -HUGE_VAL. In the complex version, numbers with an imaginary part of zero are always treated as real numbers; therefore, an argument {0, 0} is treated as a real 0, causing a SING error with the default result {-HUGE_VAL, 0}.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_exp,   VF_log2,   VF_log10,   VF_pow,   log

 

VF_log10VD_log10VE_log10
VCF_log10VCD_log10VCE_log10
VFx_log10VDx_log10VEx_log10
VCFx_log10VCDx_log10VCEx_log10
VPF_log10toCVPD_log10toCVPE_log10toC
FunctionDecadic logarithm
Syntax C/C++#include <VFmath.h>
int VF_log10( fVector Y, fVector X, ui size );
int VFx_log10( fVector Y, fVector X, ui size, float A, float B, float C );
int VPF_log10toC( cfVector Y, pfVector X, ui size );
C++ VecObj#include <OptiVec.h>
int vector<T>::log10( const vector<T>& X );
int vector<T>::x_log10( const vector<T>& X, const T& A, const T& B, const T& C );
int vector<complex<T>>::log10toC( const vector<polar<T>>& X );
Pascal/Delphiuses VFmath;
function VF_log10( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_log10( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function VPF_log10toC( Y:cfVector; X:pfVector; size:UIntSize ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_log10( fVector d_Y, fVector d_X, ui size );
int cudaVFx_log10( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_log10( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_log10( fVector h_Y, fVector h_X, ui size );
int VFxcu_log10( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_log10( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_log10( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_log10( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_log10( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_log10( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = lg( Xi )
expanded versions: Yi = C * lg( A*Xi+B )
The decadic logarithm (to the basis of 10) is calculated.
Error handlingReal versions: DOMAIN errors occur in the case of negative Xi (including −0.0), with NAN ("not-a-number") as the default result. SING errors occur for Xi= +0.0 and yield a result of -HUGE_VAL. In the complex version, numbers with an imaginary part of zero are always treated as real numbers; therefore, an argument {0, 0} is treated as a real 0, causing a SING error with the default result {-HUGE_VAL, 0}.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_pow10,   VF_log,   VF_log2,   VF_pow,   log10 (the latter function is defined in ANSI C; for Pascal, it is available in the unit XMATH coming with OptiVec).

 

VF_log2VD_log2VE_log2
VCF_log2VCD_log2VCE_log2
VFx_log2VDx_log2VEx_log2
VCFx_log2VCDx_log2VCEx_log2
VPF_log2toCVPD_log2toCVPE_log2toC
FunctionBinary logarithm
Syntax C/C++#include <VFmath.h>
int VF_log2( fVector Y, fVector X, ui size );
int VFx_log2( fVector Y, fVector X, ui size, float A, float B, float C );
int VPF_log2toC( cfVector Y, pfVector X, ui size );
C++ VecObj#include <OptiVec.h>
int vector<T>::log2( const vector<T>& X );
int vector<T>::x_log2( const vector<polar<T>>& X, const T& A, const T& B, const T& C );
int vector<complex<T>>::log2toC( const vector<T>& X );
Pascal/Delphiuses VFmath;
function VF_log2( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_log2( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function VPF_log2toC( Y:cfVector; X:pfVector; size:UIntSize ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_log2( fVector d_Y, fVector d_X, ui size );
int cudaVFx_log2( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_log2( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_log2( fVector h_Y, fVector h_X, ui size );
int VFxcu_log2( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_log2( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_log2( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_log2( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_log2( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_log2( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = lb( Xi )
expanded versions: Yi = C * lb( A*Xi+B )
The binary logarithm (to the basis 2) is calculated.
Error handlingReal versions: DOMAIN errors occur in the case of negative Xi (including −0.0), with NAN ("not-a-number") as the default result. SING errors occur for Xi= +0.0 and yield a result of -HUGE_VAL. In the complex version, numbers with an imaginary part of zero are always treated as real numbers; therefore, an argument {0, 0} is treated as a real 0, causing a SING error with the default result {-HUGE_VAL, 0}.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_pow2,   VF_log,   VF_log10,   VF_pow,   log2 (the latter function is neither defined in ANSI C nor in Pascal/Delphi, but an addition contained in <xmath.h> or in the unit XMATH).

 

VF_LorentzVD_LorentzVE_Lorentz
FunctionLorentzian lineshape function
Syntax C/C++#include <VFmath.h>
int VF_Lorentz( fVector Y, fVector X, ui size, float Wid, float Cent, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::Lorentz( const vector<T>& X, T Wid, const T& Cent, const T& C );
Pascal/Delphiuses VFmath;
function VF_Lorentz( Y, X:fVector; size:UIntSize; Wid, Cent, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_Lorentz( fVector d_Y, fVector d_X, ui size, float Wid, float Cent, float C );
int cusdVF_Lorentz( fVector d_Y, fVector d_X, ui size, float *d_Wid, float *d_Cent, float *d_C );
int VFcu_Lorentz( fVector h_Y, fVector h_X, ui size, float Wid, float Cent, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_Lorentz( d_Y, d_X:fVector; size:UIntSize; Wid, Cent, C:Single ): IntBool;
function cusdVF_Lorentz( d_Y, d_X:fVector; size:UIntSize; d_Wid, d_Cent, d_C:PSingle ): IntBool;
function VFcu_Lorentz( h_Y, h_X:fVector; size:UIntSize; Wid, Cent  C:Single ): IntBool;
DescriptionYi = C * Wid2 / ( (Xi - Cent)2 + Wid2 )
Wid = width of the resonance line
Cent = centre of the line
C is a scaling factor; at the center of the line (Xi=Cent), the amplitude Yi equals C. This is even true for a width of zero.
Error handlingThis function should be error-proof.
Return valuealways FALSE (0)
See alsoVF_Gauss,   VF_sech2

 

VF_MagArgtoPVD_MagArgtoPVE_MagArgtoP
FunctionConstruct a polar complex vector from separate vectors for magnitude and argument
Syntax C/C++#include <VPFstd.h>
void VF_MagArgtoP( pfVector Y, fVector Mag, fVector Arg, ui size );
C++ VecObj#include <OptiVec.h>
void vector<polar<T>>::MagArgtoP( const vector<T>& Mag, const vector<T>& Arg );
Pascal/Delphiuses VPFstd;
procedure VF_MagArgtoP( X:pfVector; Mag, Arg:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVPFstd.h>
int cudaVF_MagArgtoP( cfVector d_Y, fVector d_Mag, fVector d_Arg, ui size );
void VFcu_MagArgtoP( cfVector h_Y, fVector h_Mag, fVector h_Arg, ui size );
CUDA function Pascal/Delphiuses VPFstd;
function cudaVF_MagArgtoP( d_X:cfVector; d_Mag, d_Arg:fVector; size:UIntSize ): IntBool;
procedure VFcu_MagArgtoP( h_X:cfVector; h_Mag, h_Arg:fVector; size:UIntSize );
DescriptionThe polar complex vector Y is constructed from the two real vectors Mag and Arg.
Error handlingnone
Return valuenone
See alsoVF_PtoMagArg,   VF_ReImtoC,   VF_MagtoP,   VF_ArgtoP

 

VF_MagArgtoPrincipalVD_MagArgtoPrincipalVE_MagArgtoPrincipal
FunctionConstruct a polar complex vector from separate vectors for magnitude and argument, reducing to the principal value
Syntax C/C++#include <VPFstd.h>
void VF_MagArgtoPrincipal( pfVector Y, fVector Mag, fVector Arg, ui size );
C++ VecObj#include <OptiVec.h>
void vector<polar<T>>::MagArgtoPrincipal( const vector<T>& Mag, const vector<T>& Arg );
Pascal/Delphiuses VPFstd;
procedure VF_MagArgtoPrincipal( X:pfVector; Mag, Arg:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVPFstd.h>
int cudaVF_MagArgtoPrincipal( cfVector d_Y, fVector d_Mag, fVector d_Arg, ui size );
void VFcu_MagArgtoPrincipal( cfVector h_Y, fVector h_Mag, fVector h_Arg, ui size );
CUDA function Pascal/Delphiuses VPFstd;
function cudaVF_MagArgtoPrincipal( d_X:cfVector; d_Mag, d_Arg:fVector; size:UIntSize ): IntBool;
procedure VFcu_MagArgtoPrincipal( h_X:cfVector; h_Mag, h_Arg:fVector; size:UIntSize );
DescriptionThe polar complex vector Y is constructed from the two real vectors Mag and Arg. The arguments are reduced to the principal value, -p < Arg ≤ +p
Error handlingnone
Return valuenone
See alsoVPF_principal,   VF_MagArgtoP

 

VF_MagtoPVD_MagtoPVE_MagtoP
FunctionOverwrite the Mag part of a polar complex vector with a real vector
Syntax C/C++#include <VPFstd.h>
void VF_MagtoP( pfVector Y, fVector Mag, ui size );
C++ VecObj#include <OptiVec.h>
void vector<polar<T>>::MagtoP( const vector<T>& Mag );
Pascal/Delphiuses VPFstd;
procedure VF_MagtoP( X:pfVector; Mag:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVPFstd.h>
int cudaVF_MagtoP( pfVector d_Y, fVector d_Mag, ui size );
void VFcu_MagtoP( pfVector h_Y, fVector h_Mag, ui size );
CUDA function Pascal/Delphiuses VPFstd;
function cudaVF_MagtoP( d_X:pfVector; d_Mag:fVector; size:UIntSize ): IntBool;
procedure VFcu_MagtoP( h_X:pfVector; h_Mag:fVector; size:UIntSize );
DescriptionThe Mag part of the polar complex vector Y is overwritten with the elements of the real-valued vector Mag. The Arg part of Y is not affected.
Error handlingnone
Return valuenone
See alsoVF_PtoMagArg,   VF_MagArgtoP,   VF_ArgtoP

 

VF_mantexpVD_mantexpVE_mantexp
FunctionSplit up the elements of a vector into their mantissa and exponent parts
Syntax C/C++#include <VFmath.h>
int VF_mantexp( fVector MantPart, iVector ExpPart, fVector X, ui size );
C++ VecObj#include <OptiVec.h>
int vector<T>::mantexp( vector<int> ExpPart, const vector<T>& X );
Pascal/Delphiuses VFmath;
function VF_mantexp( MantPart:fVector; ExpPart:iVector; X:fVector; size:UIntSize ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_mantexp( fVector d_MantPart, iVector d_ExpPart, fVector d_X, ui size );
int VFcu_mantexp( fVector h_MantPart, iVector h_ExpPart, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_mantexp( d_MantPart:fVector; d_ExpPart:iVector; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_mantexp( h_MantPart:fVector; h_ExpPart:iVector; h_X:fVector; size:UIntSize ): IntBool;
DescriptionThe elements of X are split up into their mantissa, stored in MantPart, and exponent, stored as ints in ExpPart.
Error handlingnone
Return valuealways FALSE (0)
See alsoVF_scale2,   VF_intfrac,   frexp (only C/C++),  ldexp (only C/C++)

 

VF_maxVD_maxVE_max
VI_maxVBI_maxVSI_maxVLI_maxVQI_max 
VU_maxVUB_maxVUS_maxVUL_maxVUQ_maxVUI_max
FunctionFind the largest element of a vector.
Syntax C/C++#include <VFstd.h>
float VF_max( fVector X, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::_max();
Pascal/Delphiuses VFstd;
function VF_max( X:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_max( float *h_RetVal, fVector d_X, ui size );
int cusdVF_max( float *d_RetVal, fVector d_X, ui size );
float VFcu_max( fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_max( var h_RetVal:Single; d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_max( d_RetVal:PSingle; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_max( h_X:fVector; size:UIntSize ): Single;
DescriptionThe vector X is searched for its largest element, whose value is returned. In order to avoid confusion with the macro "max" in C/C++, the VecObj version of this function is written with a leading underbar as "_max".
Error handlingnone
Return valuemaximum value encountered.
See alsoVF_min,   VF_minmax,   VF_min_max_mean_stddev,   VF_absmax,   VF_maxexp,   VF_runmax,   VF_maxind

 

VF_maxCVD_maxCVE_maxC
VI_maxCVBI_maxCVSI_maxCVLI_maxCVQI_maxC 
VU_maxCVUB_maxCVUS_maxCVUL_maxCVUQ_maxCVUI_maxC
FunctionCompare each element of a vector to a constant and take the larger of the two.
Syntax C/C++#include <VFmath.h>
void VF_maxC( fVector Y, fVector X, ui size, float C );
C++ VecObj#include <OptiVec.h>
void vector<T>::maxC( const vector<T>& X, const T& C );
Pascal/Delphiuses VFmath;
procedure VF_maxC( Y, X:fVector; size:UIntSize; C:Single );
CUDA function C/C++#include <cudaVFmath.h>
#include <cudaVDmath.h>
int cudaVF_maxC( fVector d_Y, fVector d_X, ui size, float C );
int cusdVF_maxC( fVector d_Y, fVector d_X, ui size, float *d_C );
void VFcu_maxC( fVector d_Y, fVector d_X, ui size, float C );
CUDA function Pascal/Delphiuses VFmath, VDmath;
function cudaVF_maxC( d_Y, d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_maxC( d_Y, d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
procedure VF_maxC( Y, X:fVector; size:UIntSize; C:Single );
DescriptionYi = Xi, if Xi > C
Yi = C, if Xi ≤ C
Error handlingnone
Return valuenone
See alsoVF_maxV,   VF_minC,   VF_max,   VF_absmax,   VF_limit,   VF_flush0

 

VF_maxdevCVD_maxdevCVE_maxdevC
FunctionMaximum absolute deviation from a reference.
Syntax C/C++#include <VFstd.h>
float VF_maxdevC( fVector X, ui size, float C );
C++ VecObj#include <OptiVec.h>
T vector<T>::maxdevC( const T& C );
Pascal/Delphiuses VFstd;
function VF_maxdevC( X:fVector; size:UIntSize; C:Single ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_maxdevC( float *h_RetVal, fVector d_X, ui size, float C );
int cusdVF_maxdevC( float *d_RetVal, fVector d_X, ui size, float *d_C );
float VFcu_maxdevC( fVector h_X, ui size, float C );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_maxdevC( var h_RetVal:Single; d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_maxdevC( d_RetVal:PSingle; d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
function VFcu_maxdevC( h_X:fVector; size:UIntSize; C:Single ): Single;
DescriptionmaxdevC = max( |Xi - C| )
Error handlingnone
Return valuemaximum absolute deviations.
See alsoVF_maxreldevC,   VF_maxdevV,   VF_maxinddevC,   VF_sumdevC,   VF_avdevC

 

VF_maxdevVVD_maxdevVVE_maxdevV
FunctionMaximum absolute deviations of the elements of one vector from the corresponding elements of another
Syntax C/C++#include <VFstd.h>
float VF_maxdevV( fVector X, fVector Y, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::maxdevV( const vector<T>& Y );
Pascal/Delphiuses VFstd;
function VF_maxdevV( X, Y:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_maxdevV( float *h_RetVal, fVector X, fVector Y, ui size );
int cusdVF_maxdevV( float *d_RetVal, fVector X, fVector Y, ui size );
float VFcu_maxdevV( fVector h_X, fVector h_Y, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_maxdevV( var h_RetVal:Single; d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cusdVF_maxdevV( d_RetVal:PSingle; d_X, d_Y:fVector; size:UIntSize ): IntBool;
function VFcu_maxdevV( h_X, h_Y:fVector; size:UIntSize ): Single;
DescriptionmaxdevV = max( |Xi - Yi| )
Error handlingnone
Return valuemaximum absolute deviation.
See alsoVF_maxreldevV,   VF_maxdevC,   VF_maxinddevV,   VF_reldevV,   VF_sumdevV,   VF_avdevV,   VF_ssqdevV

 

VF_maxexpVD_maxexpVE_maxexp
FunctionLargest exponent within one vector
Syntax C/C++#include <VFstd.h>
int VF_maxexp( fVector X, ui size );

    (similarly VD_,   VE_)
C++ VecObj#include <OptiVec.h>
int vector<T>::maxexp();
Pascal/Delphiuses VFstd;
function VF_maxexp( X:fVector; size:UIntSize ): Integer;

    (similarly VD_,   VE_)
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_maxexp( int *h_RetVal, fVector d_X, ui size );
int cusdVF_maxexp( int *d_RetVal, fVector d_X, ui size );
int VFcu_maxexp( fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_maxexp( var h_RetVal:Integer; d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_maxexp( d_RetVal:PInteger; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_maxexp( h_X:fVector; size:UIntSize ): Integer;
DescriptionConsidering that each number can be represented as a product, mantissa * 2exponent, where 1.0 ≤ mantissa < 2.0, the largest exponent occurring in a vector is returned. If the vector consisted of nothing but zeros, the exponent is returned as -231 (32-bit models) or -215 (16-bit models).
Error handlingnone
Return valuemaximum exponent encountered.
See alsoVF_minexp,   VF_max,   VF_absmax,   VF_runmax,   VF_absmaxind

 

VF_maxindVD_maxindVE_maxind
VI_maxindVBI_maxindVSI_maxindVLI_maxindVQI_maxind 
VU_maxindVUB_maxindVUS_maxindVUL_maxindVUQ_maxindVUI_maxind
FunctionFind the largest element of a vector and its index.
Syntax C/C++#include <VFstd.h>
float VF_maxind( ui *Ind, fVector X, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::maxind( ui *Ind );
Pascal/Delphiuses VFstd;
function VF_maxind( var Ind:UIntSize; X:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_maxind( float *h_RetVal, ui *h_Ind, fVector d_X, ui size );
int cusdVF_maxind( float *d_RetVal, ui *h_Ind, fVector d_X, ui size );
float VFcu_maxind( ui *h_Ind, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_maxind( var h_RetVal:Single; var h_Ind:UIntSize; d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_maxind( d_RetVal:PSingle; var h_Ind:UIntSize; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_maxind( var h_Ind:UIntSize; h_X:fVector; size:UIntSize ): Single;
DescriptionThe vector X is searched for its largest element; its value is returned. At the address passed as Ind, the index of this element is stored.In the case of several maxima of equal height, the first one is chosen (i.e., the smallest index is stored in Ind).
Error handlingnone
Return valuemaximum value encountered.
See alsoVF_max,   VF_minind,   VF_absmax,   VF_runmax

 

VF_maxinddevCVD_maxinddevCVE_maxinddevC
FunctionMaximum absolute deviation from a reference and its index.
Syntax C/C++#include <VFstd.h>
float VF_maxinddevC( ui *Ind, fVector X, ui size, float C );
C++ VecObj#include <OptiVec.h>
T vector<T>::maxinddevC( ui *Ind, const T& C );
Pascal/Delphiuses VFstd;
function VF_maxinddevC( var Ind:UIntSize; X:fVector; size:UIntSize; C:Single ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_maxinddevC( float *h_RetVal, ui *h_Ind, fVector d_X, ui size, float C );
int cusdVF_maxinddevC( float *d_RetVal, ui *h_Ind, fVector d_X, ui size, float *d_C );
float VFcu_maxinddevC( ui *Ind, fVector h_X, ui size, float C );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_maxinddevC( var h_RetVal:Single; var h_Ind:UIntSize; d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_maxinddevC( d_RetVal:PSingle; var h_Ind:UIntSize; d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
function VFcu_maxinddevC( var Ind:UIntSize; h_X:fVector; size:UIntSize; C:Single ): Single;
DescriptionmaxdevC = max( |Xi - C| ).
The maximum deviation encountered is returned and its index i stored at the address given by the argument Ind.
Error handlingnone
Return valuemaximum absolute deviation.
See alsoVF_maxindreldevC,   VF_maxinddevV,   VF_maxdevC,   VF_sumdevC,   VF_avdevC

 

VF_maxinddevVVD_maxinddevVVE_maxinddevV
FunctionMaximum absolute deviation of the elements of one vector from the corresponding elements of another and its index
Syntax C/C++#include <VFstd.h>
float VF_maxinddevV( ui *Ind, fVector X, fVector Y, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::maxinddevV( ui *Ind, const vector<T>& Y );
Pascal/Delphiuses VFstd;
function VF_maxinddevV( var Ind:UIntSize; X, Y:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_maxinddevV( float *h_RetVal, ui *h_Ind, fVector X, fVector Y, ui size );
int cusdVF_maxinddevV( float *d_RetVal, ui *h_Ind, fVector X, fVector Y, ui size );
float VFcu_maxinddevV( ui *h_Ind, fVector h_X, fVector h_Y, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_maxinddevV( var h_RetVal:Single; var h_Ind:UIntSize; d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cusdVF_maxinddevV( d_RetVal:PSingle; var h_Ind:UIntSize; d_X, d_Y:fVector; size:UIntSize ): IntBool;
function VFcu_maxinddevV( var Ind:UIntSize; h_X, h_Y:fVector; size:UIntSize ): Single;
DescriptionmaxdevV = max( |Xi - Yi| )
The maximum deviation encountered is returned and its index i stored at the address given by the argument Ind.
Error handlingnone
Return valuemaximum absolute deviation.
See alsoVF_maxreldevV,   VF_maxinddevC,   VF_maxdevV,   VF_reldevV,   VF_sumdevV,   VF_avdevV,   VF_ssqdevV

 

VF_maxindreldevCVD_maxindreldevCVE_maxindreldevC
FunctionMaximum relative deviation from a reference and its index.
Syntax C/C++#include <VFstd.h>
float VF_maxindreldevC( ui *Ind, fVector X, ui size, float C );
C++ VecObj#include <OptiVec.h>
T vector<T>::maxindreldevC( ui *Ind, const T& C );
Pascal/Delphiuses VFstd;
function VF_maxindreldevC( var Ind:UIntSize; X:fVector; size:UIntSize; C:Single ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_maxindreldevC( float *h_RetVal, ui *h_Ind, fVector d_X, ui size, float C );
int cusdVF_maxindreldevC( float *d_RetVal, ui *h_Ind, fVector d_X, ui size, float *d_C );
float VFcu_maxindreldevC( ui *Ind, fVector h_X, ui size, float C );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_maxindreldevC( var h_RetVal:Single; var h_Ind:UIntSize; d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_maxindreldevC( d_RetVal:PSingle; var h_Ind:UIntSize; d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
function VFcu_maxindreldevC( var Ind:UIntSize; h_X:fVector; size:UIntSize; C:Single ): Single;
DescriptionmaxreldevC = max( |Xi - C|  /  |C| ).
The maximum relative deviation encountered is returned and its index i stored at the address given by the argument Ind.
A reference value C of zero is not allowed, as it would lead to a divion by zero.
Error handlingnone
Return valuemaximum relative deviation.
See alsoVF_maxinddevC,   VF_maxindreldevV,   VF_maxdevC,   VF_sumdevC,   VF_avdevC

 

VF_maxindreldevVVD_maxindreldevVVE_maxindreldevV
FunctionMaximum absolute deviation of the elements of one vector from the corresponding elements of another and its index
Syntax C/C++#include <VFstd.h>
float VF_maxindreldevV( ui *Ind, fVector X, fVector Y, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::maxindreldevV( ui *Ind, const vector<T>& Y );
Pascal/Delphiuses VFstd;
function VF_maxindreldevV( var Ind:UIntSize; X, Y:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_maxindreldevV( float *h_RetVal, ui *h_Ind, fVector X, fVector Y, ui size );
int cusdVF_maxindreldevV( float *d_RetVal, ui *h_Ind, fVector X, fVector Y, ui size );
float VFcu_maxindreldevV( ui *h_Ind, fVector h_X, fVector h_Y, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_maxindreldevV( var h_RetVal:Single; var h_Ind:UIntSize; d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cusdVF_maxindreldevV( d_RetVal:PSingle; var h_Ind:UIntSize; d_X, d_Y:fVector; size:UIntSize ): IntBool;
function VFcu_maxindreldevV( var Ind:UIntSize; h_X, h_Y:fVector; size:UIntSize ): Single;
DescriptionmaxreldevV = max( |Xi - Yi|  /  max(|Xi|, |Yi|) )
The relative deviation is defined as the difference between corresponding vector elements, normalized by the large of the two input values (all in absolute terms). The maximum relative deviation encountered is returned and its index i stored at the address given by the argument Ind.
Error handlingnone
Return valuemaximum relative deviation.
See alsoVF_maxreldevV,   VF_maxindreldevC,   VF_maxdevV,   VF_reldevV,   VF_sumdevV,   VF_avdevV,   VF_ssqdevV

 

VCF_maxReImVCD_maxReImVCE_maxReIm
FunctionFind the largest real and imaginary parts occurring in a vector.
Syntax C/C++#include <VFmath.h>
fComplex VCF_maxReIm( cfVector X, ui size );
C++ VecObj#include <OptiVec.h>
complex<T> vector<complex<T>>::maxReIm();
Pascal/Delphiuses VCFstd;
function VCF_maxReIm( X:cfVector; size:UIntSize ):fComplex;

Alternative syntax (obsolete, but still supported):
procedure VCF_maxReIm( var RetVal:fComplex; X:cfVector; size:UIntSize );

    (similarly VCD_,   VCE_)
CUDA function C/C++#include <cudaVCFstd.h>
int cudaVCF_maxReIm( fComplex *h_RetVal, cfVector d_X, ui size );
int cusdVCF_maxReIm( fComplex *d_RetVal, cfVector d_X, ui size );
fComplex VCFcu_maxReIm( cfVector h_X, ui size );
CUDA function Pascal/Delphiuses VCFstd;
function cudaVCF_maxReIm( var h_RetVal:fComplex; d_X:cfVector; size:UIntSize ): IntBool;
function cusdVCF_maxReIm( d_RetVal:PfComplex; d_X:cfVector; size:UIntSize ): IntBool;
function VCFcu_maxReIm( h_X:cfVector; size:UIntSize ):fComplex;
DescriptionThe vector X is separately searched for its largest real and imaginary parts. These are packed together and either returned as an fComplex (in C/C++) or stored in Max (in Pascal/Delphi):
Max.Re: largest real part encountered,
Max.Im: largest imaginary part encountered.
Error handlingnone
Return valueC/C++:
struct or class instance of type fComplex (dComplex, eComplex, resp.), in which the maxima of the real and imaginary parts of X are packed together.
Pascal/Delphi:
since Pascal does not allow complex return values, the result is stored in the variable Max.
See alsoVCF_minReIm,   VCF_absmaxReIm,   VCF_absmax,   VCF_absmaxind

 

VF_maxreldevCVD_maxreldevCVE_maxreldevC
FunctionFind the largest deviation between the elements of a vector and a reference value.
Syntax C/C++#include <VFstd.h>
float VF_maxreldevC( fVector X, ui size, float C );
C++ VecObj#include <OptiVec.h>
T vector<T>::maxreldevC(const T& C);
Pascal/Delphiuses VFstd;
function VF_maxreldevC( X:fVector; size:UIntSize; C:Single ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_maxreldevC( float *h_RetVal, fVector d_X, ui size, float C );
int cusdVF_maxreldevC( float *d_RetVal, fVector d_X, ui size, float *d_C );
float VFcu_maxreldevC( fVector h_X, ui size, float C );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_maxreldevC( var h_RetVal:Single; d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_maxreldevC( d_RetVal:PSingle; d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
function VFcu_maxreldevC( h_X:fVector; size:UIntSize; C:Single ): Single;
DescriptionThe relative deviation (in absolute terms) of each element of a vector X from a reference value C is calculated as
reldev = |Xi − C|  /  |C|
and the largest reldev encountered is returned.

The reference value C=0 is not allowed, as it would lead to a division by zero.

Error handlingnone
Return valuemaximum relative deviation encountered.
See alsoVF_maxreldevV,   VF_maxdevC,   VF_maxindreldevC,   VF_reldevC

 

VF_maxreldevVVD_maxreldevVVE_maxreldevV
FunctionFind the largest relative deviation between corresponding elements of two vectors.
Syntax C/C++#include <VFstd.h>
float VF_maxreldevV( fVector X, fVector Y, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::maxreldevV( const vector<T>& Y );
Pascal/Delphiuses VFstd;
function VF_maxreldevV( X, Y:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_maxreldevV( float *h_RetVal, fVector X, fVector Y, ui size );
int cusdVF_maxreldevV( float *d_RetVal, fVector X, fVector Y, ui size );
float VFcu_maxreldevV( fVector h_X, fVector h_Y, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_maxreldevV( var h_RetVal:Single; d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cusdVF_maxreldevV( d_RetVal:PSingle; d_X, d_Y:fVector; size:UIntSize ): IntBool;
function VFcu_avdevC( h_X, h_Y:fVector; size:UIntSize ): Single;
DescriptionThe relative deviation (in absolute terms) between corresponding vectors X and Y is calculated as
reldev = |Xi − Xi |  /  max( |Xi|, |Yi| )
and the largest reldev encountered is returned. If both Xi and Yi are zero, reldev is taken as zero, too (thus avoiding an undefined 0/0 situation).
Error handlingnone
Return valuemaximum relative deviation encountered.
See alsoVF_maxreldevC,   VF_maxdevV,,   VF_maxindreldevC,   VF_reldevC

 

VF_maxVVD_maxVVE_maxV
VI_maxVVBI_maxVVSI_maxVVLI_maxVVQI_maxV 
VU_maxVVUB_maxVVUS_maxVVUL_maxVVUQ_maxVVUI_maxV
FunctionCompare each element of a vector to the corresponding element of another vector and take the larger of the two.
Syntax C/C++#include <VFmath.h>
void VF_maxV( fVector Z, fVector X, fVector Y, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::maxV( const vector<T>& X, const vector<T>& Y );
Pascal/Delphiuses VFmath;
procedure VF_maxV( Z, X, Y:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_maxV( fVector d_Z, fVector d_X, fVector d_Y,ui size );
void VFcu_maxV( fVector h_Z, fVector h_X, fVector h_Y,ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_maxV( d_Z, d_X, d_Y:fVector; size:UIntSize ): IntBool;
procedure VFcu_maxV( h_Z, h_X, h_Y:fVector; size:UIntSize );
DescriptionZi = Xi, if Xi > Yi
Zi = Yi, if Xi ≤ Yi
Error handlingnone
Return valuenone
See alsoVF_minV,   VF_maxC,   VF_max,   VF_absmax

 

VF_meanVD_meanVE_mean
VCF_meanVCD_meanVCE_mean
VI_meanVBI_meanVSI_meanVLI_meanVQI_mean 
VU_meanVUB_meanVUS_meanVUL_meanVUQ_meanVUI_mean
FunctionMean of a one-dimensional distribution
Syntax C/C++#include <VFstd.h>
float VF_mean( fVector X, ui size );

    (similarly VD_,   VE_,   VCF_,   VCD_,   VCE_)
double VI_mean( iVector X, ui size );
    (similarly VBI_,   VSI_,   VLI_,   VU_,   VUB_,   VUS_,   VUL_,   VUI_)
extended VQI_mean( qiVector X, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::mean();
double vector<int>::mean();
extended vector<quad>::mean();
Pascal/Delphiuses VFstd;
function VF_mean( X:fVector; size:UIntSize ): Single;

    (similarly VD_,   VE_)

function VCF_mean( X:cfVector; size:UIntSize ):fComplex;

Alternative syntax (obsolete, but still supported): procedure VCF_mean( var Mean:fComplex; X:cfVector; size:UIntSize );
    (similarly VCD_,   VCE_)
function VI_mean( X:iVector; size:UIntSize ); Double;
    (similarly VBI_,   VSI_,   VLI_,   VU_,   VUB_,   VUS_,   VUL_)
function VQI_mean( X:qiVector; size:UIntSize ); Extended;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_mean( float *h_RetVal, fVector d_X, ui size );
int cusdVF_mean( float *d_RetVal, fVector d_X, ui size );
float VFcu_mean( fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_mean( var h_RetVal:Single; d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_mean( d_RetVal:PSingle; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_mean( h_X:fVector; size:UIntSize ): Single;
Descriptionmean = (1 / size) * sum( Xi )
Integer versions: the mean of a distribution consisting of whole numbers generally is a fractional, i.e. a floating-point number. Therefore, the return value of the 8, 16, and 32-bit integer versions is a double. For the 64-bit integer version, VQI_mean, the return value is an extended.
Error handlingnone
Return valueMean of the vector elements (except complex versions in Pascal/Delphi)
See alsoVF_meanwW,   VF_selected_mean,   VF_meanabs,   VF_median,   VF_meanvar,   VF_min_max_mean_stddev,   VI_fsum,   VF_varianceC,   VF_linregress

 

VF_meanabsVD_meanabsVE_meanabs
FunctionMean of the absolute values of a one-dimensional distribution
Syntax C/C++#include <VFstd.h>
float VF_meanabs( fVector X, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::meanabs();
Pascal/Delphiuses VFstd;
function VF_meanabs( X:fVector; size: UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_meanabs( float *h_RetVal, fVector d_X, ui size );
int cusdVF_meanabs( float *d_RetVal, fVector d_X, ui size );
float VFcu_meanabs( fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_meanabs( var h_RetVal:Single; d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_meanabs( d_RetVal:PSingle; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_meanabs( h_X:fVector; size:UIntSize ): Single;
Descriptionmeanabs = (1 / size) * sum(| Xi |)
Error handlingnone
Return valueMean of the absolute values of all vector elements
See alsoVF_mean,   VF_sumabs

 

VF_meanvarVD_meanvarVE_meanvar
FunctionMean and variance of a one-dimensional distribution
Syntax C/C++#include <VFstd.h>
float VF_meanvar( float *Var, fVector X, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::meanvar( T *Var );
Pascal/Delphiuses VFstd;
function VF_meanvar( var Variance:Single; X:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_meanvar( float *h_RetValMean, float *h_RetValVariance, fVector d_X, ui size );
int cusdVF_meanvar( float *d_RetValMean, float *d_RetValVariance, fVector d_X, ui size );
float VFcu_meanvar( float *h_RetValVariance, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_meanvar( var h_RetValMean, h_RetValVariance:Single; d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_meanvar( d_RetValMean, d_RetValVariance:PSingle; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_meanvar( h_X:fVector; size:UIntSize ): Single;
Descriptionmean = (1 / size) * sum( Xi )
var = (1 / (size−1)) * sum( (Xi - mean)2 )
Note that the denominator in the definition of var is size−1, whereas, in the routine VF_varianceC, it is simply size.The reason for that difference is that here the mean is calculated first and then the variance is determined using this value, whereas in VF_varianceC, the parameter C is pre-set. The mean is returned and the variance stored at the address passed as "Var" (C/C++), or in the variable "variance" (Pascal/Delphi).
Error handlingIn the case of size=1, the variance (which should be infinitely large) is set to HUGE_VAL.
Return valuemean of the vector elements.
See alsoVF_mean,   VF_selected_mean,   VF_min_max_mean_stddev,   VF_varianceC,   VF_varianceV,   VF_sum,   VF_ssq,   VF_ssqdevC,   VF_linregress

 

VF_meanvarwWVD_meanvarwWVE_meanvarwW
FunctionMean and variance with weights
Syntax C/C++#include <VFmath.h>
float VF_meanvarwW( float *Var, fVector X, fVector Wt, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::meanvarwW( T *Var, const vector<T>& Wt );
Pascal/Delphiuses VFmath;
function VF_meanvarwW( var variance:Single; X, Wt:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_meanvarwW( float *h_RetValMean, float *h_RetValVariance, fVector d_X, fVector d_Wt, ui size );
int cusdVF_meanvarwW( float *d_RetValMean, float *d_RetValVariance, fVector d_X, fVector d_Wt, ui size );
float VFcu_meanvarwW( float *h_RetValVariance, fVector h_X, fVector h_Wt, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_meanvarwW( var h_RetValMean, h_RetValVariance:Single; d_X, d_Wt:fVector; size:UIntSize ): IntBool;
function cusdVF_meanvarwW( d_RetValMean, d_RetValVariance:PSingle; d_X, d_Wt:fVector; size:UIntSize ): IntBool;
function VFcu_meanvarwW( h_X, h_Wt:fVector; size:UIntSize ): Single;
Descriptionmean = (1 / sum( Wti )) * sum( Xi * Wti )
var = (1 / sum( Wti )) * sum( Wti * (Xi - mean)2 )
The weighted mean is returned and the variance stored at the address passed as "Var" (C/C++) or in the variable "variance" (Pascal/Delphi).
Error handlingnone
Return valuemean of the vector elements.
See alsoVF_meanwW,   VF_varianceCwW,   VF_varianceVwW,   VF_linregress

 

VF_meanwWVD_meanwWVE_meanwW
VCF_meanwWVCD_meanwWVCE_meanwW
FunctionMean with weights
Syntax C/C++#include <VFstd.h>
float VF_meanwW( fVector X, fVector Wt, ui size );

    (similarly VD_,   VE_)
fComplex VCF_meanwW( cfVector X, fVector Wt, ui size );
    (similarly VCD_,   VCE_)
C++ VecObj#include <OptiVec.h>
T vector<T>::meanwW( const vector<T>& Wt );
fComplex vector<complex<T>>::meanwW( const vector<T>& Wt );
Pascal/Delphiuses VFstd;
function VF_meanwW( X, Wt:fVector; size:UIntSize ): Single;

    (similarly VD_,   VE_)

function VCF_meanwW( X:cfVector; Wt:fVector; size:UIntSize ):fComplex;

Alternative syntax (obsolete, but still supported): procedure VCF_meanwW( var Mean:fComplex; X:cfVector; Wt:fVector; size:UIntSize );
    (similarly VCD_,   VCE_)
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_meanwW( float *h_RetVal, fVector d_X, fVector d_Wt, ui size );
int cusdVF_meanwW( float *d_RetVal, fVector d_X, fVector d_Wt, ui size );
float VFcu_meanwW( fVector h_X, fVector h_Wt, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_meanwW( var h_RetVal:Single; d_X, d_Wt:fVector; size:UIntSize ): IntBool;
function cusdVF_meanwW( d_RetVal:PSingle; d_X, d_Wt:fVector; size:UIntSize ): IntBool;
function VFcu_meanwW( h_X, h_Wt:fVector; size:UIntSize ): Single;
DescriptionmeanwW = (1 / sum( Wti )) * sum( Xi * Wti )
Notice that, also in the complex version, the weights are always real rather than complex.
Error handlingnone
Return valueweighted mean of the vector elements (except complex versions in Pascal/Delphi).
See alsoVF_mean,   VF_sum,   VF_ssq,   VF_ssqdevC,   VF_median,   VF_meanvarwW,   VF_linregresswW

 

VF_medianVD_medianVE_median
VI_medianVBI_medianVSI_medianVLI_medianVQI_median 
VU_medianVUB_medianVUS_medianVUL_medianVUQ_medianVUI_median
FunctionMedian of a one-dimensional distribution
Syntax C/C++#include <VFmath.h>
float  VF_median( fVector X, ui size );
double VD_median( dVector X, ui size );
float  VBI_median( biVector X, ui size );
float  VUB_median( ubVector X, ui size );
float  VSI_median( siVector X, ui size );
float  VUS_median( usVector X, ui size );
double VI_median( iVector X, ui size );
double VU_median( uVector X, ui size );
extended VQI_median( qiVector X, ui size );
extended VUQ_median( uqVector X, ui size );

For Windows (long = dword integer type):
double VLI_median( liVector X, ui size );
double VUL_median( ulVector X, ui size );

For Linux (long = qword integer type):
extended VLI_median( liVector X, ui size );
extended VUL_median( ulVector X, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::median(); // floating-point variants
float vector<T>::median(); // byte- and word-sized integer variants
double vector<T>::median(); // dword-sized integer variants
extended vector<T>::median(); // qword-sized integer variants
Pascal/Delphiuses VFmath;
function VF_median( X:fVector; size:UIntSize ): Single;
function VD_median( X:dVector; size:UIntSize ): Double;
function VBI_median( X:biVector; size:UIntSize ): Single;
function VUB_median( X:ubVector; size:UIntSize ): Single;
function VSI_median( X:siVector; size:UIntSize ): Single;
function VUS_median( X:usVector; size:UIntSize ): Single;
function VI_median( X:iVector; size:UIntSize ): Double;
function VU_median( X:uVector; size:UIntSize ): Double;
function VQI_median( X:qiVector; size:UIntSize ): Extended;
function VUQ_median( X:uqVector; size:UIntSize ): Extended;

For Windows (LongInt = dword integer type):
function VLI_median( X:liVector; size:UIntSize ): Double;
function VUL_median( X:ulVector; size:UIntSize ): Double;

For Linux (LongInt = qword integer type):
function VLI_median( X:liVector; size:UIntSize ): Extended;
function VUL_median( X:ulVector; size:UIntSize ): Extended;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_median( float *h_RetVal, fVector d_X, ui size );
int cusdVF_median( float *d_RetVal, fVector d_X, ui size );
float VFcu_median( fVector h_X, ui size );
 
int cudaVBI_median( float *h_RetVal, biVector d_X, ui size );
int cusdVBI_median( float *d_RetVal, biVector d_X, ui size );
float VBIcu_median( biVector h_X, ui size );
(similarly VUB_, VSI_, VUS_)
 
int cudaVI_median( double *h_RetVal, iVector d_X, ui size );
int cusdVI_median( double *d_RetVal, iVector d_X, ui size );
double VIcu_median( iVector h_X, ui size );
(similarly VU_, VLI_, VLU_, VQI_, VUQ_)
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_median( var h_RetVal:Single; d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_median( d_RetVal:PSingle; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_median( h_X:fVector; size:UIntSize ): Single;

function cudaVBI_median( var h_RetVal:Single; d_X:biVector; size:UIntSize ): IntBool;
function cusdVBI_median( d_RetVal:PSingle; d_X:biVector; size:UIntSize ): IntBool;
function VBIcu_median( h_X:biVector; size:UIntSize ): Single;
(similarly VUB_, VSI_, VUS_)

function cudaVI_median( var h_RetVal:Double; d_X:iVector; size:UIntSize ): IntBool;
function cusdVI_median( d_RetVal:PDouble; d_X:iVector; size:UIntSize ): IntBool;
function VIcu_median( h_X:iVector; size:UIntSize ): Double;
(similarly VU_, VLI_, VLU_, VQI_, VUQ_)
DescriptionThe median of a distribution is defined as the value for which values above and below are equally probable. If the table X is ordered, the median is simply the element with the index (size-1)/2 (if size is odd) or the mean of the two central elements (if size is even). If a table is not ordered, VF_median finds its median by repeatedly scanning the table through, without actually sorting it.
The return value of the integer versions is a floating-point number, as the median may be the value half-way between two vector elements and thus involve an addition of 0.5 to the next integer value. There is an inherent problem with 8-byte integer values (VQI_median and VUQ_median): 64-bit integers are representable as exact numbers in double-precision floating-point format only up to values of ±253. Even extended precision does not cover the full range, but only up to ±263. Therefore, the return value of VQI_median and VUQ_median will be exact only if it lies within these ranges.
Error handlingnone
Return valueThe median is returned.
See alsoVF_mean,   VF_meanwW,   VF_sum

 

VF_minVD_minVE_min
VI_minVBI_minVSI_minVLI_minVQI_min 
VU_minVUB_minVUS_minVUL_minVUQ_minVUI_min
FunctionFinds the smallest (or the most negative) element of a vector.
Syntax C/C++#include <VFstd.h>
float VF_min( fVector X, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::_min();
Pascal/Delphiuses VFstd;
function VF_min( X:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_min( float *h_RetVal, fVector d_X, ui size );
int cusdVF_min( float *d_RetVal, fVector d_X, ui size );
float VFcu_min( fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_min( var h_RetVal:Single; d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_min( d_RetVal:PSingle; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_min( h_X:fVector; size:UIntSize ): Single;
DescriptionThe vector X is searched for its smallest (or most negative) element. In order to avoid confusion with the macro "min" in C/C++, the VecObj version of this function is written with a leading underbar as "_min".
Error handlingnone
Return valueMinimum value encountered.
See alsoVF_absmin,   VF_minmax,   VF_minpos,   VF_minexp,   VF_runmin,   VF_minind,   VF_min_max_mean_stddev

 

VF_minCVD_minCVE_minC
VI_minCVBI_minCVSI_minCVLI_minCVQI_minC 
VU_minCVUB_minCVUS_minCVUL_minCVUQ_minCVUI_minC
FunctionCompare each element of a vector to a constant and take the smaller of the two.
Syntax C/C++#include <VFmath.h>
void VF_minC( fVector Y, fVector X, ui size, float C );
C++ VecObj#include <OptiVec.h>
void vector<T>::minC( const vector<T>& X, const T& C );
Pascal/Delphiuses VFmath;
procedure VF_minC( Y, X:fVector; size:UIntSize; C:Single );
CUDA function C/C++#include <cudaVFmath.h>
#include <cudaVDmath.h>
int cudaVF_minC( fVector d_Y, fVector d_X, ui size, float C );
int cusdVF_minC( fVector d_Y, fVector d_X, ui size, float *d_C );
void VFcu_minC( fVector d_Y, fVector d_X, ui size, float C );
CUDA function Pascal/Delphiuses VFmath, VDmath;
function cudaVF_minC( d_Y, d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_minC( d_Y, d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
procedure VF_minC( Y, X:fVector; size:UIntSize; C:Single );
DescriptionYi = Xi,  if Xi ≤ C
Yi = C,  if Xi > C
Error handlingnone
Return valuenone
See alsoVF_minV,   VF_maxC,   VF_min,   VF_absmin,   VF_limit,   VF_flush0

 

VF_minexpVD_minexpVE_minexp
FunctionSmallest exponent within one vector
Syntax C/C++#include <VFstd.h>
int VF_minexp( fVector X, ui size );

    (similarly VD_,   VE_)
C++ VecObj#include <OptiVec.h>
int vector<T>::minexp();
Pascal/Delphiuses VFstd;
function VF_minexp( X:fVector; size:UIntSize ): Integer;

    (similarly VD_,   VE_)
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_minexp( int *h_RetVal, fVector d_X, ui size );
int cusdVF_minexp( int *d_RetVal, fVector d_X, ui size );
int VFcu_minexp( fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_minexp( var h_RetVal:Integer; d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_minexp( d_RetVal:PInteger; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_minexp( h_X:fVector; size:UIntSize ): Integer;
DescriptionConsidering that each number can be represented as a product, mantissa * 2exponent, where 1.0 ≤ mantissa < 2.0, the smallest or most negative exponent occurring in a vector is returned. If the absolutely smallest number was zero, the exponent is returned as -231 (32-bit models) or -215 (16-bit models).
Error handlingnone
Return valueminimum exponent encountered.
See alsoVF_maxexp,   VF_min,   VF_absmin,   VF_runmin,   VF_absminind

 

VF_minindVD_minindVE_minind
VI_minindVBI_minindVSI_minindVLI_minindVQI_minind 
VU_minindVUB_minindVUS_minindVUL_minindVUQ_minindVUI_minind
FunctionFind the smallest (or the most negative) element of a vector and its index.
Syntax C/C++#include <VFstd.h>
float VF_minind( ui *Ind, fVector X, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::minind( ui *Ind );
Pascal/Delphiuses VFstd;
function VF_minind( var Ind:UIntSize; X:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_minind( float *h_RetVal, ui *h_Ind, fVector d_X, ui size );
int cusdVF_minind( float *d_RetVal, ui *h_Ind, fVector d_X, ui size );
float VFcu_minind( ui *h_Ind, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_minind( var h_RetVal:Single; var h_Ind:UIntSize; d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_minind( d_RetVal:PSingle; var h_Ind:UIntSize; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_minind( var h_Ind:UIntSize; h_X:fVector; size:UIntSize ): Single;
DescriptionThe vector X is searched for its smallest (or most negative) element; its value is returned. At the address passed as Ind, the index of this element is stored. In the case of several mimima of equal depth, the first one is chosen (i.e., the smallest of their indices is stored in Ind).
Error handlingnone
Return valueminimum value encountered.
See alsoVF_min,   VF_maxind,   VF_absmin,   VF_runmin

 

VF_minmaxVD_minmaxVE_minmax
VI_minmaxVBI_minmaxVSI_minmaxVLI_minmaxVQI_minmax 
VU_minmaxVUB_minmaxVUS_minmaxVUL_minmaxVUQ_minmaxVUI_minmax
FunctionFinds both the smallest and the largest element of a vector.
Syntax C/C++#include <VFstd.h>
float VF_minmax( float *xmax, fVector X, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::minmax(T *xmax);
Pascal/Delphiuses VFstd;
function VF_minmax( var xmax:Single; X:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_minmax( float *h_xmin, float *h_xmax, fVector d_X, ui size );
int cusdVF_minmax( float *d_xmin, float *d_xmax, fVector d_X, ui size );
float VFcu_minmax( float *xmax, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_minmax( var h_xmin, h_xmax:Single; d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_minmax( d_xmin, d_xmax:PSingle; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_minmax( var h_xmax:Single; h_X:fVector; size:UIntSize ): Single;
DescriptionThe vector X is searched for its smallest (or most negative) and its largest element. The latter is stored as xmax, the smallest element is returned.
Error handlingnone
Return valueMinimum value encountered.
See alsoVF_absminmax,   VF_min,   VF_max,   VF_min_max_mean_stddev

 

VF_min_max_mean_stddevVD_min_max_mean_stddevVE_min_max_mean_stddev
Functionsimultaneous calculation of the minimum, maximum, mean, and standard deviation of a one-dimensional distribution
Syntax C/C++#include <VFstd.h>
void VF_min_max_mean_stddev( fVector Stats, fVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::min_max_mean_stddev( vector<T> X );
Pascal/Delphiuses VFstd;
procedure VF_min_max_mean_stddev( Stats, X:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_min_max_mean_stddev( fVector h_Stats, fVector d_X, ui size );
int cusdVF_min_max_mean_stddev( fVector d_Stats, fVector d_X, ui size );
void VFcu_min_max_mean_stddev( fVector h_Stats, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_min_max_mean_stddev( h_Stats, d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_min_max_mean_stddev( d_Stats, d_X:fVector; size:UIntSize ): IntBool;
procedure VFcu_min_max_mean_stddev( h_Stats, h_X:fVector; size:UIntSize );
DescriptionThe four basic descriptive statistics functions for a one-dimensional distribution are calculated simultaneously. They are returned in the vector Stats:
Stats[0] = Minimum;
Stats[1] = Maximum;
Stats[2] = Mean;
Stats[3] = Standard Deviation;
Error handlingIn the case of size=1, the Standard Deviation (which should be infinitely large) is set to HUGE_VAL.
Return valuenone
See alsoVF_min,   VF_max,   VF_mean,   VF_meanvar

 

VF_minposVD_minposVE_minpos
VI_minposVBI_minposVSI_minposVLI_minposVQI_minpos 
VU_minposVUB_minposVUS_minposVUL_minposVUQ_minposVUI_minpos
FunctionFinds the smallest positive and non-zero element of a vector.
Syntax C/C++#include <VFstd.h>
float VF_minpos( fVector X, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::minpos();
Pascal/Delphiuses VFstd;
function VF_minpos( X:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_minpos( float *h_RetVal, fVector d_X, ui size );
int cusdVF_minpos( float *d_RetVal, fVector d_X, ui size );
float VFcu_minpos( fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_minpos( var h_RetVal:Single; d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_minpos( d_RetVal:PSingle; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_minpos( h_X:fVector; size:UIntSize ): Single;
DescriptionThe vector X is searched for its smallest positive and non-zero element. In case there are no positive elements at all, this function returns 0.
Error handlingnone
Return valueMinimum positive value encountered.
See alsoVF_min,   VF_absmin,   VF_minmax,   VF_minexp,   VF_runmin,   VF_minind,   VF_min_max_mean_stddev

 

VCF_minReImVCD_minReImVCE_minReIm
FunctionFind the smallest (or most negative) real and imaginary parts occurring in a vector.
Syntax C/C++#include <VCFstd.h>
fComplex VCF_minReIm( cfVector X, ui size );
C++ VecObj#include <OptiVec.h>
complex<T> vector<complex<T>>::minReIm();
Pascal/Delphiuses VCFstd;
function VCF_minReIm( X:cfVector; size:UIntSize ):fComplex;

Alternative syntax (obsolete, but still supported):
procedure VCF_minReIm( var RetVal:fComplex; X:cfVector; size:UIntSize );

    (similarly VCD_,   VCE_)
CUDA function C/C++#include <cudaVCFstd.h>
int cudaVCF_minReIm( fComplex *h_RetVal, cfVector d_X, ui size );
int cusdVCF_minReIm( fComplex *d_RetVal, cfVector d_X, ui size );
fComplex VCFcu_minReIm( cfVector h_X, ui size );
CUDA function Pascal/Delphiuses VCFstd;
function cudaVCF_minReIm( var h_RetVal:fComplex; d_X:cfVector; size:UIntSize ): IntBool;
function cusdVCF_minReIm( d_RetVal:PfComplex; d_X:cfVector; size:UIntSize ): IntBool;
function VCFcu_minReIm( h_X:cfVector; size:UIntSize ):fComplex;
DescriptionThe vector X is separately searched for its smallest real and imaginary parts. These are packed together and either returned as an fComplex (in C/C++) or stored in Min (in Pascal/Delphi):
Min.Re: smallest real part encountered,
Min.Im: smallest imaginary part encountered.
Error handlingnone
Return valueC/C++:
struct or class instance of type fComplex (dComplex, eComplex, resp.), in which the minima of the real and imaginary parts of X are packed together.
Pascal/Delphi:
since Pascal does not allow complex return values, the result is stored in the variable Min.
See alsoVCF_maxReIm,   VCF_absminReIm,   VCF_absmin,   VCF_absminind

 

VF_minVVD_minVVE_minV
VI_minVVBI_minVVSI_minVVLI_minVVQI_minV 
VU_minVVUB_minVVUS_minVVUL_minVVUQ_minVVUI_minV
FunctionCompare each element of a vector to the corresponding element of another vector and take the smaller of the two.
Syntax C/C++#include <VFmath.h>
void VF_minV( fVector Z, fVector X, fVector Y, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::minV( const vector<T>& X, const vector<T>& Y );
Pascal/Delphiuses VFstd;
procedure VF_minV( Z, X, Y:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_minV( fVector d_Z, fVector d_X, fVector d_Y,ui size );
void VFcu_minV( fVector h_Z, fVector h_X, fVector h_Y,ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_minV( d_Z, d_X, d_Y:fVector; size:UIntSize ): IntBool;
procedure VFcu_minV( h_Z, h_X, h_Y:fVector; size:UIntSize );
DescriptionZi = Xi,  if Xi ≤ Yi
Zi = Yi,  if Xi > Yi
Error handlingnone
Return valuenone
See alsoVF_maxV,   VF_minC,   VF_min,   VF_absmin

 

VF_modCVD_modCVE_modC
VI_modCVBI_modCVSI_modCVLI_modCVQI_modC 
VU_modCVUB_modCVUS_modCVUL_modCVUQ_modCVUI_modC
FunctionModulus, i.e. the remainder of a division by a constant
Syntax C/C++#include <VFmath.h>
void VF_modC( fVector Y, fVector X, ui size, float C );
C++ VecObj#include <OptiVec.h>
void vector<T>::modC( const vector<T>& X, const T& C );
Pascal/Delphiuses VFmath;
procedure VF_modC( Y, X:fVector; size:UIntSize; C:Single );
CUDA function C/C++#include <cudaVFmath.h>
#include <cudaVDmath.h>
int cudaVF_modC( fVector d_Y, fVector d_X, ui size, float C );
int cusdVF_modC( fVector d_Y, fVector d_X, ui size, float *d_C );
void VFcu_modC( fVector d_Y, fVector d_X, ui size, float C );
CUDA function Pascal/Delphiuses VFmath, VDmath;
function cudaVF_modC( d_Y, d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_modC( d_Y, d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
procedure VF_modC( Y, X:fVector; size:UIntSize; C:Single );
DescriptionYi = Xi mod C
Floating-point versions: a constant C = 0.0 leads to all Yi being 0.0, independently of the Xi values (as in the ANSI C math function fmod ).
Integer versions: a constant C = 0 leads to a ZERODIVIDE error (as in the intrinsic "%" operation of ANSI C).
Error handlingnone
Return valuenone (also the floating-point versions are treated as basic arithmetic rather than mathematical functions, despite their relation to the math function fmod).
See alsoVF_modV,   VF_addC,   VF_mulC,   VF_divC,   VF_visC,   VF_redC

 

VF_modfVD_modfVE_modf
FunctionSplit up into integer and fractional parts.
Syntax C/C++#include <VFmath.h>
int VF_modf( fVector IntPart, fVector FracPart, fVector X, ui size );
C++ VecObj#include <OptiVec.h>
int vector<T>::modf( vector<T> FracPart, const vector<T>& X );
Pascal/DelphiThese functions are absent. Use VF_intfrac etc.
DescriptionThese functions are implemented as alias names for VF_intfrac etc., in order to maintain consistency with the ANSI C function name modf. For details, see VF_intfrac.

 

VF_modVVD_modVVE_modV
VFx_modVVDx_modVVEx_modV
VI_modVVBI_modVVSI_modVVLI_modVVQI_modV 
VU_modVVUB_modVVUS_modVVUL_modVVUQ_modVVUI_modV
FunctionModulus, i.e. the remainder of a division of corresponding vector elements
Syntax C/C++#include <VFmath.h>
void VF_modV( fVector Z, fVector X, fVector Y, ui size );
void VFx_modV( fVector Z, fVector X, fVector Y, ui size, float A, float B );
C++ VecObj#include <OptiVec.h>
void vector<T>::modV( const vector<T>& X, const vector<T>& Y );
void vector<T>::x_modV( const vector<T>& X, const vector<T>& Y, const T& A, const T& B );
Pascal/Delphiuses VFmath;
procedure VF_modV( Z, X, Y:fVector; size:UIntSize );
procedure VFx_modV( Z, X, Y:fVector; size:UIntSize; A, B:Single );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_modV( fVector d_Z, fVector d_X, fVector d_Y,ui size );
int cudaVFx_modV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float A, float B );
int cusdVFx_modV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float *d_A, float *d_B );
void VFcu_modV( fVector h_Z, fVector h_X, fVector h_Y,ui size );
void VFxcu_modV( fVector h_Z, fVector h_X, fVector h_Y, ui size, float A, float B );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_modV( d_Z, d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cudaVFx_modV( d_Z, d_X, d_Y:fVector; size:UIntSize; A, B:Single ): IntBool;
function cusdVFx_modV( d_Z, d_X, d_Y:fVector; size:UIntSize; d_A, d_B:PSingle ): IntBool;
procedure VFcu_modV( h_Z, h_X, h_Y:fVector; size:UIntSize );
procedure VFxcu_modV( h_Z, h_X, h_Y:fVector; size:UIntSize; A, B:Single );
Descriptionsimple versions: Zi = Xi mod Yi
expanded versions: Zi = (A * Xi + B) mod Yi
Floating-point versions: an argument Xi = 0.0 leads to Zi being 0.0, independently of Yi (as in the ANSI C math function fmod).
Integer versions: an argument Xi = 0 leads to a ZERODIVIDE error (as in the intrinsic "%" operation of ANSI C).
Error handlingnone
Return valuenone (also the floating-point versions are treated as basic arithmetic rather than mathematical functions, despite their relation to the math function fmod).
See alsoVF_modC,   VF_addV,   VF_mulV,   VF_divV,   VF_visV,   VF_redV

 

VF_mulCVD_mulCVE_mulC
VCF_mulCVCD_mulCVCE_mulC
VCF_mulReCVCD_mulReCVCE_mulReC
VPF_mulCVPD_mulCVPE_mulC
VPF_mulReCVPD_mulReCVPE_mulReC
VI_mulCVBI_mulCVSI_mulCVLI_mulCVQI_mulC 
VU_mulCVUB_mulCVUS_mulCVUL_mulCVUQ_mulCVUI_mulC
FunctionMultiply all vector elements by a constant
Syntax C/C++#include <VFmath.h>
void VF_mulC( fVector Y, fVector X, ui size, float C );

    (similarly VD_,   VE_,   VI_, etc.)
void VCF_mulC( cfVector Y, cfVector X, ui size, fComplex C );
void VCF_mulReC( cfVector Y, cfVector X, ui size, float CRe );

    (similarly VCD_,   VCE_,   VPF_,   VPD_,   VPE_)
C++ VecObj#include <OptiVec.h>
void vector<T>::mulC( const vector<T>& X, const T& C );
void vector<complex<T>>::mulC( const vector<complex<T>>& X, complex<T> C );
void vector<complex<T>>::mulReC( const vector<complex<T>>& X, const T& CRe );
Pascal/Delphiuses VFmath;
procedure VF_mulC( Y, X:fVector; size:UIntSize; C:Single );
procedure VCF_mulC( Y, X:cfVector; size:UIntSize; C:fComplex );
procedure VCF_mulReC( Y, X:cfVector; size:UIntSize; CRe:Single );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_mulC( fVector d_Y, fVector d_X, ui size, float C );
int cusdVF_mulC( fVector d_Y, fVector d_X, ui size, float *d_C );
void VFcu_mulC( fVector d_Y, fVector d_X, ui size, float C );
#include <cudaVCFmath.h>
int cudaVCF_mulReC( cfVector d_Y, cfVector d_X, ui size, float CRe );
int cusdVCF_mulReC( cfVector d_Y, cfVector d_X, ui size, float *d_CRe );
void VCFcu_mulReC( cfVector h_Y, cfVector h_X, ui size, float CRe );
CUDA function Pascal/Delphiuses VFmath, VCFmath;
function cudaVF_mulC( d_Y, d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_mulC( d_Y, d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
procedure VFcu_mulC( h_Y, h_X:fVector; size:UIntSize; C:Single );
function cudaVCF_mulReC( d_Y, d_X:cfVector; size:UIntSize; CRe:Single );
function cusdVCF_mulReC( d_Y, d_X:cfVector; size:UIntSize; d_CRe:PSingle );
procedure VCFcu_mulReC( h_Y, h_X:cfVector; size:UIntSize; CRe:Single );
DescriptionYi = C * Xi
The complex floating-point versions exist in two variants, one for complex constants C, the other for real-valued constants CRe by which the complex vector is multiplied.
Error handlingnone
Return valuenone
See alsoVF_mulV,   VF_addC,   VF_divC,   VF_divrC,   VF_visC,   VF_redC

 

VF_mulVVD_mulVVE_mulV
VCF_mulVVCD_mulVVCE_mulV
VCF_mulReVVCD_mulReVVCE_mulReV
VCF_mulVconjVCD_mulVconjVCE_mulVconj
VFs_mulVVDs_mulVVEs_mulV
VFx_mulVVDx_mulVVEx_mulV
VCFx_mulVVCDx_mulVVCEx_mulV
VCFx_mulReVVCDx_mulReVVCEx_mulReV
VCFx_mulVconjVCDx_mulVconjVCEx_mulVconj
VPF_mulVVPD_mulVVPE_mulV
VPF_mulReVVPD_mulReVVPE_mulReV
VI_mulVVBI_mulVVSI_mulVVLI_mulVVQI_mulV 
VU_mulVVUB_mulVVUS_mulVVUL_mulVVUQ_mulVVUI_mulV
FunctionMultiply corresponding vector elements
Syntax C/C++#include <VFmath.h>
void VF_mulV( fVector Z, fVector X, fVector Y, ui size );
void VFs_mulV( fVector Z, fVector X, fVector Y, ui size, float C );
void VFx_mulV( fVector Z, fVector X, fVector Y, ui size, float A, float B );
void VCF_mulV( cfVector Z, cfVector X, cfVector Y, ui size );
void VCF_mulReV( cfVector Z, cfVector X, fVector Y, ui size );
void VCF_mulVconj( cfVector Z, cfVector X, cfVector Y, ui size );
void VCFx_mulV( cfVector Z, cfVector X, cfVector Y, ui size, fComplex A, fComplex B );
void VCFx_mulReV( cfVector Z, cfVector X, fVector Y, ui size, fComplex A, fComplex B );
void VCFx_mulVconj( cfVector Z, cfVector X, cfVector Y, ui size, fComplex A, fComplex B );
C++ VecObj#include <OptiVec.h>
void vector<T>::mulV( const vector<T>& X, const vector<T>& Y );
void vector<T>::s_mulV( const vector<T>& X, const vector<T>& Y, const T& C );
void vector<T>::x_mulV( const vector<T>& X, const vector<T>& Y, const T& A, const T& B );
void vector<complex<T>>::mulV( const vector<complex<T>>& X, const vector<complex<T>>& Y );
void vector<complex<T>>::mulReV( const vector<complex<T>>& X, const vector<T>& Y );
void vector<complex<T>>::mulVconj( const vector<complex<T>>& X, const vector<complex<T>>& Y );
void vector<complex<T>>::x_mulV( const vector<complex<T>>& X, const vector<complex<T>>& Y, complex<T> A, complex<T> B );
void vector<complex<T>>::x_mulReV( const vector<complex<T>>& X, const vector<T>& Y, complex<T> A, complex<T> B );
void vector<complex<T>>::x_mulVconj( const vector<complex<T>>& X, const vector<complex<T>>& Y, complex<T> A, complex<T> B );
Pascal/Delphiuses VFmath;
procedure VF_mulV( Z, X, Y:fVector; size:UIntSize );
procedure VFs_mulV( Z, X, Y:fVector; size:UIntSize; C:Single );
procedure VFx_mulV( Z, X, Y:fVector; size:UIntSize; A, B:Single );
procedure VCF_mulV( Z, X, Y:cfVector; size:UIntSize );
procedure VCF_mulReV( Z, X:cfVector; Y:fVector; size:UIntSize );
procedure VCF_mulVconj( Z, X, Y:cfVector; size:UIntSize );
procedure VCFx_mulV( Z, X, Y:cfVector; size:UIntSize; A, B:fComplex );
procedure VCFx_mulReV( Z, X:cfVector; Y:fVector; size:UIntSize; A, B:fComplex );
procedure VCFx_mulVconj( Z, X, Y:cfVector; size:UIntSize; A, B:fComplex );
CUDA function C/C++#include <cudaVFmath.h>
#include <cudaVCFmath.h>
int cudaVF_mulV( fVector d_Z, fVector d_X, fVector d_Y,ui size );
int cudaVFs_mulV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float C );
int cusdVFs_mulV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float *d_C );
int cudaVFx_mulV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float A, float B );
int cusdVFx_mulV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float *d_A, float *d_B );
int cudaVCF_mulReV( cfVector d_Z, cfVector d_X, fVector d_Y, ui size );
int cudaVCF_mulVconj( cfVector d_Z, cfVector d_X, cfVector d_Y, ui size );
int cudaVCFx_mulReV( cfVector d_Z, cfVector d_X, fVector d_Y, ui size, fComplex A, fComplex B );
int cusdVCFx_mulReV( cfVector d_Z, cfVector d_X, fVector d_Y, ui size, fComplex *d_A, fComplex *d_B );
int cudaVCFx_mulVconj( cfVector d_Z, cfVector d_X, cfVector d_Y, ui size, fComplex A, fComplex B );
int cusdVCFx_mulVconj( cfVector d_Z, cfVector d_X, cfVector d_Y, ui size, fComplex *d_A, fComplex *d_B );
void VFcu_mulV( fVector h_Z, fVector h_X, fVector h_Y,ui size );
void VFscu_mulV( fVector h_Z, fVector h_X, fVector h_Y, ui size, float C );
void VFxcu_mulV( fVector h_Z, fVector h_X, fVector h_Y, ui size, float A, float B );
void VCFcu_mulReV( cfVector h_Z, cfVector h_X, fVector h_Y, ui size );
void VCFcu_mulVconj( cfVector h_Z, cfVector h_X, cfVector h_Y, ui size );
void VCFxcu_mulV( cfVector h_Z, cfVector h_X, cfVector h_Y, ui size, fComplex A, fComplex B );
void VCFxcu_mulReV( cfVector h_Z, cfVector h_X, fVector h_Y, ui size, fComplex A, fComplex B );
void VCFxcu_mulVconj( cfVector h_Z, cfVector h_X, cfVector h_Y, ui size, fComplex A, fComplex B );
CUDA function Pascal/Delphiuses VFmath, VCFmath;
function cudaVF_mulV( d_Z, d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cudaVFs_mulV( d_Z, d_X, d_Y:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVFs_mulV( d_Z, d_X, d_Y:fVector; size:UIntSize; d_C:PSingle ): IntBool;
function cudaVFx_mulV( d_Z, d_X, d_Y:fVector; size:UIntSize; A, B:Single ): IntBool;
function cusdVFx_mulV( d_Z, d_X, d_Y:fVector; size:UIntSize; d_A, d_B:PSingle ): IntBool;
function cudaVCF_mulReV( d_Z, d_X:cfVector; d_Y:fVector; size:UIntSize ): IntBool;
function cudaVCF_mulVconj( d_Z, d_X, d_Y:cfVector; size:UIntSize ): IntBool;
function cudaVCFx_mulReV( d_Z, d_X:cfVector; d_Y:fVector; size:UIntSize; A, B:fComplex ): IntBool;
function cusdVCFx_mulReV( d_Z, d_X:cfVector; d_Y:fVector; size:UIntSize; d_A, d_B:PfComplex ): IntBool;
function cudaVCFx_mulVconj( d_Z, d_X, d_Y:cfVector; size:UIntSize; A, B:fComplex ): IntBool;
function cusdVCFx_mulVconj( d_Z, d_X, d_Y:cfVector; size:UIntSize; d_A, d_B:PfComplex ): IntBool;
procedure VFcu_mulV( h_Z, h_X, h_Y:fVector; size:UIntSize );
procedure VFscu_mulV( h_Z, h_X, h_Y:fVector; size:UIntSize; C:Single );
procedure VFxcu_mulV( h_Z, h_X, h_Y:fVector; size:UIntSize; A, B:Single );
procedure VCFcu_mulReV( h_Z, h_X:cfVector; h_Y:fVector; size:UIntSize );
procedure VCFcu_mulVconj( h_Z, h_X, h_Y:cfVector; size:UIntSize );
procedure VCFxcu_mulReV( h_Z, h_X:cfVector; h_Y:fVector; size:UIntSize; A, B:fComplex );
procedure VCFxcu_mulVconj( h_Z, h_X, h_Y:cfVector; size:UIntSize; A, B:fComplex );
Descriptionsimple versions: Zi = Xi * Yi
scaled versions (VFs_ etc.): Zi = C * (Xi * Yi)
expanded versions (VFx_ etc.): Zi = (A * Xi + B) * Yi
The complex floating-point versions exist in three variants: in the first variant (e.g. VCF_mulV,   VCFx_mulV), X, Y, and Z are all complex; in the second variant, Y is real-valued (e.g. VCF_mulReV - "multiply by a real vector"); in the third variant, finally (e.g. VCF_mulVconj,   VCFx_mulVconj), X is multiplied by the complex conjugate of Y instead of Y itself.
Error handlingnone
Return valuenone
See alsoVF_mulC,   VF_addV,   VF_subV,   VF_divV,   VF_visV,   VF_mulVI

 

VF_mulVIVD_mulVIVE_mulVI
VF_mulVBIVD_mulVBIVE_mulVBI
VF_mulVSIVD_mulVSIVE_mulVSI
VF_mulVLIVD_mulVLIVE_mulVLI
VF_mulVQIVD_mulVQIVE_mulVQI
VF_mulVUVD_mulVUVE_mulVU
VF_mulVUBVD_mulVUBVE_mulVUB
VF_mulVUSVD_mulVUSVE_mulVUS
VF_mulVULVD_mulVULVE_mulVUL
VF_mulVUQVD_mulVUQVE_mulVUQ
VF_mulVUIVD_mulVUIVE_mulVUI
FunctionElement-wise multiplication of a floating-point vector by an integer vector
Syntax C/C++#include <VFmath.h>
void VF_mulVI( fVector Z, fVector X, iVector Y,ui size );
void VF_mulVUB( fVector Z, fVector X, ubVector Y, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::mulVI( const vector<T>& X, const vector<int>& Y );
void vector<T>::mulVUS( const vector<T>& X, const vector<unsigned short>& Y, );
Pascal/Delphiuses VFmath;
procedure VF_mulVI( Z, X:fVector; Y:iVector; size:UIntSize );
procedure VF_mulVUL( Z, X:fVector; Y:ulVector; size:UIntSize );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_mulVI( fVector d_Z, fVector d_X, iVector d_Y,ui size );
int cudaVF_mulVUB( fVector d_Z, fVector d_X, ubVector d_Y, ui size );
void VFcu_mulVI( fVector h_Z, fVector h_X, iVector h_Y,ui size );
void VFcu_mulVUB( fVector h_Z, fVector h_X, ubVector h_Y, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_mulVI( d_Z, d_X:fVector; d_Y:iVector; size:UIntSize ): IntBool;
function cudaVF_mulVUL( d_Z, d_X:fVector; d_Y:ulVector; size:UIntSize ): IntBool;
procedure VFcu_mulVI( h_Z, h_X:fVector; h_Y:iVector; size:UIntSize );
procedure VFcu_mulVUL( h_Z, h_X:fVector; h_Y:ulVector; size:UIntSize );
DescriptionZi = Xi * Yi
Error handlingnone
Return valuenone
See alsoVF_mulV,   VF_divVI,   VF_addVI

 

VF_natCubSplineInterpolVD_natCubSplineInterpolVE_natCubSplineInterpol
FunctionNatural cubic-spline interpolation of X-Y-table values
Syntax C/C++#include <VFstd.h>
void VF_natCubSplineInterpol( fVector Y, fVector X, ui sizex, fVector XTab, fVector YTab, ui sizetab );
C++ VecObj#include <OptiVec.h>
void vector<T>::natCubSplineInterpol( const vector<T>& X, const vector<T>& XTab, const vector<T>& YTab );
Pascal/Delphiuses VFstd;
procedure VF_natCubSplineInterpol( Y, X:fVector; sizex:UIntSize; XTab, YTab:fVector; sizetab:UIntSize );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_natCubSplineInterpol( fVector d_Y, fVector d_X, ui sizex, fVector d_XTab, fVector d_YTab, ui sizetab );
void VFcu_natCubSplineInterpol( fVector h_Y, fVector h_X, ui sizex, fVector h_XTab, fVector h_YTab, ui sizetab );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_natCubSplineInterpol( d_Y, d_X:fVector; sizex:UIntSize; d_XTab, d_YTab:fVector; sizetab:UIntSize ): IntBool;
procedure VFcu_natCubSplineInterpol( h_Y, h_X:fVector; sizex:UIntSize; h_XTab, h_YTab:fVector; sizetab:UIntSize );
DescriptionFor each of the sizex elements of X, the corresponding element of Y is interpolated from the XTab-YTab value pairs. XTab must be ordered (either ascending or descending). All values of XTab must be distinct; otherwise a division by zero may occur and lead to a program abort. sizetab must be greater than or equal to 3.
This function calculates the "natural" cubic-spline interpolation. For general cubic-spline interpolation with specified second derivatives of the YTab values with respect to XTab, call VF_splineinterpol.
The CUDA version of this function is comparably slow, as it has to use the CPU for the calculation of the derivative table.
Error handlingnone (you have to take care yourself that the XTab values are distinct and that the YTab values are not near the limit of overflowing).
Return valuenone
See alsoVF_splineinterpol,   VF_ratinterpol,   VF_polyinterpol

 

VF_negVD_negVE_neg
VCF_negVCD_negVCE_neg
VPF_negVPD_negVPE_neg
VI_negVBI_negVSI_negVLI_negVQI_neg
FunctionNegation
Syntax C/C++#include <VFmath.h>
int VF_neg( fVector Y, fVector X, ui size );
C++ VecObj#include <OptiVec.h>
int vector<T>::neg( const vector<T>& X );
Pascal/Delphiuses VFmath;
function VF_neg( Y, X:fVector; size:UIntSize ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_neg( fVector d_Y, fVector d_X, ui size );
int VFcu_neg( fVector h_Y, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_neg( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function VFcu_neg( h_Y, h_X:fVector; size:UIntSize );
DescriptionYi = - (Xi)
VBI_,   VSI_,   VI_, and VLI_ versions only: the negation of the most negative number possible (−128 for byte/ByteInt, -32768 for short/SmallInt, -2147483648 for long/LongInt) is again the same - negative! - number. This is due to the implicit modulo-2n arithmetics, where the overflowing byte/ByteInt, +128, is stored as −128, the overflowing short/SmallInt, +32768, is stored as -32768, and the overflowing long/LongInt, +2147483648, is stored as -2147483648.
Error handlingnone
Return valueBy analogy with VF_abs, the floating-point versions are treated as math functions. Therefore, they have a return value which, since no errors can occur, is always FALSE (0). The integer versions have no return value.
See alsoVF_abs,   VCF_conj

 

V_nfree
FunctionDe-allocate memory occupied by one or more vectors.
Syntax C/C++#include <VecLib.h>
void V_nfree( unsigned numfree, ... );
Pascal/DelphiThis function is absent.
CUDA function C/C++#include <cudaVecLib.h>
void cudaV_nfree( unsigned numfree, ... );
DescriptionThe parameter numfree "tells" the function how many vectors it has to free. These vectors follow in the parameter list after numfree. De-allocation of vectors not allocated by one of the functions of the VF_vector or VF_vector0 family is discouraged, especially in Windows programs.
Pascal/Delphi: since a variable number of parameters is not supported in Pascal language, this function is missing.
Example C/C++V_nfree( 3, X, Y, Z );
Return valuenone
See alsoV_free,   V_freeAll,   VF_vector,   VF_vector0

 

VF_noiseVD_noiseVE_noise
FunctionInitialize a vector with "white" noise
Syntax C/C++#include <VFstd.h>
long VF_noise( fVector X, ui size, long seed, float Amp );
C++ VecObj#include <OptiVec.h>
long vector<T>::noise( long seed, const T& Amp );
Pascal/Delphiuses VFstd;
function VF_noise( X:fVector; size:UIntSize; Seed:LongInt; Amp:Single ): LongInt;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_noise( fVector X, ui size, long seed, float Amp );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_noise( X:fVector; size:UIntSize; Seed:LongInt; Amp:Single ): IntBool;
DescriptionWhite noise is generated with the amplitude Amp, i.e., the output values are between -Amp/2 and +Amp/2 (both extrema included). "seed" may be chosen completely arbitrary. Successive calls with the same seed yield identical results; for different values of seed, the obtained results are uncorrelated.

Internally, these functions employ a 32-bit integer random number generator by H.W.Lewis, with additional steps (so-called "Bays-Durham shuffle") to break sequential correlations.
A 32-bit integer suitable for use as a new seed value for another call is returned. That other call would, however, not simply continue the series, as a new "state" of the random-number generator needs to be built up. If you wish to be able to break off and continue the series in multiple sequential function calls, use VF_noiseLC instead.
Because the random numbers are only 32-bit, there is some granularity in the VD_ and VE_ versions. If higher resolution is desired, use VD_random instead.

A long value is returned which may be used as new seed for subsequent calls. Only the CUDA versions of this function do not return a new seed value, but the usual CUDA error flag.
There is no VFcu_ version of this function, as the random numbers are generated on the CPU anyway.

Error handlingnone
Return valuelast 32-bit random number internally generated; may be used as new seed value for future calls.
See alsorand,   random,   VF_random,   VF_noiseLC

 

VF_noiseLCVD_noiseLCVE_noiseLC
FunctionInitialize a vector with "white" noiseLC
Syntax C/C++#include <VFstd.h>
void VF_noiseLC( fVector X, ui size, long seed, float Amp, V_RANDOMLCSTATE *state );
C++ VecObj#include <OptiVec.h>
void vector<T>::noiseLC( long seed, const T& Amp,  V_RANDOMLCSTATE *state);
Pascal/Delphiuses VFstd;
procedure VF_noiseLC( X:fVector; size:UIntSize; Seed:LongInt; Amp:Single; state:PV_RANDOMLCSTATE );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_noiseLC( fVector X, ui size, long seed, float Amp, V_RANDOMLCSTATE );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_noiseLC( X:fVector; size:UIntSize; Seed:LongInt; Amp:Single; state:PV_RANDOMLCSTATE ): IntBool;
DescriptionWhite noise is generated with the amplitude Amp, i.e., the output values are between -Amp/2 and +Amp/2 (both extrema included). "seed" may be completely arbitrary. A non-zero value of seed leads to the start of a new series, whereas seed=0 leads to the series whose state is stored in the variable state to be continued.

Internally, these functions employ a linear-congruential (hence the name component "LC") 32-bit integer random number generator by H.W.Lewis, with additional steps (so-called "Bays-Durham shuffle") to break sequential correlations.
A simplified form of this function is available as VF_noise.
Because the random numbers are only 32-bit, there is some granularity in the VD_ and VE_ versions. If higher resolution is desired, use VD_randomLC instead.

There is no VFcu_ version of this function, as the random numbers are generated on the CPU anyway.

Error handlingnone
Return valuenone
See alsorand,   random,   VF_randomLC,   VF_noise

 

VCF_normVCD_normVCE_norm
VCF_normtoCVCD_normtoCVCE_normtoC
VPF_normVPD_normVPE_norm
FunctionNorm (square of the magnitude) of complex numbers.
Syntax C/C++#include <VCFstd>
void VCF_norm( fVector Norm, cfVector X, ui size );
void VPF_norm( fVector Norm, pfVector X, ui size );
void VCF_normtoC( cfVector Norm, cfVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::norm( const vector<complex<T>>& X );
void vector<complex<T>>::normtoC( const vector<complex<T>>& X );
Pascal/Delphiuses VCFstd, VPFstd;
procedure VCF_norm( Norm:fVector; X:cfVector; size:UIntSize );
procedure VPF_norm( Norm:fVector; X:pfVector; size:UIntSize );
procedure VCF_normtoC( Norm, X:cfVector; size:UIntSize );
CUDA function C/C++#include <cudaVCFstd.h> #include <cudaVPFstd.h>
int cudaVCF_norm( fVector d_Norm, cfVector d_X, ui size );
int cudaVPF_norm( fVector d_Norm, pfVector d_X, ui size );
int cudaVCF_normtoC( cfVector d_Norm, cfVector d_X, ui size );
void VCFcu_norm( fVector h_Norm, cfVector h_X, ui size );
void VPFcu_norm( fVector h_Norm, pfVector h_X, ui size );
void VCFcu_normtoC( cfVector h_Norm, cfVector h_X, ui size );
CUDA function Pascal/Delphiuses VCFstd;
function cudaVCF_norm( d_Norm:fVector; d_X:cfVector; size:UIntSize ): IntBool;
function cudaVPF_norm( d_Norm:fVector; d_X:pfVector; size:UIntSize ): IntBool;
function cudaVCF_normtoC( d_Norm, d_X:cfVector; size:UIntSize ): IntBool;
procedure VCFcu_norm( h_Norm:fVector; h_X:cfVector; size:UIntSize );
procedure VPFcu_norm( h_Norm:fVector; h_X:pfVector; size:UIntSize );
procedure VCFcu_normtoC( h_Norm, h_X:cfVector; size:UIntSize );
DescriptionVCF_norm is identical to VF_CtoNorm, and VPF_norm is identical to VF_PtoNorm. See those functions for details.
VCF_normtoC calculates the norm of a cartesian complex vector and stores it as a complex vector (with all imaginary parts equal to 0).

 

VI_notVBI_notVSI_notVLI_notVQI_not 
VU_notVUB_notVUS_notVUL_notVUQ_notVUI_not
FunctionBit-wise complement
Syntax C/C++#include <VImath.h>
void VI_not( iVector Y, iVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::not( const vector<T>& X );
Pascal/Delphiuses VImath;
procedure VI_not( Y, X:iVector; size:UIntSize );
CUDA function C/C++#include <cudaVImath.h>
int cudaVI_not( iVector d_Y, iVector d_X, ui size );
int VIcu_not( iVector h_Y, iVector h_X, ui size );
CUDA function Pascal/Delphiuses VImath;
function cudaVI_not( d_Y, d_X:iVector; size:UIntSize ): IntBool;
function VIcu_not( h_Y, h_X:iVector; size:UIntSize );
DescriptionYi = ~(Xi)
Each single bit of the element Xi is inverted (i.e., it is 0 in Yi, if it was 1 in Xi, and vice versa).
Error handlingnone
Return valuenone
See alsoVI_and,   VI_or,   VI_neg

 

V_noteError
FunctionConstruct and print an error message
Syntax C/C++#include <VecLib.h>
void V_noteError( char *fname, unsigned why );
Pascal/Delphiuses VecLib;
procedure V_noteError( fname:PChar; why:UInt );
DescriptionIn case of an error, the math functions of VectorLib invoke the following steps:
  • Set the result to the standard value appropriate for the respective function.
  • Debug libraries only: Call V_noteError, if V_FPErrorHandlingMode contains fpErrorNote for the type of error that occurred.
  • V_noteError constructs the appropriate error message and passes it to V_printErrorMsg, which is the function in charge of actually printing the error message.

By default, output is directed to the screen. This may be changed by a call to V_setErrorEventFile (see chapter 5.3).

"fname" is the name of the "complaining" function, and "why" specifies the reason for the complaint.

The parameter "why" may take on the following values:
1 for DOMAIN errors
2 for SING errors
3 for OVERFLOW errors
4 for UNDERFLOW errors
5 for TLOSS errors

Return valuenone
See alsoV_setErrorEventFile,   V_printErrorMsg

 

VF_nreadVD_nreadVE_nread
VCF_nreadVCD_nreadVCE_nread
VPF_nreadVPD_nreadVPE_nread
VI_nreadVBI_nreadVSI_nreadVLI_nreadVQI_nread 
VU_nreadVUB_nreadVUS_nreadVUL_nreadVUQ_nreadVUI_nread
FunctionRead the columns of a table from a stream
Syntax C/C++#include <VFstd.h>
void VF_nread( unsigned n, ui size, FILE *stream, ... );
Pascal/Delphiuses VFstd;
procedure VF_nread( VecList:^fVector; n:Word; size:UIntSize; var stream:Text );
Description C/C++n columns of a table are read into the vectors passed to VF_nread. The number of lines is specified as the number of elements of each vector, which is size.

The entries of each line should be separated by spaces (' ') or tab characters ('\t').

Each line must be terminated by a line-feed character ('\n'). The length of the lines is limited according the following rules:
- Either all lines have the same length. In this case, the length is determined automatically and might in principle be as large as 65535 characters.
- Or the maximum length is given by the number n of vectors to be read and by the data type:
 
VF_ 24*n
VBI_,   VUB_13*n
VD_ 32*n
VSI_,   VUS_21*n
VE_ 40*n
VLI_,   VUL_37*n
VCF_,   VPF_ 48*n
VQI_,   VUQ_32*n
VCD_,   VPD_ 64*n
VI_,   VU_as VLI_,   VUL_
VCE_,   VPE_ 80*n
 

It is possible to read fewer vectors than there are columns in a table. In this case, the trailing columns are neglected. If, however, you try to read more vectors than there are columns, the result is undefined and might lead to an error.

Complex versions (both cartesian and polar):
Real und imaginary (or Mag and Arg) parts may, but need not, be enclosed in braces { }. However, you must be consequent: Either all or no element may be written with braces.

Whole-number versions except VQI_nread:
By default, the numbers to be read are interpreted as decimal numbers. You may use V_setRadix to define any radix between 2 and 36.

Example C/C++VF_nread( 3, 100, DataFile, X, Y, Z );
 
GCC Windows specific:In principle, the Windows port of GCC supports the 80-bit floating point type long double. However, the I/O routines rely on the runtime libraries of Visual C++, where 80-bit reals have disappeared a long time ago. This means that VE_nread, VCE_nread, and VPE_nread work only with double precision and, more importantly, within double range. Input numbers outside double range are treated as ±DBL_MAX.
 
Description Pascal/Delphin columns of a table are read into the vectors passed as the list VecList to VF_nread. The number of lines is specified as the number of elements of each vector, which is size.

The entries of each line should be separated by spaces (' ') or tab characters (#9). Other separators are not allowed. Each line must be terminated by a line-feed character (#13).

It is possible to read fewer vectors than there are columns in a table. In this case, the trailing columns are neglected. If, however, you try to read more vectors than there are columns, the result is undefined and might lead to an error.

Complex versions (both cartesian and polar):
Real und imaginary (or Mag and Arg) parts may (but need not) be enclosed in braces { }. However, you must be consequent: Either all or no element may be written with braces.

Whereas the C version of these functions follows the conventions of the C functions strtod,   strtol, etc., the Pascal version has to follow the rules applying to the Pascal function Read. This makes the Pascal version much less flexible than the C version:
- no separation characters allowed other than ' ' and #9,
- no automatic truncation of overflowing numbers,
- no function V_setRadix

Example Pascal/Delphivar MyFile: Text;
    X, Y1, Y2: fVector;
    VList: array[0..2] of fVector;
begin
    X := VF_vector( 100 );
    Y1 := VF_vector( 100 );
    Y2 := VF_vector( 100 );
    VList[0] := X; VList[1] := Y1; VList[2] := Y2;
    Assign( MyFile, 'Myfile.DAT' );
    Reset( MyFile );
    VF_nread( @VList, 3, 100, MyFile );
    ...
end;
Error handlingC/C++:
Real, complex and quad versions:
Overflowing numbers are silently truncated to ±HUGE_VAL.
Whole-number versions except VQI_nread:
As long as the numbers can be represented as long or unsigned long, overflowing bits are ignored in the 16-bit versions.
Numbers beyond the long range yield −1 (signed types) or +HUGE_VAL (unsigned types).
Pascal/Delphi:
Overflowing numbers or numbers otherwise not conforming to the format requirements lead to an I/O error.
Return valuenone
See alsoVF_nwrite,   VF_read,   VF_store,   VF_recall, strtod,  strtol (C/C++ only)

 

VF_nwriteVD_nwriteVE_nwrite
VCF_nwriteVCD_nwriteVCE_nwrite
VPF_nwriteVPD_nwriteVPE_nwrite
VI_nwriteVBI_nwriteVSI_nwriteVLI_nwriteVQI_nwrite 
VU_nwriteVUB_nwriteVUS_nwriteVUL_nwriteVUQ_nwriteVUI_nwrite
FunctionWrite vectors as the columns of a table into a stream.
Syntax C/C++#include <VFstd.h>
void VF_nwrite( FILE *stream, unsigned n, ui size, ... );
Pascal/Delphiuses VFstd;
procedure VF_nwrite( var stream:Text; VecList:^fVector; n:UInt; size:UIntSize );
Description C/C++n vectors are written in ASCII format as the columns of a table into stream. The number of lines is given by the number of elements of each vector: size.

The default format and separation may be changed using VF_setWriteFormat and VF_setNWriteSeparate, respectively.

Example C/C++VF_nwrite( DataFile, 3, 100, X, Y, Z );
     /* generates a table with 3 columns and 100 lines;
        the columns are given by X, Y and Z. */

 
GCC Windows specific:In principle, the Windows port of GCC supports the 80-bit floating point type long double. However, the I/O routines rely on the runtime libraries of Visual C++, where 80-bit reals have disappeared a long time ago. This means that VE_nwrite, VCE_nwrite, and VPE_nwrite work only with double precision and, more importantly, within double range. Input numbers outside double range are treated as ±DBL_MAX.
Pascal/Delphin vectors, passed as the list VecList, are written in ASCII format as the columns of a table into stream. The number of lines is given by the number of elements of each vector: size.

The separation character(s) between columns may be changed using VF_setNWriteSeparate. By default, it is a tab character (#9).

Please note that the Pascal version of these functions does not allow a free definition of the output format. Therefore, the function VF_setWriteFormat does not exist in the Pascal/Delphi version.

Error handlingnone
Return valuenone
See alsoVF_write,   VF_nread,   VF_store,   VF_recall,   fprintf

 

VF_ODVD_ODVE_OD
VU_ODtoFVU_ODtoDVU_ODtoE
VUB_ODtoFVUB_ODtoDVUB_ODtoE
VUS_ODtoFVUS_ODtoDVUS_ODtoE
VUL_ODtoFVUL_ODtoDVUL_ODtoE
VUQ_ODtoFVUQ_ODtoDVUQ_ODtoE
VUI_ODtoFVUI_ODtoDVUI_ODtoE
VQI_ODtoFVQI_ODtoDVQI_ODtoE
FunctionOptical Density
Syntax C/C++#include <VFmath.h>
int VF_OD( fVector OD, fVector X, fVector X0, ui size );
int VUS_ODtoF( fVector OD, usVector X, usVector X0, ui size );
C++ VecObj#include <OptiVec.h>
int vector<T>::OD( const vector<T>& X, const vector<T>& X0 );
int vector<flot>::ODtoF( const vector<unsigned>& X, const vector<unsigned>& X0 );
Pascal/Delphiuses VFmath;
function VF_OD( OD, X, X0:fVector; size:UIntSize ): IntBool;
function VUS_ODtoF( OD:fVector; X, X0:usVector; size:UIntSize ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_OD( fVector d_OD, fVector d_X, fVector d_X0, ui size );
int cudaVUS_ODtoF( fVector d_OD, usVector d_X, usVector d_X0, ui size );
int VFcu_OD( fVector h_OD, fVector h_X, fVector h_X0, ui size );
int VUScu_ODtoF( fVector h_OD, usVector h_X, usVector h_X0, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_OD( d_OD, d_X, d_X0:fVector; size:UIntSize ): IntBool;
function cudaVUS_ODtoF( d_OD:fVector; d_X, d_X0:usVector; size:UIntSize ): IntBool;
function VFcu_OD( h_OD, h_X, h_X0:fVector; size:UIntSize ): IntBool;
function VUScu_ODtoF( h_OD:fVector; h_X, h_X0:usVector; size:UIntSize ): IntBool;
DescriptionODi = log10( X0i/Xi ) for (X0i ≥ ODThresh0 & Xi ≥ ODThresh),
ODi = 0.0 otherwise
The "optical density" is calculated for positive, non-zero input numbers. By default, ODThresh and ODThresh0 are FLT_MIN, DBL_MIN, or LDBL_MIN for the versions with floating-point input vectors (VF_OD,   VD_OD, and VE_OD), and 1 for the versions with unsigned-integer input vectors.
The typical application of these functions would be an absorption measurement with a spectrometer, where each element of X corresponds to the light intensity at one specific wavelength, transmitted through the sample, and each element of X0 corresponds to the light intensity measured through air or through a reference sample. Normally, the intensity data will have been digitized with 12-bit or 16-bit precision. In this case, VUS_ODtoF or VUS_ODtoD will be the appropriate functions. For the rare cases of 8-bit, 32-bit, or even 64-bit digitization, use the VUB_, VUL_ or VUQ_ versions.
You might wish to accumulate several measurements before calculating the OD. For example, repeated measurements in a usVector may be accumulated into a ulVector by VUL_accVUS, before the OD is calculated by VUL_ODtoD. Similarly, you might accumulate 32-bit data into a uqVector by VUQ_accVUL and call then, e.g., VUQ_ODtoD.

In order to cut off experimental noise, the input-number threshold below which the OD is corrected to 0.0 may be set to arbitrary positive values by VF_setODThresh,   VUS_setODThresh, etc.

If background values have to be taken into account, please use the functions of the VF_ODwDark family.

Error handlingnone
Return valuealways FALSE (0)
See alsoVF_ODwDark,   VF_log10

 

VF_ODwDarkVD_ODwDarkVE_ODwDark
VU_ODtoFwDarkVU_ODtoDwDarkVU_ODtoEwDark
VUB_ODtoFwDarkVUB_ODtoDwDarkVUB_ODtoEwDark
VUS_ODtoFwDarkVUS_ODtoDwDarkVUS_ODtoEwDark
VUL_ODtoFwDarkVUL_ODtoDwDarkVUL_ODtoEwDark
VUQ_ODtoFwDarkVUQ_ODtoDwDarkVUQ_ODtoEwDark
VUI_ODtoFwDarkVUI_ODtoDwDarkVUI_ODtoEwDark
VQI_ODtoFwDarkVQI_ODtoDwDarkVQI_ODtoEwDark
FunctionOptical Density with background subtraction
Syntax C/C++#include <VFmath.h>
int VF_ODwDark( fVector OD, fVector X, fVector XDark, fVector X0, fVector X0Dark, ui size );
int VUS_ODtoFwDark( fVector OD, usVector X, usVector XDark, usVector X0, usVector X0Dark, ui size );
C++ VecObj#include <OptiVec.h>
int vector<T>::ODwDark( const vector<T>& X, const vector<T>& XDark, const vector<T>& X0, const vector<T>& X0Dark );
int vector<float>::ODtoFwDark( const vector<unsigned>& X, const vector<unsigned>& XDark, const vector<unsigned>& X0, const vector<unsigned>& X0Dark );
Pascal/Delphiuses VFmath;
function VF_ODwDark( OD, X, XDark, X0, X0Dark:fVector; size:UIntSize ): IntBool;
function VUS_ODtoFwDark( OD:fVector; X, XDark, X0, X0Dark:usVector; size:UIntSize ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_ODwDark( fVector d_OD, fVector d_X, fVector d_XDark, fVector d_X0, fVector d_X0Dark, ui size );
int cudaVUS_ODtoFwDark( fVector d_OD, usVector d_X, usVector d_XDark, usVector d_X0, usVector d_X0Dark, ui size );
int VFcu_ODwDark( fVector h_OD, fVector h_X, fVector h_XDark, fVector h_X0, fVector h_X0Dark, ui size );
int VUScu_ODtoFwDark( fVector h_OD, usVector h_X, usVector h_XDark, usVector h_X0, usVector h_X0Dark, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_ODwDark( d_OD, d_X, d_ XDark, d_X0, d_X0Dark:fVector; size:UIntSize ): IntBool;
function cudaVUS_ODtoFwDark( d_OD:fVector; d_X, d_XDark, d_X0, d_X0Dark:usVector; size:UIntSize ): IntBool;
function VFcu_ODwDark( h_OD, h_X, h_XDark, h_X0, h_X0Dark:fVector; size:UIntSize ): IntBool;
function VUScu_ODtoFwDark( h_OD:fVector; h_X, h_XDark, h_X0, h_X0Dark:usVector; size:UIntSize ): IntBool;
Descriptionxxi = Xi - XiDark
x0i = X0i - X0iDark
ODi = log10( x0i/xxi ),  (x0i ≥ ODThresh0 & xxi ≥ ODThresh),
ODi = 0.0  otherwise

Dark currents XDark, X0Dark are subtracted from measured intensity data X, X0. The optical density is calculated for the resulting corrected data. If these happen to become negative or at least smaller than the thresholds ODThresh, ODThresh0, the OD is set to 0.0.

In order to cut off experimental noise, these thresholds may be set to arbitrary positive values by VF_setODThresh,   VU_setODThresh, etc.

Error handlingnone
Return valuealways FALSE (0)
See alsoVF_OD,   VF_setODThresh

 

VI_orVBI_orVSI_orVLI_orVQI_or 
VU_orVUB_orVUS_orVUL_orVUQ_orVUI_or
FunctionBit-wise "OR" operation
Syntax C/C++#include <VImath.h>
void VI_or( iVector Y, iVector X, ui size, int C);
void VUL_or( ulVector Y, ulVector X, ui size, unsigned long C );
C++ VecObj#include <OptiVec.h>
void vector<T>::or( const vector<T>& X, const T& C );
Pascal/Delphiuses VImath;
procedure VI_or( Y, X:iVector; size:UIntSize; C:Integer );
CUDA function C/C++#include <cudaVImath.h>
int cudaVI_or( iVector d_Y, iVector d_X, ui size, int C );
int cusdVI_or( iVector d_Y, iVector d_X, ui size, int *d_C );
void VIcu_or( iVector h_Y, iVector h_X, ui size, int C );
CUDA function Pascal/Delphiuses VImath;
function cudaVI_or( d_Y, d_X:iVector; size:UIntSize; C:Integer ): IntBool;
function cusdVI_or( d_Y, d_X:iVector; size:UIntSize; d_C:PInteger ): IntBool;
procedure VIcu_or( h_Y, h_X:iVector; size:UIntSize; C:Integer );
DescriptionYi = (Xi) | C
The bit-wise "inclusive OR" operation is performed on each element Xi with the bit-mask given by C. A bit is 1 in Yi, if it was not simultaneously 0 in Xi and in C, i.e., if it was 1 at least in one of them.
Error handlingnone
Return valuenone
See alsoVI_not,   VI_and,   VI_xor

 

VF_ParzenVD_ParzenVE_Parzen
Function"Parzen" window for spectral analyses
Syntax C/C++#include <VFmath.h>
void VF_Parzen( fVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::Parzen();
Pascal/Delphiuses VFmath;
procedure VF_Parzen( X:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_Parzen( fVector d_X, ui size );
void VFcu_Parzen( fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_Parzen( d_X:fVector; size:UIntSize ): IntBool;
procedure VFcu_Parzen( h_X:fVector; size:UIntSize );
DescriptionXi = 1 - |(i - 0.5*(size - 1)) / 0.5*(size + 1)|
This function provides a window for power-spectrum estimation with Welch's method of overlapping segments, here implemented as VF_spectrum.
Error handlingnone
Return valuenone
See alsoVF_Welch,   VF_Hann,   VF_spectrum

 

VF_PelementVD_PelementVE_Pelement
VCF_PelementVCD_PelementVCE_Pelement
VCF_PelementReVCD_PelementReVCE_PelementRe
VCF_PelementImVCD_PelementImVCE_PelementIm
VPF_PelementVPD_PelementVPE_Pelement
VI_PelementVBI_PelementVSI_PelementVLI_PelementVQI_Pelement 
VU_PelementVUB_PelementVUS_PelementVUL_PelementVUQ_PelementVUI_Pelement
FunctionPointer to a vector element
Syntax C/C++#include <VFstd.h>
(float *) VF_Pelement( fVector X, ui pos );
#include <VCFstd.h>
(fComplex *) VCF_Pelement( cfVector X, ui pos );
(float *) VCF_PelementRe( cfVector X, ui pos );
(float *) VCF_PelementIm( cfVector X, ui pos );
C++ VecObj#include <OptiVec.h>
T * vector<T>::Pelement( ui pos );
complex<T> * vector<complex<T>>::Pelement( ui pos );
T * vector<complex<T>>::PelementRe( ui pos );
T * vector<complex<T>>::PelementIm( ui pos );
Pascal/Delphiuses VFstd;
function VF_Pelement( X:fVector; pos:UIntSize ): PSingle;
uses VCFstd;
function VCF_Pelement( X:cfVector; pos:UIntSize ): PfComplex;
function VCF_PelementRe( X:cfVector; pos:UIntSize ): PSingle;
function VCF_PelementIm( X:cfVector; pos:UIntSize ): PSingle;
CUDA function C/C++#include <cudaVFstd.h>
(float *) cudaVF_Pelement( fVector d_X, ui pos ); #include <cudaVCFstd.h>
(fComplex *) cudaVCF_Pelement( cfVector d_X, ui pos );
(float *) cudaVCF_PelementRe( cfVector d_X, ui pos );
(float *) cudaVCF_PelementIm( cfVector d_X, ui pos );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_Pelement( d_X:fVector; pos:UIntSize ): PSingle;
uses VCFstd;
function cudaVCF_Pelement( d_X:cfVector; pos:UIntSize ): PfComplex;
function cudaVCF_PelementRe( d_X:cfVector; pos:UIntSize ): PSingle;
function cudaVCF_PelementIm( d_X:cfVector; pos:UIntSize ): PSingle;
DescriptionReal versions: returns the pointer X+pos = &( X[pos] ).

complex version VCF_PelementRe: returns pointer to X[pos].Re.
complex version VCF_PelementIm: returns pointer to X[pos].Im.

Error handlingnone
Return valueC/C++:           X+pos
Pascal/Delphi: @( X[pos] )
See alsoVF_element,   VF_setElement,   VF_accElement,   VF_decElement

 

V_PDtoPFV_PDtoPE
V_PEtoPFV_PEtoPD
V_PFtoPDV_PFtoPE
FunctionData type conversions. See V_FtoD.

 

cudaV_pinnedFree
FunctioncudaOptiVec only: De-allocate a single pinned host-memory vector
CUDA function C/C++#include <cudaVecLib.h>
int cudaV_pinnedFree( void *h_X );
CUDA function Pascal/Delphiuses VecLib;
function cudaV_pinnedFree( h_X:Pointer ): IntBool;
DescriptionThe pinned host-memory vector X is freed (i.e. de-allocated). This function needs the host address (not the device address!) of the pinned vector as an argument. To free several pinned vectors simultaneously, use cudaV_pinnedNfree (C/C++ only).
Error handlingTrying to free a pinned vector that has already been freed, or that has never been allocated memory, leads to a warning message "Cannot free non-existent vector". Program execution is continued without freeing anything in this case.
Return valueFALSE (0) in case of success, otherwise TRUE (non-zero)
See alsoCudaOptiVec.htm, chapter 3,   cudaV_pinnedNfree,   cudaV_pinnedFreeAll,   cudaVF_pinnedVector

 

cudaV_pinnedFreeAll
FunctioncudaOptiVec only: De-allocate all pinned host-memory vectors (and matrices)
CUDA function C/C++#include <cudaVecLib.h>
int cudaV_pinnedFreeAll( void );
CUDA function Pascal/Delphiuses VecLib;
function cudaV_pinnedFreeAll: IntBool;
DescriptionAll pinned host-memory vectors and matrices previously allocated by one of the functions of the cudaVF_pinnedVector,   or cudaMF_pinnedMatrix families are freed.
Error handlingnone
Return valueFALSE (0), in case of success, otherwise TRUE (non-zero)
See alsoCudaOptiVec.htm, chapter 3,   cudaV_pinnedFree,   cudaV_pinnedNfree,   cudaVF_pinnedVector

 

cudaV_pinnedNfree
FunctionDe-allocate pinned host memory occupied by one or more vectors.
CUDA function C/C++#include <cudaVecLib.h>
int cudaV_pinnedNfree( unsigned numfree, ... );
DescriptionThe parameter numfree "tells" the function how many vectors it has to free. The host pointers of these vectors follow in the parameter list after numfree. Only vectors which have been allocated by one of the functions of the cudaVF_pinnedVector or cudaVF_pinnedVector0 family can be de-allocated by cudaV_pinnedNfree.
If device pointers are mistakenly used rather than the host pointers, an error message is displayed.
Pascal/Delphi: since a variable number of parameters is not supported in Pascal language, this function is missing.
Example C/C++cudaV_pinnedNfree( 3, h_X, h_Y, h_Z );
Return valueFALSE (0) in case of success, otherwise TRUE (non-zero)
See alsoCudaOptiVec.htm, chapter 3,   cudaV_pinnedFree,   cudaV_pinnedFreeAll,   cudaVF_pinnedVector,   cudaVF_pinnedVector0

 

cudaVF_pinnedVectorcudaVD_pinnedVectorcudaVE_pinnedVector
cudaVCF_pinnedVectorcudaVCD_pinnedVectorcudaVCE_pinnedVector
cudaVPF_pinnedVectorcudaVPD_pinnedVectorcudaVPE_pinnedVector
cudaVI_pinnedVectorcudaVBI_pinnedVectorcudaVSI_pinnedVector
cudaVLI_pinnedVectorcudaVQI_pinnedVector 
cudaVU_pinnedVectorcudaVUB_pinnedVectorcudaVUS_pinnedVector
cudaVUL_pinnedVectorcudaVUQ_pinnedVectorcudaVUI_pinnedVector
FunctionAllocation of pinned host memory
CUDA function C/C++#include <cudaVFstd.h>
fVector cudaVF_pinnedVector( fVector *h_X, ui size );
CUDA function Pascal/Delphiuses VecLib;
function cudaVF_pinnedVector( var h_X:fVector; size:UIntSize ): fVector;
DescriptionPinned host memory is allocated. The device pointer is returned, and the host pointer is stored as h_X. In order to release the memory thus allocated, use cudaV_pinnedFree,   cudaV_pinnedFreeAll, or cudaV_pinnedNfree (the latter only in C/C++).
See CudaOptiVec.htm, chapter 3 for a description of the various memory types of cudaOptiVec routines.
Error handlingIf there is not enough memory available, or if size is zero, an error message "Not enough memory" is displayed and the program aborted.
Return valueDevice pointer to the allocated memory
See alsoCudaOptiVec.htm, chapter 3,   cudaVF_pinnedVector0

 

cudaVF_pinnedVector0cudaVD_pinnedVector0cudaVE_pinnedVector0
cudaVCF_pinnedVector0cudaVCD_pinnedVector0cudaVCE_pinnedVector0
cudaVPF_pinnedVector0cudaVPD_pinnedVector0cudaVPE_pinnedVector0
cudaVI_pinnedVector0cudaVBI_pinnedVector0cudaVSI_pinnedVector0
cudaVLI_pinnedVector0cudaVQI_pinnedVector0 
cudaVU_pinnedVector0cudaVUB_pinnedVector0cudaVUS_pinnedVector0
cudaVUL_pinnedVector0cudaVUQ_pinnedVector0cudaVUI_pinnedVector0
FunctionAllocation of pinned host memory and initialisation with 0
CUDA function C/C++#include <cudaVFstd.h>
fVector cudaVF_pinnedVector0( fVector *h_X, ui size );
CUDA function Pascal/Delphiuses VecLib;
function cudaVF_pinnedVector0( var h_X:fVector; size:UIntSize ): fVector;
DescriptionPinned host memory is allocated and initialized with 0. The device pointer is returned, and the host pointer is stored as h_X. In order to release the memory thus allocated, use cudaV_pinnedFree,   cudaV_pinnedFreeAll, or cudaV_pinnedNfree (the latter only in C/C++).
See CudaOptiVec.htm, chapter 3 for a description of the various memory types of cudaOptiVec routines.
Error handlingIf there is not enough memory available, or if size is zero, an error message "Not enough memory" is displayed and the program aborted.
Return valueDevice pointer to the allocated memory
See alsoCudaOptiVec.htm, chapter 3,   cudaVF_pinnedVector

 

VCF_polarVCD_polarVCE_polar
VPF_polarVPD_polarVPE_polar
FunctionConstruct a Cartesian or polar complex vector from polar coordinates given as separate vectors.
Syntax C/C++#include <VCFstd>
void VCF_polar( cfVector X, fVector Mag, fVector Arg, ui size );
C++ VecObj#include <OptiVec.h>
void vector<complex<T>>::polar( const vector<T>& Mag, const vector<T>& Arg );
Pascal/Delphiuses VCFstd;
procedure VCF_polar( X:cfVector; Mag, Arg:fVector; size:UIntSize);
CUDA function C/C++#include <cudaVCFstd.h>
int cudaVCF_polar( cfVector d_X, fVector d_Mag, fVector d_Arg, ui size );
void VCFcu_polar( cfVector h_X, fVector h_Mag, fVector h_Arg, ui size );
CUDA function Pascal/Delphiuses VCFstd;
function cudaVCF_polar( d_X:cfVector; d_Mag, d_Arg:fVector; size:UIntSize): IntBool;
procedure VCFcu_polar( h_X:cfVector; h_Mag, h_Arg:fVector; size:UIntSize);
DescriptionIdentical to VF_PolartoC etc. See these functions for details.

 

VF_PolartoCVD_PolartoCVE_PolartoC
FunctionConstruct Cartesian complex numbers from polar coordinates, entered as separate vectors for Mag and Arg.
Syntax C/C++#include <VCFstd.h>
void VF_PolartoC( cfVector X, fVector Mag, fVector Arg, ui size );
C++ VecObj#include <OptiVec.h>
void vector<complex<T>>::PolartoC( const vector<T>& Mag, const vector<T>& Arg );
Pascal/Delphiuses VCFstd;
procedure VF_PolartoC( X:cfVector; Mag, Arg:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVCFstd.h>
int cudaVF_PolartoC( cfVector d_X, fVector d_Mag, fVector d_Arg, ui size );
void VFcu_PolartoC( cfVector h_X, fVector h_Mag, fVector h_Arg, ui size );
CUDA function Pascal/Delphiuses VCFstd;
function cudaVF_PolartoC( d_X:cfVector; d_Mag, d_Arg:fVector; size:UIntSize): IntBool;
procedure VFcu_PolartoC( h_X:cfVector; h_Mag, h_Arg:fVector; size:UIntSize);
DescriptionThe polar coordinates Mag (magnitude, absolute value) and Arg (argument, angle) of each element are used to construct the Cartesian complex vector X.
The difference between this function and VF_PtoC is that, in the latter, the input consists of one vector of type pfVector, rather than of two real-valued vectors for Mag and Arg.
Error handlingThe total loss of precision for very large values of Arg is treated tacitly (without an error message); if it occurs, the result is set to {Mag, 0}.
Return valuenone
See alsoVF_PtoC,   VF_CtoPolar,   VF_ReImtoC,   VF_CtoArg,   VF_CtoNorm

 

VF_polyVD_polyVE_poly
VF_poly_dVF_poly_eVD_poly_e
VFx_polyVDx_polyVEx_poly
VFx_poly_dVFx_poly_eVDx_poly_e
VF_polyOddVD_polyOddVE_polyOdd
VF_polyOdd_dVF_polyOdd_eVD_polyOdd_e
VFx_polyOddVDx_polyOddVEx_polyOdd
VFx_polyOdd_dVFx_polyOdd_eVDx_polyOdd_e
VF_polyEvenVD_polyEvenVE_polyEven
VF_polyEven_dVF_polyEven_eVD_polyEven_e
VFx_polyEvenVDx_polyEvenVEx_polyEven
VFx_polyEven_dVFx_polyEven_eVDx_polyEven_e
FunctionPolynomial
Syntax C/C++#include <VFmath.h>
int VF_poly( fVector Y, fVector X, ui size, fVector Coeff, unsigned deg );
int VFx_poly( fVector Y, fVector X, ui size, fVector Coeff, unsigned deg, float A, float B );
int VFu_poly( fVector Y, fVector X, ui size, fVector Coeff, unsigned deg );
int VFux_poly( fVector Y, fVector X, ui size, fVector Coeff, unsigned deg, float A, float B );
C++ VecObj#include <OptiVec.h>
int vector<T>::poly( const vector<T>& X, const vector<T>& Coeff, unsigned deg );
int vector<T>::x_poly( const vector<T>& X, const vector<T>& Coeff, unsigned deg, const T& A, const T& B );
Pascal/Delphiuses VFmath;
function VF_poly( Y, X:fVector; size:UIntSize; Coeff:fVector; deg:UInt ): IntBool;
function VFx_poly( Y, X:fVector; size:UIntSize; Coeff:fVector; deg:UInt; A, B:Single ): IntBool;
function VFu_poly( Y, X:fVector; size:UIntSize; Coeff:fVector; deg:UInt ): IntBool;
function VFux_poly( Y, X:fVector; size:UIntSize; Coeff:fVector; deg:UInt; A, B:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_poly( fVector d_Y, fVector d_X, ui size, fVector h_Coeff, unsigned deg );
int cusdVF_poly( fVector d_Y, fVector d_X, ui size, fVector d_Coeff, unsigned deg );
int cudaVFx_poly( fVector d_Y, fVector d_X, ui size, fVector h_Coeff, unsigned deg, float A, float B );
int cusdVFx_poly( fVector d_Y, fVector d_X, ui size, fVector d_Coeff, unsigned deg, float *d_A, float *d_B );
int cudaVFu_poly( fVector d_Y, fVector d_X, ui size, fVector h_Coeff, unsigned deg );
int cusdVFu_poly( fVector d_Y, fVector d_X, ui size, fVector d_Coeff, unsigned deg );
int cudaVFux_poly( fVector d_Y, fVector d_X, ui size, fVector h_Coeff, unsigned deg, float A, float B );
int cusdVFux_poly( fVector d_Y, fVector d_X, ui size, fVector d_Coeff, unsigned deg, float *d_A, float *d_B );
int VFcu_poly( fVector h_Y, fVector h_X, ui size, fVector h_Coeff, unsigned deg );
int VFxcu_poly( fVector h_Y, fVector h_X, ui size, fVector h_Coeff, unsigned deg, float A, float B );
int VFucu_poly( fVector h_Y, fVector h_X, ui size, fVector h_Coeff, unsigned deg );
int VFuxcu_poly( fVector h_Y, fVector h_X, ui size, fVector h_Coeff, unsigned deg, float A, float B );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_poly( d_Y, d_X:fVector; size:UIntSize; h_Coeff:fVector; deg:UInt ): IntBool;
function cusdVF_poly( d_Y, d_X:fVector; size:UIntSize; d_Coeff:fVector; deg:UInt ): IntBool;
function cudaVFx_poly( d_Y, d_X:fVector; size:UIntSize; h_Coeff:fVector; deg:UInt; A, B:Single ): IntBool;
function cusdVFx_poly( d_Y, d_X:fVector; size:UIntSize; d_Coeff:fVector; deg:UInt; d_A, d_B:PSingle ): IntBool;
function cudaVFu_poly( d_Y, d_X:fVector; size:UIntSize; h_Coeff:fVector; deg:UInt ): IntBool;
function cusdVFu_poly( d_Y, d_X:fVector; size:UIntSize; d_Coeff:fVector; deg:UInt ): IntBool;
function cudaVFux_poly( d_Y, d_X:fVector; size:UIntSize; h_Coeff:fVector; deg:UInt; A, B:Single ): IntBool;
function cusdVFux_poly( d_Y, d_X:fVector; size:UIntSize; d_Coeff:fVector; deg:UInt; d_A, d_B:PSingle ): IntBool;
function VFcu_poly( h_Y, h_X:fVector; size:UIntSize; h_Coeff:fVector; deg:UInt ): IntBool;
function VFxcu_poly( h_Y, h_X:fVector; size:UIntSize; h_Coeff:fVector; deg:UInt; A, B:Single ): IntBool;
function VFucu_poly( h_Y, h_X:fVector; size:UIntSize; h_Coeff:fVector; deg:UInt ): IntBool;
function VFuxcu_poly( h_Y, h_X:fVector; size:UIntSize; h_Coeff:fVector; deg:UInt; A, B:Single ): IntBool;
Descriptionsimple versions VF_poly, VD_poly, VE_poly:
Yi = c0 + c1 * Xi + c2 * Xi2 + ... + cn * Xin
expanded versions VFx_poly, VDx_poly, VEx_poly:
xi = (A*Xi + B),
Yi = c0 + c1 * xi + c2 * xi2 + ... + cn * xin

A polynomial of degree deg is generated for every element of X, using the coefficients contained in the vector Coeff. The coefficients in Coeff have to be ordered in such a way that the constant term is the zero'th element, the linear coefficient the first element etc., up to the deg'th element which is the coefficient for the highest power used in the polynomial. (Beware a frequent source of errors: for a polynomial of deg = 4, there are 5 (!) coefficients; do not forget the constant term).

"unprotected" versions (prefix VFu_,   VFux_, etc.):
These functions do not perform any error handling, which makes them much faster (up to 50%) than the standard versions.

As polynomials are prone to overflow, sometimes also intermediate overflow, while the end result could still be legal, additional versions offer the internal calculation to be made in higher precision: VF_poly_d and VF_poly_e work in double or extended precision, resp., before converting the result back to single precision. Likewise, VD_poly_e works in extended precision (even if the compiler does not support extended precision!), before converting the result back to double. These versions exist only on the CPU, not in CUDA.

For polynomials consisting of odd terms only (like the polynomial representation of the sine function) or of even terms only (like the polynomial representation of the cosine function), special versions are provided:
VF_polyOdd:
Yi = c1 * Xi + c1 * Xi3 + ... + c(2n+1) * Xi2n+1
Coeff here contains (deg+1)/2 coefficients: c1, c3, c5 etc.

VF_polyEven:
Yi = c0 + c2 * Xi2 + ... + c2n * Xi2n
Coeff here contains (deg/2)+1 coefficients: c0, c2, c4 etc.

Error handlingOVERFLOW errors lead to ±HUGE_VAL as the default result. In contrast to the ANSI C function poly (where deg is declared as int), the declaration of deg as unsigned precludes DOMAIN errors (which would occur for negative deg).
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_ratio,   VF_ipow,   VF_pow,   poly

 

VF_polyinterpolVD_polyinterpolVE_polyinterpol
FunctionPolynomial interpolation of X-Y-table values
Syntax C/C++#include <VFstd.h>
void VF_polyinterpol( fVector Y, fVector X, ui sizex, fVector XTab, fVector YTab, ui sizetab, unsigned deg );
C++ VecObj#include <OptiVec.h>
void vector<T>::polyinterpol( const vector<T>& X, const vector<T>& XTab, const vector<T>& YTab, unsigned deg );
Pascal/Delphiuses VFstd;
procedure VF_polyinterpol( Y, X:fVector; sizex:UIntSize; XTab, YTab:fVector; sizetab:UIntSize; deg:UInt );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_polyinterpol( fVector d_Y, fVector d_X, ui sizex, fVector d_XTab, fVector d_YTab, ui sizetab, unsigned deg );
void VFcu_polyinterpol( fVector h_Y, fVector h_X, ui sizex, fVector h_XTab, fVector h_YTab, ui sizetab, unsigned deg );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_polyinterpol( d_Y, d_X:fVector; sizex:UIntSize; d_XTab, d_YTab:fVector; sizetab:UIntSize; deg:UInt ): IntBool;
procedure VFcu_polyinterpol( h_Y, h_X:fVector; sizex:UIntSize; h_XTab, h_YTab:fVector; sizetab:UIntSize; deg:UInt );
DescriptionFor each of the sizex elements of X, the corresponding element of Y is interpolated from the XTab-YTab value pairs. XTab must be ordered (either ascending or descending). All values of XTab must be distinct; otherwise a division by zero may occur and lead to a program abort. For each element of X, the routine first locates the appropriate place in the table from which to start the interpolation. The parameter deg denotes the number of points that will be taken into account for the interpolation (this is not the degree of the interpolating polynomial!). Any value between 0 and 2 will be interpreted as meaning linear interpolation. A maximum of 10-point interpolation is possible. deg may not be larger than sizetab−1.
Error handlingTrying to use too many elements for the interpolation (deg > 10) leads to an error message "Not possible with more than 10 elements" and to a program abort. If deg exceeds sizetab−1, an error message "Invalid parameter(s)" is displayed and the program aborted.
No other errors are detected (you have to take care yourself that the XTab values are distinct and that the YTab values are not near the limit of overflowing).
Return valuenone
See alsoVF_ratinterpol,   VF_splineinterpol

 

VF_powVD_powVE_pow
VCF_powVCD_powVCE_pow
VFx_powVDx_powVEx_pow
VCFx_powVCDx_powVCEx_pow
VCF_powReExpoVCD_powReExpoVCE_powReExpo
VCFx_powReExpoVCDx_powReExpoVCEx_powReExpo
VPF_powReExpoVPD_powReExpoVPE_powReExpo
FunctionRaise each element of a vector to a specified power
Syntax C/C++#include <VFmath.h>
int VF_pow( fVector Y, fVector X, ui size, float Expo );
int VFx_pow( fVector Y, fVector X, ui size, float Expo, float A, float B, float C );
int VCF_pow( cfVector Y, cfVector X, ui size, fComplex Expo );
int VCFx_pow( cfVector Y, cfVector X, ui size, fComplex Expo, fComplex A, fComplex B, fComplex C );
int VCF_powReExpo( cfVector Y, cfVector X, ui size, float Expo );
int VCFx_powReExpo( cfVector Y, cfVector X, ui size, float Expo, fComplex A, fComplex B, fComplex C );
C++ VecObj#include <OptiVec.h>
int vector<T>::pow( const vector<T>& X, const T& Expo );
int vector<T>::x_pow( const vector<T>& X, const T& Expo, const T& A, const T& B, const T& C );
int vector<complex<T>>::pow( const vector<complex<T>>& X, complex<T> Expo );
int vector<complex<T>>::x_pow( const vector<complex<T>>& X, complex<T> Expo, complex<T> A, complex<T> B, complex<T> C );
int vector<complex<T>>::powReExpo( const vector<complex<T>>& X, const T& Expo );
int vector<complex<T>>::x_powReExpo( const vector<complex<T>>& X, const T& Expo, complex<T> A, complex<T> B, complex<T> C );
Pascal/Delphiuses VFmath;
function VF_pow( Y, X:fVector; size:UIntSize; Expo:Single ): IntBool;
function VFx_pow( Y, X:fVector; size:UIntSize; Expo, A, B, C:Single ): IntBool;
function VCF_pow( Y, X:cfVector; size:UIntSize; Expo:fComplex ): IntBool;
function VCF_powReExpo( Y, X:cfVector; size:UIntSize; Expo:Single ): IntBool;
function VCFx_powReExpo( Y, X:cfVector; size:UIntSize; Expo:Single; A, B, C:fComplex ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_pow( fVector d_Y, fVector d_X, ui size, float Expo );
int cudaVFx_pow( fVector d_Y, fVector d_X, ui size, float Expo, float A, float B, float C );
int cusdVFx_pow( fVector d_Y, fVector d_X, ui size, float Expo, float *_dA, float *d_B, float *d_C );
int VFcu_pow( fVector h_Y, fVector h_X, ui size, float Expo );
int VFxcu_pow( fVector h_Y, fVector h_X, ui size, float Expo, float A, float B, float C );
 
#include <cudaVCFmath.h>
int cudaVCF_pow( cfVector d_Y, cfVector d_X, ui size, fComplex Expo );
int cudaVCFx_pow( cfVector d_Y, cfVector d_X, ui size, fComplex Expo, fComplex A, fComplex B, fComplex C );
int cusdVCFx_pow( cfVector d_Y, cfVector d_X, ui size, fComplex Expo, fComplex *d_A, fComplex *d_B, fComplex *d_C );
int cudaVCF_powReExpo( cfVector d_Y, cfVector d_X, ui size, float Expo );
int cudaVCFx_powReExpo( cfVector d_Y, cfVector d_X, ui size, float Expo, fComplex A, fComplex B, fComplex C );
int cusdVCFx_powReExpo( cfVector d_Y, cfVector d_X, ui size, float Expo, fComplex *d_A, fComplex *d_B, fComplex *d_C );
int VCFcu_pow( cfVector h_Y, cfVector h_X, ui size, fComplex Expo );
int VCFxcu_pow( cfVector h_Y, cfVector h_X, ui size, fComplex Expo, fComplex A, fComplex B, fComplex C );
int VCFcu_powReExpo( cfVector h_Y, cfVector h_X, ui size, float Expo );
int VCFxcu_powReExpo( cfVector h_Y, cfVector h_X, ui size, float Expo, fComplex A, fComplex B, fComplex C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_pow( d_Y, d_X:fVector; size:UIntSize; Expo:Single ): IntBool;
function cudaVFx_pow( d_Y, d_X:fVector; size:UIntSize; Expo:Single; A, B, C:Single ): IntBool;
function cusdVFx_pow( d_Y, d_X:fVector; size:UIntSize; Expo:Single; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_pow( h_Y, h_X:fVector; size:UIntSize; Expo:Single ): IntBool;
function VFxcu_pow( h_Y, h_X:fVector; size:UIntSize; Expo:Single; A, B, C:Single ): IntBool;
 
uses VCFmath;
int cudaVCF_pow( cfVector d_Y, cfVector d_X, ui size, fComplex Expo );
int cudaVCFx_pow( cfVector d_Y, cfVector d_X, ui size, fComplex Expo, fComplex A, fComplex B, fComplex C );
int cusdVCFx_pow( cfVector d_Y, cfVector d_X, ui size, fComplex Expo, fComplex *d_A, fComplex *d_B, fComplex *d_C );
int cudaVCF_powReExpo( cfVector d_Y, cfVector d_X, ui size, float Expo );
int cudaVCFx_powReExpo( cfVector d_Y, cfVector d_X, ui size, float Expo, fComplex A, fComplex B, fComplex C );
int cusdVCFx_powReExpo( cfVector d_Y, cfVector d_X, ui size, float Expo, fComplex *d_A, fComplex *d_B, fComplex *d_C );
int VCFcu_pow( cfVector h_Y, cfVector h_X, ui size, fComplex Expo );
int VCFxcu_pow( cfVector h_Y, cfVector h_X, ui size, fComplex Expo, fComplex A, fComplex B, fComplex C );
int VCFcu_powReExpo( cfVector h_Y, cfVector h_X, ui size, float Expo );
int VCFxcu_powReExpo( cfVector h_Y, cfVector h_X, ui size, float Expo, fComplex A, fComplex B, fComplex C );
Descriptionsimple versions: Yi = Xi Expo
expanded versions: Yi = C * ((A*Xi+B) Expo)
If Expo is a moderately small integer number, the functions of this family pass the job to the appropriate routine of the VF_ipow family. More efficiently, the user could do just that himself.
The complex version exists in two variants: one for complex exponents, the other for complex numbers raised to a real exponent.
Error handlingDOMAIN errors occur, if negative numbers are raised to fractional powers; the default result is NAN ("not-a-number"). SING errors occur, if zero is raised to a negative power; the default result is ±HUGE_VAL, which is true for OVERFLOW errors as well.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_ipow,   VF_poly,   VF_pow2,   VF_exp,   VF_powexp,   pow

 

VF_pow10VD_pow10VE_pow10
VFx_pow10VDx_pow10VEx_pow10
FunctionReal powers of 10
Syntax C/C++#include <VFmath.h>
int VF_pow10( fVector Y, fVector X, ui size );
int VFx_pow10( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::pow10( const vector<T>& X );
int vector<T>::x_pow10( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_pow10( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_pow10( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_pow10( fVector d_Y, fVector d_X, ui size );
int cudaVFx_pow10( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_pow10( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_pow10( fVector h_Y, fVector h_X, ui size );
int VFxcu_pow10( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_pow10( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_pow10( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_pow10( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_pow10( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_pow10( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = 10.0 Xi
expanded versions: Yi = C * 10.0A*Xi+B
This is an exponential function to the basis of 10.0.
Error handlingOVERFLOW errors lead to a default result of ±HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_ipow10,   VF_scale10,   VF_log10,   VF_pow,   VF_exp,   pow10

 

VF_pow2VD_pow2VE_pow2
VFx_pow2VDx_pow2VEx_pow2
FunctionReal powers of 2
Syntax C/C++#include <VFmath.h>
int VF_pow2( fVector Y, fVector X, ui size );
int VFx_pow2( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::pow2( const vector<T>& X );
int vector<T>::x_pow2( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_pow2( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_pow2( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_pow2( fVector d_Y, fVector d_X, ui size );
int cudaVFx_pow2( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_pow2( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_pow2( fVector h_Y, fVector h_X, ui size );
int VFxcu_pow2( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_pow2( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_pow2( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_pow2( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_pow2( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_pow2( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = 2.0 Xi
expanded versions: Yi = C * 2.0A*Xi+B
This is an exponential function to the basis of 2.0.
Error handlingOVERFLOW errors lead to a default result of ±HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_ipow2,   VF_scale2,   VF_log2,   VF_pow,   VF_exp,   pow

 

VF_powexpVD_powexpVE_powexp
VFx_powexpVDx_powexpVEx_powexp
FunctionPower function, multiplied by exponential function
Syntax C/C++#include <VFmath.h>
int VF_powexp( fVector Y, fVector X, ui size, float Expo );
int VFx_powexp( fVector Y, fVector X, ui size, float Expo, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::powexp( const vector<T>& X, const T& Expo );
int vector<T>::x_powexp( const vector<T>& X, const T& Expo, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_powexp( Y, X:fVector; size:UIntSize; Expo:Single ): IntBool;
function VFx_powexp( Y, X:fVector; size:UIntSize; Expo, A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_powexp( fVector d_Y, fVector d_X, ui size, float Expo );
int cudaVFx_powexp( fVector d_Y, fVector d_X, ui size, float Expo, float A, float B, float C );
int cusdVFx_powexp( fVector d_Y, fVector d_X, ui size, float Expo, float *_dA, float *d_B, float *d_C );
int VFcu_powexp( fVector h_Y, fVector h_X, ui size, float Expo );
int VFxcu_powexp( fVector h_Y, fVector h_X, ui size, float Expo, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_powexp( d_Y, d_X:fVector; size:UIntSize; Expo:Single ): IntBool;
function cudaVFx_powexp( d_Y, d_X:fVector; size:UIntSize; Expo:Single; A, B, C:Single ): IntBool;
function cusdVFx_powexp( d_Y, d_X:fVector; size:UIntSize; Expo:Single; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_powexp( h_Y, h_X:fVector; size:UIntSize; Expo:Single ): IntBool;
function VFxcu_powexp( h_Y, h_X:fVector; size:UIntSize; Expo:Single; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = XiExpo * exp(Xi)
expanded versions: Yi = C * (XiExpo) * exp(A*Xi+B)

Note for the expanded versions that (A*Xi+B) is taken only as the argument of the exponential function, whereas the power function is calculated for (Xi).
The implementation of this function guarantees the correct cancellation of potential simultaneous overflow and underflow of the two constituting factors (for large Xi, if either Expo or A*Xi – but not both – are negative, so that either the power function or the exponential function would yield a very small result, while the other would yield an overflowing result).
In contrast to VF_pow, negative X values in the power function always lead to a DOMAIN error, even if Expo is an integer.

Error handlingDOMAIN errors are caused by negative Xi; the default result is NAN ("not-a-number"). SING errors occur, if zero is raised to a negative power; the default result is ±HUGE_VAL, which is true for OVERFLOW errors as well.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_pow,   VF_poly,   VF_exp,   pow,  exp

 

VPF_principalVPD_principalVPE_principal
FunctionReduce polar complex numbers to principal value
Syntax C/C++#include <VPFstd.h>
void VPF_principal( pfVector Y, pfVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<polar<T>>::principal( const vector<polar<T>>& X );
Pascal/Delphiuses VPFstd;
procedure VPF_principal( Y, X:pfVector; size:UIntSize );
CUDA function C/C++#include <cudaVPFstd.h>
int cudaVPF_principal( pfVector d_Y, pfVector d_X, ui size );
void VPFcu_principal( pfVector d_Y, pfVector d_X, ui size );
CUDA function Pascal/Delphiuses VPFstd;
function cudaVPF_principal( h_Y, h_X:pfVector; size:UIntSize ): IntBool;
procedure VPFcu_principal( h_Y, h_X:pfVector; size:UIntSize );
DescriptionThe argument, i.e. the angle of each element is reduced to the range -p < Arg ≤ +p
Error handlingnone
Return valuenone
See alsoVF_MagArgtoPrincipal

 

VF_printVD_printVE_print
VCF_printVCD_printVCE_print
VI_printVBI_printVSI_printVLI_printVQI_print 
VU_printVUB_printVUS_printVUL_printVUQ_printVUI_print
FunctionPrint a vector as ASCII numbers to stdout, assuming a linewidth of 80 characters. Only for console applications.
Syntax C/C++#include <VFstd.h>
void VF_print( fVector X, ui size, unsigned nperline );
C++ VecObj#include <OptiVec.h>
void vector<T>::print( unsigned nperline );
Pascal/Delphiuses VFstd;
procedure VF_print( X:fVector; size:UIntSize; nperline:UInt );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_print( fVector d_X, ui size, unsigned nperline );
int cudaVF_print_buf( fVector d_X, ui size, unsigned nperline, fVector h_Wk );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_print( d_X:fVector; size:UIntSize; nperline:UInt ): IntBool;
function cudaVF_print_buf( d_X:fVector; size:UIntSize; nperline:UInt; h_Wk:fVector ): IntBool;
Descriptionsize elements of X are printed to stdout, nperline in each line.
C/C++: The linewidth is determined by the symbolic constant V_consoleWindowWidth, defined in <VecLib.h> with a default value of 150 characters. If you wish to change this default value, either change it in <VecLib.h> or write #define V_consoleWindowWidth xxxx before you #include <VecLib.h>.
Pascal/Delphi: The linewidth is determined by the variable V_consoleWindowWidth in the unit VecLib with a default value of 150 characters. If you wish to change this default value, you may simply assign a new value to V_consoleWindowWidth, e.g., V_consoleWindowWidth := 80;

Each line begins with the index of the first element printed into that line. The index is followed by a colon and by the requested nperline elements.

Cartesian complex numbers are printed in braces, with the real and imaginary parts separated by a komma: {Re, Im}. Polar complex numbers are also written in braces, with the Mag and Arg parts separated by an at-sign: {Mag @ Arg}.

In contrast to VF_cprint, no paging is performed.
The number of digits per element is determined by the available space, which depends in turn on nperline.

This family of functions can be used only for console applications.

Error handlingIf nperline exceeds the maximum number of entries possible within 80 characters, an error message "Cannot use requested format (too many entries per line)" is generated; in this case, the program chooses the maximum number nperline possible.

CUDA versions only: cudaV?_print_buf takes a host vector h_Wk as additional argument. The latter serves as buffer memory and needs to be (at least) of the same size as X. By avoiding the need of cudaV?_print to allocate its own buffer memory, cudaV?_print_buf is slightly faster.

Return valuenone
See alsoVF_cprint,   VF_fprint,   VF_write,   VF_store,   printf (C/C++ only)

 

V_printErrorMsg
FunctionPrint an error message.
Syntax C/C++#include <VecLib.h>
void V_printErrorMsg( char *ErrMsg );
Pascal/Delphiuses VecLib;
procedure V_printErrMsg( ErrMsg: PChar );
DescriptionAs described in connection with V_noteError, this function is in charge of printing error messages. By default, output is directed to the screen. The function V_setErrorEventFile may be used to redirect the output into an event file (exclusively or in addition to the screen message). V_printErrorMsg may be called from user-defined routines in which error conditions are detected. If the message is longer than one line, carriage returns ("\n" or "\r\n" for C/C++, #13 for Pascal/Delphi) have to be included at the desired place.
Return valuenone
See alsoV_setErrorEventFile,   V_noteError,   _matherr (C/C++ only)

 

VF_prodVD_prodVE_prod
VCF_prodVCD_prodVCE_prod
VPF_prodVPD_prodVPE_prod
FunctionCalculates the product of all the elements of a vector.
Syntax C/C++#include <VFstd.h>
float VF_prod( fVector X, ui size );
fComplex VCF_prod( cfVector X, ui size );
fPolar VPF_prod( pfVector X, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::prod();
complex<T> vector<complex<T>>::prod();
polar<T> vector<polar<T>>::prod();
Pascal/Delphiuses VFstd;
function VF_prod( X:fVector; size:UIntSize ): Single;
function VCF_prod( X:cfVector; size:UIntSize ):fComplex;
function VPF_prod( X:pfVector; size:UIntSize ):fPolar;

Alternative syntax for the complex types (obsolete, but still supported):
procedure VCF_prod( var Prod:fComplex; X:cfVector; size:UIntSize);
procedure VPF_prod( var Prod:fPolar; X:pfVector; size:UIntSize);
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_prod( float *h_RetVal, fVector d_X, ui size );
int cusdVF_prod( float *d_RetVal, fVector d_X, ui size );
float VFcu_prod( fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_prod( var h_RetVal:Single; d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_prod( d_RetVal:PSingle; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_prod( h_X:fVector; size:UIntSize ): Single;
DescriptionThe product of all elements of a vector is calculated.
Error handlingnone (but be careful: this function may easily overflow!)
Return valuethe product of the vector elements (except complex versions in Pascal/Delphi)
See alsoVF_runprod,   VF_sum

 

VF_PtoAbsVD_PtoAbsVE_PtoAbs
FunctionAbsolute value (magnitude) of polar complex numbers
Syntax C/C++#include <VPFstd.h>
void VF_PtoAbs( fVector Abs, pfVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::PtoAbs( const vector<polar<T>>& X );
Pascal/Delphiuses VPFstd;
procedure VF_PtoAbs( Abs:fVector; X:pfVector; size:UIntSize );
CUDA function C/C++#include <cudaVPFstd.h>
int cudaVF_PtoAbs( fVector d_Abs, pfVector d_X, ui size );
void VFcu_PtoAbs( fVector h_Abs, pfVector h_X, ui size );
CUDA function Pascal/Delphiuses VPFstd;
function cudaVF_PtoAbs( d_Abs:fVector; d_X:pfVector; size:UIntSize ): IntBool;
procedure VF_PtoAbs( h_Abs:fVector; h_X:pfVector; size:UIntSize );
DescriptionThe absolute value, i.e. the magnitude of each element of the polar complex vector X is extracted. This function is identical to VPF_abs and VF_PtoMag. For historical reasons, all three names have been preserved.
Error handlingnone
Return valuenone
See alsoVPF_abs,   VF_PtoMagArg,   VF_PtoArg,   VF_PtoNorm

 

VF_PtoArgVD_PtoArgVE_PtoArg
FunctionArgument (angle) of complex numbers
Syntax C/C++#include <VPFstd.h>
void VF_PtoArg( fVector Arg, pfVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::PtoArg( const vector<polar<T>>& X );
Pascal/Delphiuses VPFstd;
procedure VF_PtoArg( Arg:fVector; X:pfVector; size:UIntSize );
CUDA function C/C++#include <cudaVPFstd.h>
int cudaVF_PtoArg( fVector d_Arg, pfVector d_X, ui size );
void VFcu_PtoArg( fVector h_Arg, pfVector h_X, ui size );
CUDA function Pascal/Delphiuses VPFstd;
function cudaVF_PtoArg( d_Arg:fVector; d_X:pfVector; size:UIntSize ): IntBool;
procedure VF_PtoArg( h_Arg:fVector; h_X:pfVector; size:UIntSize );
DescriptionThe argument, i.e. the angle of each element is extracted from the polar complex vector X. In contrast to the analogous function for cartesian complex vectors, VF_CtoArg, no normalization of the argument is performed. If the normalized argument is needed, VPF_principal must be called first.
Error handlingnone
Return valuenone
See alsoVF_PtoAbs,   VF_PtoMagArg,   VF_PtoReIm

 

VF_PtoCVD_PtoCVE_PtoC
FunctionTransformation of a polar complex into a cartesian complex vector
Syntax C/C++#include <VPFstd.h>
void VF_PtoC( cfVector Y, pfVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<complex<T>>::PtoC( const vector<polar<T>>& X );
Pascal/Delphiuses VPFstd;
procedure VF_PtoC( Y:cfVector; X:pfVector; size:UIntSize );
CUDA function C/C++#include <cudaVPFstd.h>
int cudaVF_PtoC( cfVector d_Y, pfVector d_X, ui size );
void VFcu_PtoC( cfVector h_Y, pfVector h_X, ui size );
CUDA function Pascal/Delphiuses VPFstd;
function cudaVF_PtoC( d_Abs:cfVector; d_X:pfVector; size:UIntSize ): IntBool;
procedure VF_PtoC( h_Abs:cfVector; h_X:pfVector; size:UIntSize );
DescriptionX is transformed from polar coordinates {Mag @ Arg} into cartesian coordinates {Re, Im}.
Error handlingnone
Return valuenone
See alsoVF_CtoP,   VF_PtoReIm

 

VF_PtoImVD_PtoImVE_PtoIm
FunctionExtract the imaginary part from a polar complex vector.
Syntax C/C++#include <VPFstd.h>
void VF_PtoIm( fVector Im, pfVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::PtoIm( const vector<polar<T>>& X );
Pascal/Delphiuses VPFstd;
procedure VF_PtoIm( Im:fVector; X:pfVector; size:UIntSize );
CUDA function C/C++#include <cudaVPFstd.h>
int cudaVF_PtoIm( fVector d_Im, pfVector d_X, ui size );
void VFcu_PtoIm( fVector h_Im, pfVector h_X, ui size );
CUDA function Pascal/Delphiuses VPFstd;
function cudaVF_PtoIm( d_Im:fVector; d_X:pfVector; size:UIntSize ): IntBool;
procedure VF_PtoIm( h_Im:fVector; h_X:pfVector; size:UIntSize );
DescriptionThe imaginary part of the polar complex vector X is calculated and stored in Im.
Error handlingnone
Return valuenone
See alsoVF_PtoReIm,   VF_ReImtoP

 

VF_PtoMagVD_PtoMagVE_PtoMag
FunctionExtract the magnitudes of complex numbers
Syntax C/C++#include <VPFstd.h>
void VF_PtoMag( fVector Mag, pfVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::PtoMag( const vector<polar<T>>& X );
Pascal/Delphiuses VPFstd;
procedure VF_PtoMag( Mag:fVector; X:pfVector; size:UIntSize );
CUDA function C/C++#include <cudaVPFstd.h>
int cudaVF_PtoMag( fVector d_Mag, pfVector d_X, ui size );
void VFcu_PtoMag( fVector h_Mag, pfVector h_X, ui size );
CUDA function Pascal/Delphiuses VPFstd;
function cudaVF_PtoMag( d_Mag:fVector; d_X:pfVector; size:UIntSize ): IntBool;
procedure VF_PtoMag( h_Mag:fVector; h_X:pfVector; size:UIntSize );
DescriptionThe magnitude of each element is extracted from the polar complex vector X.
Error handlingnone
Return valuenone
See alsoVF_PtoArg

 

VF_PtoMagArgVD_PtoMagArgVE_PtoMagArg
FunctionSplit a polar complex vector into separate vectors for magnitude and argument.
Syntax C/C++#include <VPFstd.h>
void VF_PtoMagArg( fVector Mag, fVector Arg, pfVector X, ui size);
C++ VecObj#include <OptiVec.h>
void vector<T>::PtoMagArg( vector<T> Arg, const vector<polar<T>>& X );
Pascal/Delphiuses VPFstd;
procedure VF_PtoMagArg( Mag, Arg:fVector; X:pfVector; size:UIntSize );
CUDA function C/C++#include <cudaVPFstd.h>
int cudaVF_PtoMagArg( fVector d_Mag, fVector d_Arg, pfVector d_X, ui size );
void VFcu_PtoMagArg( fVector h_Mag, fVector h_Arg, pfVector h_X, ui size );
CUDA function Pascal/Delphiuses VPFstd;
function cudaVF_PtoMagArg( d_Mag, d_Arg:fVector; d_X:pfVector; size:UIntSize ): IntBool;
procedure VF_PtoMagArg( h_Mag, h_Arg:fVector; h_X:pfVector; size:UIntSize );
DescriptionMagnitude and argument of the polar complex vector X are stored in the separate vectors Mag and Arg.
Error handlingnone
Return valuenone
See alsoVF_PtoRe,   VF_MagArgtoP

 

VF_PtoNormVD_PtoNormVE_PtoNorm
FunctionNorm (square of the absolute value) of complex numbers
Syntax C/C++#include <VPFstd.h>
void VF_PtoNorm( fVector Norm, pfVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::PtoNorm( const vector<polar<T>>& X );
Pascal/Delphiuses VPFstd;
procedure VF_PtoNorm( Norm:fVector; X:pfVector; size:UIntSize );
CUDA function C/C++#include <cudaVPFstd.h>
int cudaVF_PtoNorm( fVector d_Norm, pfVector d_X, ui size );
void VFcu_PtoNorm( fVector h_Norm, pfVector h_X, ui size );
CUDA function Pascal/Delphiuses VPFstd;
function cudaVF_PtoNorm( d_Norm:fVector; d_X:pfVector; size:UIntSize ): IntBool;
procedure VF_PtoNorm( h_Norm:fVector; h_X:pfVector; size:UIntSize );
DescriptionNormi = Mag2(Xi)
This definition of the Norm of a complex number is the same as in C++, but it is not consistent with the usual definition in mathematics, where the term "norm" is used as a synomym for "absolute value" or "magnitude". As defined here, the Norm is the square of the absolute value. The absolute value itself is available by the function VPF_abs.
Error handlingnone
Return valuenone
See alsoVF_PtoReIm,   VPF_abs

 

VF_PtoReVD_PtoReVE_PtoRe
FunctionExtracts the real part from a polar complex vector.
Syntax C/C++#include <VPFstd.h>
void VF_PtoRe( fVector Re, pfVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::PtoRe( const vector<polar<T>>& X );
Pascal/Delphiuses VPFstd;
procedure VF_PtoRe( Re:fVector; X:pfVector; size:UIntSize );
CUDA function C/C++#include <cudaVPFstd.h>
int cudaVF_PtoRe( fVector d_Re, pfVector d_X, ui size );
void VFcu_PtoRe( fVector h_Re, pfVector h_X, ui size );
CUDA function Pascal/Delphiuses VPFstd;
function cudaVF_PtoRe( d_Re:fVector; d_X:pfVector; size:UIntSize ): IntBool;
procedure VF_PtoRe( h_Re:fVector; h_X:pfVector; size:UIntSize );
DescriptionThe real part of the polar complex vector X is calculated and stored in Re.
Error handlingnone
Return valuenone
See alsoVF_PtoReIm,   VF_PtoIm

 

VF_PtoReImVD_PtoReImVE_PtoReIm
FunctionReal and imaginary parts of a polar complex vector.
Syntax C/C++#include <VPFstd.h>
void VF_PtoReIm( fVector Re, fVector Im, pfVector X, ui size);
C++ VecObj#include <OptiVec.h>
void vector<T>::PtoReIm( vector<T> Im, const vector<polar<T>>& X );
Pascal/Delphiuses VPFstd;
procedure VF_PtoReIm( Re, Im:fVector; X:pfVector; size:UIntSize );
CUDA function C/C++#include <cudaVPFstd.h>
int cudaVF_PtoReIm( fVector d_Re, fVector d_Im, pfVector d_X, ui size );
void VFcu_PtoReIm( fVector h_Re, fVector h_Im, pfVector h_X, ui size );
CUDA function Pascal/Delphiuses VPFstd;
function cudaVF_PtoReIm( d_Re, d_Im:fVector; d_X:pfVector; size:UIntSize ): IntBool;
procedure VF_PtoReIm( h_Re, h_Im:fVector; h_X:pfVector; size:UIntSize );
DescriptionThe polar complex vector X is transformed into cartesian coordinates, which are stored in separate vectors Re and Im.
Error handlingnone
Return valuenone
See alsoVF_PtoRe,   VF_ReImtoP

 

VF_quarticVD_quarticVE_quartic
VFx_quarticVDx_quarticVEx_quartic
VFu_quarticVDu_quarticVEu_quartic
VFux_quarticVDux_quarticVEux_quartic
VCF_quarticVCD_quarticVCE_quartic
VCFx_quarticVCDx_quarticVCEx_quartic
VCFu_quarticVCDu_quarticVCEu_quartic
VCFux_quarticVCDux_quarticVCEux_quartic
VPF_quarticVPD_quarticVPE_quartic
VPFu_quarticVPDu_quarticVPEu_quartic
FunctionFourth power
Syntax C/C++#include <VFmath.h>
int VF_quartic( fVector Y, fVector X, ui size );
int VFx_quartic( fVector Y, fVector X, ui size, float A, float B );
int VFu_quartic( fVector Y, fVector X, ui size );
int VFux_quartic( fVector Y, fVector X, ui size, float A, float B );
C++ VecObj#include <OptiVec.h>
int vector<T>::quartic( const vector<T>& X );
int vector<T>::x_quartic( const vector<T>& X, const T& A, const T& B );
int vector<T>::u_quartic( const vector<T>& X );
int vector<T>::ux_quartic( const vector<T>& X, const T& A, const T& B );
Pascal/Delphiuses VFmath;
function VF_quartic( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_quartic( Y, X:fVector; size:UIntSize; A, B:Single ): IntBool;
function VFu_quartic( Y, X:fVector; size:UIntSize ): IntBool;
function VFux_quartic( Y, X:fVector; size:UIntSize; A, B:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_quartic( fVector d_Y, fVector d_X, ui size );
int cudaVFx_quartic( fVector d_Y, fVector d_X, ui size, float A, float B );
int cusdVFx_quartic( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B );
int VFucu_quartic( fVector h_Y, fVector h_X, ui size );
int VFuxcu_quartic( fVector h_Y, fVector h_X, ui size, float A, float B );
int cudaVFu_quartic( fVector d_Y, fVector d_X, ui size );
int cudaVFux_quartic( fVector d_Y, fVector d_X, ui size, float A, float B );
int cusdVFux_quartic( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B );
int VFucu_quartic( fVector h_Y, fVector h_X, ui size );
int VFuxcu_quartic( fVector h_Y, fVector h_X, ui size, float A, float B );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_quartic( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_quartic( d_Y, d_X:fVector; size:UIntSize; A, B:Single ): IntBool;
function cusdVFx_quartic( d_Y, d_X:fVector; size:UIntSize; d_A, d_B:PSingle ): IntBool;
function VFcu_quartic( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_quartic( h_Y, h_X:fVector; size:UIntSize; A, B:Single ): IntBool;
function cudaVFu_quartic( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFux_quartic( d_Y, d_X:fVector; size:UIntSize; A, B:Single ): IntBool;
function cusdVFux_quartic( d_Y, d_X:fVector; size:UIntSize; d_A, d_B:PSingle ): IntBool;
function VFucu_quartic( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFuxcu_quartic( h_Y, h_X:fVector; size:UIntSize; A, B:Single ): IntBool;
Descriptionsimple versions: Yi = Xi4
expanded versions: Yi = (A*Xi+B)4
The fourth power of the elements of X is stored in Y.
The "unprotected" versions (prefix VFu_,   VFux_, etc.) do not perform any error handling, which makes them much faster than the standard versions. The extended-precision complex (VCEu_ and VCEux_) versions do not take some of the security measures present in the standard version and might fail for results very near the overflow limit; results near the underflow limit might be rendered as 0.
Error handlingOVERFLOW errors lead to a default result of HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_square,   VF_cubic,   VF_rquartic,   VF_sqrt,   VF_pow,   VF_ipow,   VF_poly

 

VF_rampVD_rampVE_ramp
VCF_rampVCD_rampVCE_ramp
VI_rampVBI_rampVSI_rampVLI_rampVQI_ramp 
VU_rampVUB_rampVUS_rampVUL_rampVUQ_rampVUI_ramp
FunctionInitialize a vector with an ascending or descending "ramp".
Syntax C/C++#include <VFstd.h>
void VF_ramp( fVector X, ui size, float Start, float Rise );

    (similarly VD_,   VE_,   VCF_,   VCD_,   VCE_,   VI_, etc.)
void VU_ramp( uVector X, ui size, unsigned Start, int Rise );
    (similarly VUB_,   VUS_,   VUL_)
C++ VecObj#include <OptiVec.h>
void vector<T>::ramp( T Start, T Rise );
void vector<unsigned>::ramp( unsigned Start, int Rise );
Pascal/Delphiuses VFstd;
procedure VF_ramp( X:fVector; size:UIntSize; Start, Rise:Single );

    (similarly VD_,   VE_,   VCF_,   VCD_,   VCE_,   VI_, etc.)
procedure VU_ramp( X:uVector; size:UIntSize; Start:UInt; Rise:Integer );
    (similarly VUB_,   VUS_,   VUL_,   VUQ_)
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_ramp( fVector d_X, ui size, float Start, float Rise );
int cusdVF_ramp( fVector d_X, ui size, float *d_Start, float *d_Rise );
void VFcu_ramp( fVector h_X, ui size, float Start, float Rise );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_ramp( d_X:fVector; size:UIntSize; Start, Rise:Single ): IntBool;
function cusdVF_ramp( d_X:fVector; size:UIntSize; d_Start, d_Rise:PSingle ): IntBool;
procedure VFcu_ramp( h_X:fVector; size:UIntSize; Start, Rise:Single );
DescriptionXi = Start + i * Rise
For the floating-point versions, remember the limited accuracy of floating-point numbers. For example, after calling
VF_ramp( F1, 101, −1.0, 0.01 );
the element F1100 will not be 0.0, as you might wish, but rather something like 2.2E-8. Ths is due to the fact that the number 0.01 (passed as a float to the function) is not exactly representable in the data type float. If that is a problem, consider building the ramp with moderately large integers and dividing by a scaling factor afterwards:
VF_ramp( F1, 101, −100.0, 1.0 );
VF_divC( F1, F1, 101, 100.0 );

Note that Rise is defined as int instead of unsigned in the VU_ version and as long instead of unsigned long in the VUL_ version; this exception from the general rules - that all parameters in one function be of the same data type - allows to create descending ramps of unsigned numbers, which would not be possible otherwise.

Error handlingfloating-point versions: none;
integer versions: see chapter 5.2.
Return valuenone
See alsoVF_Parzen,   VF_Welch,   VF_equ1,   VUI_indramp,   VF_random

 

VF_randomVD_randomVE_random
VCF_randomVCD_randomVCE_random
VI_randomVBI_randomVSI_randomVLI_randomVQI_random 
VU_randomVUB_randomVUS_randomVUL_randomVUQ_randomVUI_random
FunctionHigh-quality random numbers
Syntax C/C++#include <VFstd.h>
long VF_random( fVector X, ui siz, long seed, float MinVal, float MaxVal );
C++ VecObj#include <OptiVec.h>
long vector<T>::random( long seed, T MinVal, T MaxVal );
Pascal/Delphiuses VFstd;
function VF_random( X:fVector; size:UIntSize; seed:LongInt; MinVal, MaxVal:Single ): LongInt;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_random( fVector d_X, ui siz, long seed, float MinVal, float MaxVal );
int cusdVF_random( fVector d_X, ui siz, long seed, float *d_MinVal, float *d_MaxVal );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_random( d_X:fVector; size:UIntSize; seed:LongInt; MinVal, MaxVal:Single ): IntBool;
function cusdVF_random( d_X:fVector; size:UIntSize; seed:LongInt; d_MinVal, d_MaxVal:PSingle ): IntBool;
DescriptionThe X vector is filled with a sequence of random numbers. Within the ranges defined by MinVal and MaxVal (and within the restrictions of floating-point representation in the floating-point versions), all numbers are equally probable (including the extreme values themselves), i.e., so-called "uniform deviates" are produced. The parameter seed may be any number. Successive calls to one and the same of these functions will yield identical sequences, if seed is chosen equal; if seed is chosen differently for successive calls, the results will be uncorrelated.

Internally, these functions employ a random number generator by H.W.Lewis. The smaller data types use a 32-bit generator, while the larger types use a 64-bit version. Additional steps (so-called "Bays-Durham shuffle") are taken to break sequential correlations. This ensures very good randomness. However, as this algorithm is well-known and its state can be inferred from a given series of output numbers, these functions are not suitable for cryptographic applications.

A long value is returned which may be used as new seed for subsequent calls. These calls will, however, not simply continue the series, as the random-number generator will have to run through a new initialization first. If continuity of the series is desired, call VF_randomLC instead.

The CUDA versions of this function do not return a new seed value, but the usual CUDA error flag.
There is no VFcu_ version of this function, as the random numbers are generated on the CPU anyway.

Error handlingnone
Return valuelast 32-bit random number generated; this may be used as a new seed value for future calls.
See alsorand,   srand (C/C++ only),  random,   VF_noise,   VF_randomLC

 

VF_randomLCVD_randomLCVE_randomLC
VCF_randomLCVCD_randomLCVCE_randomLC
VI_randomLCVBI_randomLCVSI_randomLCVLI_randomLCVQI_randomLC 
VU_randomLCVUB_randomLCVUS_randomLCVUL_randomLCVUQ_randomLCVUI_randomLC
FunctionHigh-quality random numbers
Syntax C/C++#include <VFstd.h>
void VF_randomLC( fVector X, ui siz, long seed, float MinVal, float MaxVal, V_RANDOMLCSTATE *state );
C++ VecObj#include <OptiVec.h>
void vector<T>::randomLC( long seed, T MinVal, T MaxVal, V_RANDOMLCSTATE *state );
Pascal/Delphiuses VFstd;
procedure VF_randomLC( X:fVector; size:UIntSize; seed:LongInt; MinVal, MaxVal:Single; state:PV_RANDOMLCSTATE );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_randomLC( fVector d_X, ui siz, long seed, float MinVal, float MaxVal, V_RANDOMLCSTATE *h_state );
int cusdVF_randomLC( fVector d_X, ui siz, long seed, float *d_MinVal, float *d_MaxVal, V_RANDOMLCSTATE *h_state );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_randomLC( d_X:fVector; size:UIntSize; seed:LongInt; MinVal, MaxVal:Single; h_state:PV_RANDOMLCSTATE ): IntBool;
function cusdVF_randomLC( d_X:fVector; size:UIntSize; seed:LongInt; d_MinVal, d_MaxVal:PSingle; h_state:PV_RANDOMLCSTATE ): IntBool;
DescriptionThe X vector is filled with a sequence of random numbers. Within the ranges defined by MinVal and MaxVal (and within the restrictions of floating-point representation in the floating-point versions), all numbers are equally probable (including the extreme values themselves), i.e., so-called "uniform deviates" are produced.

If the parameter seed is any non-zero number, the generator is initialized with that seed value and a new series of random numbers is generated. On the other hand, if you wish to continue a previous series, call this function with seed=0 and with the same parameter state as the previous call. Calls to one and the same of these functions will yield identical sequences, if seed is chosen equal; if seed is chosen differently for successive calls, the results will be uncorrelated.

Internally, these functions employ a linear-congruential (hence the "LC" in the function name) random number generator by H.W. Lewis. The smaller data types use a 32-bit generator, while the larger types use a 64-bit version. Additional steps (so-called "Bays-Durham shuffle") are taken to break sequential correlations. This ensures very good randomness. However, as this algorithm is well-known and its state can be inferred from a given stretch of output numbers, these functions are not suitable for cryptographic applications.

A simplified form of this function is available as VF_random.

Example C/C++#include <VFstd.h>
V_RANDOMLCSTATE MyState;
   // Will hold the state of the generator
VF_randomLC( X, siz/2, −1111, −1.0, +1.0, &MyState );   // Initialisation by seed ≠ 0 and first half of series
VF_randomLC( X, siz-siz/2, 0, −1.0, +1.0, &MyState );   // Continuation of the series by seed = 0
VF_randomLC( Y, siz, −1111, −1.0, +1.0, &MyState );   // identical series in Y as in X by choice of identical seed
VF_randomLC( Z, siz, 234567, −1.0, +1.0, &MyState );   // different series in Z by choice of different seed
Beispiel Pascal/Delphiuses VFstd;
var MyState: V_RANDOMLCSTATE;
   { Will hold the state of the generator }
VF_randomLC( X, siz div 2, −1111, −1.0, +1.0, @MyState );   { Initialisation by seed ≠ 0 and first half of series }
VF_randomLC( X, siz-siz div 2, 0, −1.0, +1.0, @MyState );   { Continuation of the series by seed = 0 }
VF_randomLC( Y, siz, −1111, −1.0, +1.0, @MyState );   { identical series in Y as in X by choice of identical seed }
VF_randomLC( Z, siz, 234567, −1.0, +1.0, @MyState );   { different series in Z by choice of different seed }
Error handlingnone
Return valuenone
See alsorand,   srand (C/C++ only),  random,   VF_noiseLC,   VF_random

 

VF_ratinterpolVD_ratinterpolVE_ratinterpol
FunctionDiagonal-rational interpolation
Syntax C/C++#include <VFmath.h>
void VF_ratinterpol( fVector Y, fVector X, ui sizex, fVector XTab, fVector YTab, ui sizetab, unsigned deg );
C++ VecObj#include <OptiVec.h>
void vector<T>::ratinterpol( const vector<T>& X, const vector<T>& XTab, const vector<T>& YTab, unsigned deg );
Pascal/Delphiuses VFmath;
procedure VF_ratinterpol( Y, X:fVector; sizex:UIntSize; XTab, YTab:fVector; sizetab:UIntSize; deg:UInt );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_ratinterpol( fVector d_Y, fVector d_X, ui sizex, fVector d_XTab, fVector d_YTab, ui sizetab, unsigned deg );
void VFcu_ratinterpol( fVector h_Y, fVector h_X, ui sizex, fVector h_XTab, fVector h_YTab, ui sizetab, unsigned deg );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_ratinterpol( d_Y, d_X:fVector; sizex:UIntSize; d_XTab, d_YTab:fVector; sizetab:UIntSize; deg:UInt ): IntBool;
procedure VFcu_ratinterpol( h_Y, h_X:fVector; sizex:UIntSize; h_XTab, h_YTab:fVector; sizetab:UIntSize; deg:UInt );
DescriptionFor each of the sizex elements of X, the corresponding element of Y is interpolated from the XTab-YTab value pairs. XTab must be ordered (either ascending or descending). All values of XTab must be distinct; otherwise a division by zero may occur and lead to a program abort. The parameter deg denotes the number of points that will be taken into account for the interpolation. The diagonal rational interpolation scheme by Stoer and Bulirsch is used. The interpolating function is formed by the quotient of two polynomials, the polynomial in the denominator being of the same order (for even deg) or of an order higher by one (for odd deg) than the polynomial of the numerator.
For table data points with poles, diagonal rational interpolation is superior to polynomial interpolation. On the other hand, even the slightest round-off error may cause rational interpolation to generate a pole where one would not expect one, especially in extrapolation.
deg must be between 3 and 20.
Error handlingA pole (infinity) in the interpolated function is recognized and leads to a SING error with the proposed result being ±HUGE_VAL. (Note: the x-value passed to _matherr is the first element of XTab). Trying to use too many elements for the interpolation (deg > 20) leads to an error message "Not possible with more than 20 elements" and to a program abort. If deg is not between 3 and 20, or exceeds sizetab−1, an error message "Invalid parameter(s)" is displayed and the program aborted.
Return valuenone
See alsoVF_polyinterpol,   VF_splineinterpol

 

VF_ratioVD_ratioVE_ratio
VF_ratio_dVF_ratio_eVD_ratio_e
VFx_ratioVDx_ratioVEx_ratio
VFx_ratio_dVFx_ratio_eVDx_ratio_e
VF_ratioOddEvenVD_ratioOddEvenVE_ratioOddEven
VF_ratioOddEven_dVF_ratioOddEven_eVD_ratioOddEven_e
VFx_ratioOddEvenVDx_ratioOddEvenVEx_ratioOddEven
VFx_ratioOddEven_dVFx_ratioOddEven_eVDx_ratioOddEven_e
VF_ratioEvenOddVD_ratioEvenOddVE_ratioEvenOdd
VF_ratioEvenOdd_dVF_ratioEvenOdd_eVD_ratioEvenOdd_e
VFx_ratioEvenOddVDx_ratioEvenOddVEx_ratioEvenOdd
VFx_ratioEvenOdd_dVFx_ratioEvenOdd_eVDx_ratioEvenOdd_e
   
VFu_ratioVDu_ratioVEu_ratio
VFu_ratio_dVFu_ratio_eVDu_ratio_e
VFux_ratioVDux_ratioVEux_ratio
VFux_ratio_dVFux_ratio_eVDux_ratio_e
VFu_ratioOddEvenVDu_ratioOddEvenVEu_ratioOddEven
VFu_ratioOddEven_dVFu_ratioOddEven_eVDu_ratioOddEven_e
VFux_ratioOddEvenVDux_ratioOddEvenVEux_ratioOddEven
VFux_ratioOddEven_dVFux_ratioOddEven_eVDux_ratioOddEven_e
VFu_ratioEvenOddVDu_ratioEvenOddVEu_ratioEvenOdd
VFu_ratioEvenOdd_dVFu_ratioEvenOdd_eVDu_ratioEvenOdd_e
VFux_ratioEvenOddVDux_ratioEvenOddVEux_ratioEvenOdd
VFux_ratioEvenOdd_dVFux_ratioEvenOdd_eVDux_ratioEvenOdd_e
FunctionRational expression: ratio of two polynomials
Syntax C/C++#include <VFmath.h>
int VF_ratio( fVector Y, fVector X, ui size, fVector Coeff, unsigned degP, unsigned degQ );
int VFx_ratio( fVector Y, fVector X, ui size, fVector Coeff, unsigned degP, unsigned degQ, float A, float B );
int VFu_ratio( fVector Y, fVector X, ui size, fVector Coeff, unsigned degP, unsigned degQ );
int VFux_ratio( fVector Y, fVector X, ui size, fVector Coeff, unsigned degP, unsigned degQ, float A, float B );
C++ VecObj#include <OptiVec.h>
int vector<T>::ratio( const vector<T>& X, const vector<T>& Coeff, unsigned degP, unsigned degQ );
int vector<T>::x_ratio( const vector<T>& X, const vector<T>& Coeff, unsigned degP, unsigned degQ, const T& A, const T& B );
Pascal/Delphiuses VFmath;
function VF_ratio( Y, X:fVector; size:UIntSize; Coeff:fVector; degP, degQ:UInt ): IntBool;
function VFx_ratio( Y, X:fVector; size:UIntSize; Coeff:fVector; degP, degQ:UInt; A, B:Single ): IntBool;
function VFu_ratio( Y, X:fVector; size:UIntSize; Coeff:fVector; degP, degQ:UInt ): IntBool;
function VFux_ratio( Y, X:fVector; size:UIntSize; Coeff:fVector; degP, degQ:UInt; A, B:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_ratio( fVector d_Y, fVector d_X, ui size, fVector h_Coeff, unsigned degP, unsigned degQ );
int cusdVF_ratio( fVector d_Y, fVector d_X, ui size, fVector d_Coeff, unsigned degP, unsigned degQ );
int cudaVFx_ratio( fVector d_Y, fVector d_X, ui size, fVector h_Coeff, unsigned degP, unsigned degQ, float A, float B );
int cusdVFx_ratio( fVector d_Y, fVector d_X, ui size, fVector d_Coeff, unsigned degP, unsigned degQ, float *d_A, float *d_B );
int cudaVFu_ratio( fVector d_Y, fVector d_X, ui size, fVector h_Coeff, unsigned degP, unsigned degQ );
int cusdVFu_ratio( fVector d_Y, fVector d_X, ui size, fVector d_Coeff, unsigned degP, unsigned degQ );
int cudaVFux_ratio( fVector d_Y, fVector d_X, ui size, fVector h_Coeff, unsigned degP, unsigned degQ, float A, float B );
int cusdVFux_ratio( fVector d_Y, fVector d_X, ui size, fVector d_Coeff, unsigned degP, unsigned degQ, float *d_A, float *d_B );
int VFcu_ratio( fVector h_Y, fVector h_X, ui size, fVector h_Coeff, unsigned degP, unsigned degQ );
int VFxcu_ratio( fVector h_Y, fVector h_X, ui size, fVector h_Coeff, unsigned degP, unsigned degQ, float A, float B );
int VFucu_ratio( fVector h_Y, fVector h_X, ui size, fVector h_Coeff, unsigned degP, unsigned degQ );
int VFuxcu_ratio( fVector h_Y, fVector h_X, ui size, fVector h_Coeff, unsigned degP, unsigned degQ, float A, float B );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_ratio( d_Y, d_X:fVector; size:UIntSize; h_Coeff:fVector; degP, degQ:UInt ): IntBool;
function cusdVF_ratio( d_Y, d_X:fVector; size:UIntSize; d_Coeff:fVector; degP, degQ:UInt ): IntBool;
function cudaVFx_ratio( d_Y, d_X:fVector; size:UIntSize; h_Coeff:fVector; degP, degQ:UInt; A, B:Single ): IntBool;
function cusdVFx_ratio( d_Y, d_X:fVector; size:UIntSize; d_Coeff:fVector; degP, degQ:UInt; d_A, d_B:PSingle ): IntBool;
function cudaVFu_ratio( d_Y, d_X:fVector; size:UIntSize; h_Coeff:fVector; degP, degQ:UInt ): IntBool;
function cusdVFu_ratio( d_Y, d_X:fVector; size:UIntSize; d_Coeff:fVector; degP, degQ:UInt ): IntBool;
function cudaVFux_ratio( d_Y, d_X:fVector; size:UIntSize; h_Coeff:fVector; degP, degQ:UInt; A, B:Single ): IntBool;
function cusdVFux_ratio( d_Y, d_X:fVector; size:UIntSize; d_Coeff:fVector; degP, degQ:UInt; d_A, d_B:PSingle ): IntBool;
function VFcu_ratio( h_Y, h_X:fVector; size:UIntSize; h_Coeff:fVector; degP, degQ:UInt ): IntBool;
function VFxcu_ratio( h_Y, h_X:fVector; size:UIntSize; h_Coeff:fVector; degP, degQ:UInt; A, B:Single ): IntBool;
function VFucu_ratio( h_Y, h_X:fVector; size:UIntSize; h_Coeff:fVector; degP, degQ:UInt ): IntBool;
function VFuxcu_ratio( h_Y, h_X:fVector; size:UIntSize; h_Coeff:fVector; degP, degQ:UInt; A, B:Single ): IntBool;
Descriptionsimple versions VF_ratio, VD_ratio, VE_ratio:
Yi = P/Q, with
P = p0 + p1 * Xi + p2 * Xi2 + ... + pdegP * XidegP,
Q = q0 + q1 * Xi + q2 * Xi2 + ... + qdegQ * XidegQ

expanded versions VFx_ratio, VDx_ratio, VEx_ratio:
xi = (A*Xi + B),
Yi = P/Q as above with xi instead of Xi

A polynomial P of degree degP is divided by a polynomial Q of degree degQ. The coefficients pk and qk are taken from the vector Coeff. Coeff must contain the constant term p0 as element no. 0, the linear coefficient p1 as element no. 1, and so one until pdegP as element no. degP immediately followed by q0 as element no. (degP+1), q1 as element no. (degP+2) etc., until qdegQ as element no. (degP+degQ+1). This means that Coeff contains a total of (degP+degQ+2) elements.

"unprotected" versions (prefix VFu_,   VFux_, etc.):
These functions do not perform any error handling, which makes them much faster (up to 50%) than the standard versions. They do, however, indicate in their return value, if an error occurred.

Even in the case that the individual polynomials P and Q might overflow, their ratio still might yield a perfectly legal result. Therefore, OptiVec offers additional versions which internally employ higher accuracy (and range): VF_ratio_d and VF_ratio_e work in double or extended precision, resp., before converting the result back to single precision. Likewise, VD_ratio_e works in extended precision (even if the compiler does not support extended precision!), before converting the result back to double. These versions exist only on the CPU, not in CUDA.

When rational models are used for the approximation of mathematical functions, sometimes one of the polynomials only consists of odd terms, while the other polynomial has only even terms. Examples are the rational representation of the tangent function (P has only odd terms, Q has only even terms) or of the cotangent function (P has only even terms, Q has only odd terms). These cases are covered by the following OptiVec functions:

VF_ratioOddEven: P has only odd terms, Q has only even terms:
Pi = p1 * Xi + p1 * Xi3 + ... + pdegP * XidegP, with degP = 2n+1
Qi = q0 + q2 * Xi2 + ... + qdegQ * XidegQ, with degQ = 2n
Coeff here contains (degP+1)/2 + (degQ/2)+1 coefficients.

VF_ratioEvenOdd: P has only even, Q has only odd terms:
Pi = p0 + p2 * Xi2 + ... + pdegP * XidegP, with degP = 2n
Qi = q1 * Xi + q1 * Xi3 + ... + qdegQ * XidegQ, with degQ = 2n+1
Coeff here contains (degP/2)+1 + (degQ+1)/2 coefficients.

While mathematically legal, round-off error makes polynomials and, by extension, rations of high degrees practically useless. In the present implementation, VF_ratio, VF_ratio_d, and VD_ratio allow degP+degQ ± 32. Above that, an error message "Invalid Parameter(s)" is emitted and program execution halted. Only the VE_ versions along with VF_ratio_e and VD_ratio_e allow to evaluate ratios of higher degrees.

Error handlingOVERFLOW or ZERODIVIDE errors lead to the result ±HUGE_VAL. 0/0 situations are solved only in the VE_ and ratio_e versions, where 0/0 is replaced by the first derivative of P divided by the first derivative of Q. In all other versions, 0/0 leads to the result ±HUGE_VAL.
Return valueFALSE (0), if no error occured; otherwise a bit combination of the error codes, 0x4 (division by 0), 0x8 (OVERFLOW), and 0x1 (0/0).
Although the "unprotected" variants (prefixes VFu_,   VFux_, etc.) do not actually hande errors, they return the same error codes as the normal variant.
See alsoVF_poly,   VF_ipow,   VF_pow

 

VF_readVD_readVE_read
VCF_readVCD_readVCE_read
VPF_readVPD_readVPE_read
VI_readVBI_readVSI_readVLI_readVQI_read 
VU_readVUB_readVUS_readVUL_readVUQ_readVUI_read
Functionreads a vector in ASCII format from a stream
Syntax C/C++#include <VFstd.h>
void VF_read( fVector X, ui size, FILE *stream );
C++ VecObj#include <OptiVec.h>
void vector<T>::read( FILE *stream );
Pascal/Delphiuses VFstd;
procedure VF_read( X:fVector; size:UIntSize; var Stream:Text );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_read( fVector d_X, ui size, FILE *stream );
int cudaVF_read_buf( fVector d_X, ui size, FILE *stream, fVector h_Wk );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_read( X:fVector; size:UIntSize; var Stream:FILE ): IntBool;
function cudaVF_read_buf( X:fVector; size:UIntSize; var Stream:FILE; h_Wk:fVector ): IntBool;
Descriptionsize elements are read in ASCII format (up to 80 characters) from stream and stored in X. Normally, this function will be used to import vectors from a program which cannot store numbers in machine format. It can also be used to retrieve vectors previously stored by VF_write. For storing and retrieving intermediate results, however, the function pair VF_store / VF_recall is to be preferred over VF_write / VF_read (see VF_write).

Complex versions:
Real und imaginary parts (cartesian complex) or the Mag and Arg parts (polar complex) may, but need not, be enclosed in braces { } or brackets ( ). However, you must be consequent: Either all or no element may be written with braces or brackets.
A komma may (but need not) separate the two parts. The imaginary part (cartesian) or the Arg part (polar) must always be explicitly specified, even if it is zero.
Examples for legal formats are:
0.3 0.5    (neither braces nor separating komma)
0.3, 0.5    (no braces; separating komma)
{0.3 0.5}    (braces; no separating komma)
(0.3, 0.5)    (brackets and separating komma)

C/C++ specific:The entries to be read must be separated by whitespace (' ', '\n', or '\t'). Additionally, one (!) "non-whitespace" character is tolerated after each entry, if it follows directly after the last digit. After it, there must be one or more whitespace characters.

Whole-number versions except VQI_read:
By default, the numbers to be read are interpreted as decimal numbers. You may use V_setRadix to define any radix between 2 and 36.
 

GCC Windows specific:In principle, the Windows port of GCC supports the 80-bit floating point type long double. However, the I/O routines rely on the runtime libraries of Visual C++, where 80-bit reals have disappeared a long time ago. This means that VE_read, VCE_read, and VPE_read work only with double precision and, more importantly, within double range. Input numbers outside double range are treated as ±DBL_MAX.
 
Pascal/Delphi specific:The entries to be read must be separated by whitespace (' ', #13, or #9).

Whereas the C/C++ version of these functions follows the conventions of the C functions strtod,   strtol, etc., the Pascal/Delphi version has to follow the rules applying to the Pascal/Delphi function Read. This makes the Pascal/Delphi version much less flexible than the C version:
- no separation characters allowed other than ' ' and #9,
- no automatic truncation of overflowing numbers,
- no function V_setRadix

Error handlingC/C++:
Real, complex and quad versions:
Overflowing numbers are silently truncated to ±HUGE_VAL.
Whole-number versions except VQI_read:
As long as the numbers can be represented as long or unsigned long, overflowing bits are ignored in the 16-bit versions. Numbers beyond the long range yield −1 (signed types) or +HUGE_VAL (unsigned types).
Pascal/Delphi:
Overflowing numbers or numbers otherwise not conforming to the format requirements lead to an I/O error.

CUDA versions only: cudaV?_read_buf takes a host vector h_Wk as additional argument. The latter serves as buffer memory and needs to be (at least) of the same size as X. By avoiding the need of cudaV?_read to allocate its own buffer memory, cudaV?_read_buf is slightly faster.

Return valuenone
See alsoVF_nread,   VF_write,   VF_store,   VF_recall,   strtod,   strtol

 

VCF_realVCD_realVCE_real
VPF_realVPD_realVPE_real
FunctionReal part of a complex vector.
Syntax C/C++#include <VCFstd.h>
void VCF_real( fVector Re, cfVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::real( const vector<complex<T>>& X );
Pascal/Delphiuses VCFstd;
procedure VCF_real( Re:fVector; X:cfVector; size:UIntSize );
CUDA function C/C++#include <cudaVCFstd.h>
int cudaVCF_real( fVector d_Re, cfVector d_X, ui size );
void VCFcu_real( fVector h_Re, cfVector h_X, ui size );
CUDA function Pascal/Delphiuses VCFstd;
function cudaVCF_real( d_Re:fVector; d_X:cfVector; size:UIntSize ): IntBool;
procedure VCFcu_real( h_Re:fVector; h_X:cfVector; size:UIntSize );
DescriptionIdentical to VF_CtoRe,   VD_CtoRe, and VE_CtoRe. See these functions for details.

 

VF_recallVD_recallVE_recall
VCF_recallVCD_recallVCE_recall
VPF_recallVPD_recallVPE_recall
VI_recallVBI_recallVSI_recallVLI_recallVQI_recall 
VU_recallVUB_recallVUS_recallVUL_recallVUQ_recallVUI_recall
FunctionRead a vector in binary format from a stream
Syntax C/C++#include <VFstd.h>
int VF_recall( fVector X, ui size, FILE *stream );
C++ VecObj#include <OptiVec.h>
int vector<T>::recall( FILE *stream );
Pascal/Delphiuses VFstd;
function VF_recall( X:fVector; size:UIntSize; var Stream:FILE );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_recall( fVector d_X, ui size, FILE *stream );
int cudaVF_recall_buf( fVector d_X, ui size, FILE *stream, fVector h_Wk );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_recall( X:fVector; size:UIntSize; var Stream:FILE ): IntBool;
function cudaVF_recall_buf( X:fVector; size:UIntSize; var Stream:FILE; h_Wk:fVector ): IntBool;
Descriptionsize elements of X are read from stream in binary format. Normally, these functions are used to retrieve data stored by the respective function of the VF_store family. The data type for reading and writing has to be the same. It is not possible to, e.g., store data by VF_store and recall them by VD_recall (in contrast to the corresponding write/read functions in ASCII format, see VF_read).

The VecObj version differs from the "normal" C/C++ version in that it reads vector objects, not only the vector elements. It first reads a ui, giving the size of the vector, and then size elements, whereas the V?_recall functions assume size as known and take it as an argument. Therefore, the VecObj function recall can be used only to read vector objects previously stored with the VecObj function store, but not vectors stored with one of the V?_store functions.

CUDA versions only: cudaV?_recall_buf takes a host vector h_Wk as additional argument. The latter serves as buffer memory and needs to be (at least) of the same size as X. By avoiding the need of cudaV?_recall to allocate its own buffer memory, cudaV?_recall_buf is slightly faster.

GCC and CLang only: GCC and CLang (including BCC32C) pad the 10-byte data type long double to 12 or 16 bytes in memory (12 byte in 32-bit, 16 byte in 64 bit). In order to maintain compatibility of the generated data files between compilers, the VE_store / VE_recall, VCE_store / VCE_recall, and VPE_store / VPE_recall pairs always use 10-byte storage on disk.

Thread safetyDifferent threads may safely call any functions of the VF_ / MF_store and VF_ / MF_recall families simultaneously, as long as the refer to different streams. If they have to access one and the same stream, however, the user must take appropriate measures (critical sections, mutexes), in order to prevent race conditions.
Error handlingError handling is performed by the C function fread or the Delphi function BlockRead, on which VF_recall etc. are based.
Return value0, if successful; otherwise 1. In order to obtain more information, inspect errno (C/C++) or IOResult (Delphi).
See alsoVF_store,   VF_write,   VF_print,   fwrite,   fread

 

VF_redCVD_redCVE_redC
Function"Reduce" by a constant
Syntax C/C++#include <VFmath.h>
void VF_redC( fVector Y, fVector X, ui size, float C );
C++ VecObj#include <OptiVec.h>
void vector<T>::redC( const vector<T>& X, const T& C );
Pascal/Delphiuses VFmath;
procedure VF_redC( Y, X:fVector; size:UIntSize; C:Single );
CUDA function C/C++#include <cudaVFmath.h>
#include <cudaVDmath.h>
int cudaVF_redC( fVector d_Y, fVector d_X, ui size, float C );
int cusdVF_redC( fVector d_Y, fVector d_X, ui size, float *d_C );
void VFcu_redC( fVector d_Y, fVector d_X, ui size, float C );
CUDA function Pascal/Delphiuses VFmath, VDmath;
function cudaVF_redC( d_Y, d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_redC( d_Y, d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
procedure VF_redC( Y, X:fVector; size:UIntSize; C:Single );
DescriptionYi = red( Xi, C ) = Xi * C / (Xi + C)
Expressions of this type are frequently used in physics; for example, the "reduced mass" of a two-body system is the product of both masses divided by their sum.
Error handlingnone
Return valuenone
See alsoVF_redV,   VF_addC,   VF_subC,   VF_divC,   VF_visC

 

VF_redVVD_redVVE_redV
VFx_redVVDx_redVVEx_redV
Function"Reduce" by corresponding vector elements
Syntax C/C++#include <VFmath.h>
void VF_redV( fVector Z, fVector X, fVector Y, ui size );
void VFx_redV( fVector Z, fVector X, fVector Y, ui size, float A, float B );
C++ VecObj#include <OptiVec.h>
void vector<T>::redV( const vector<T>& X, const vector<T>& Y );
void vector<T>::x_redV( const vector<T>& X, const vector<T>& Y, const T& A, const T& B );
Pascal/Delphiuses VFmath;
procedure VF_redV( Z, X, Y:fVector; size:UIntSize );
procedure VFx_redV( Z, X, Y:fVector; size:UIntSize; A, B:Single );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_redV( fVector d_Z, fVector d_X, fVector d_Y,ui size );
int cudaVFx_redV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float A, float B );
int cusdVFx_redV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float *d_A, float *d_B );
void VFcu_redV( fVector h_Z, fVector h_X, fVector h_Y,ui size );
void VFxcu_redV( fVector h_Z, fVector h_X, fVector h_Y, ui size, float A, float B );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_redV( d_Z, d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cudaVFx_redV( d_Z, d_X, d_Y:fVector; size:UIntSize; A, B:Single ): IntBool;
function cusdVFx_redV( d_Z, d_X, d_Y:fVector; size:UIntSize; d_A, d_B:PSingle ): IntBool;
procedure VFcu_redV( h_Z, h_X, h_Y:fVector; size:UIntSize );
procedure VFxcu_redV( h_Z, h_X, h_Y:fVector; size:UIntSize; A, B:Single );
Descriptionsimple versions:
Zi = red( Xi, Yi ) = Xi * Yi / (Xi + Yi)
expanded versions:
xi = (A * Xi + B),
Zi = red( xi, Yi )
Error handlingnone
Return valuenone
See alsoVF_redC,   VF_addV,   VF_subV,   VF_divV,   VF_visV

 

VF_reflectVD_reflectVE_reflect
VCF_reflectVCD_reflectVCE_reflect
VPF_reflectVPD_reflectVPE_reflect
VI_reflectVBI_reflectVSI_reflectVLI_reflectVQI_reflect 
VU_reflectVUB_reflectVUS_reflectVUL_reflectVUQ_reflectVUI_reflect
FunctionDerive the second half of a vector from the first half by reflection at the midpoint.
Syntax C/C++#include <VFstd.h>
void VF_reflect( fVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::reflect();
Pascal/Delphiuses VFstd;
procedure VF_reflect( X:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_reflect( fVector d_X, ui size );
void VFcu_reflect( fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_reflect( d_X:fVector; size:UIntSize ): IntBool;
procedure VFcu_reflect( h_X:fVector; size:UIntSize );
DescriptionXsize-i−1 = Xi,   i=0,...,(size−1)/2
The elements of the lower half of a vector are copied in reverse order into the upper half, i.e., the zero'th element is copied to the last, the element number 1 to the second last, and so on. The elements of the first half are not affected by this operation. This function will be used, e.g., to construct a response function for convolutions (see VF_convolve). In this case, note that the zero'th element is to appear only once in the response function and must not be included in the reflection by VF_reflect. Therefore, you have to calculate the response function for size/2+1 elements and to apply reflection from element 1 on. For an example, see VF_convolve.
Error handlingnone
Return valuenone
See alsoVF_rotate,   VF_rev,   VF_convolve,   VF_deconvolve,   VF_filter

 

VF_ReImtoCVD_ReImtoCVE_ReImtoC
FunctionConstruct a cartesian complex vector from real and imaginary parts
Syntax C/C++#include <VCFstd.h>
void VF_ReImtoC( cfVector Y, fVector Re, fVector Im, ui size );
C++ VecObj#include <OptiVec.h>
void vector<complex<T>>::ReImtoC( const vector<T>& Re, const vector<T>& Im );
Pascal/Delphiuses VCFstd;
procedure VF_ReImtoC( X:cfVector; Re, Im:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVCFstd.h>
int cudaVF_ReImtoC( cfVector Y, fVector d_Re, fVector d_Im, ui size );
void VFcu_ReImtoC( cfVector Y, fVector h_Re, fVector h_Im, ui size );
CUDA function Pascal/Delphiuses VCFstd;
function cudaVF_ReImtoC( d_X:cfVector; d_Re, d_Im:fVector; size:UIntSize ): IntBool;
procedure VFcu_ReImtoC( h_X:cfVector; h_Re, h_Im:fVector; size:UIntSize );
DescriptionThe complex vector Y is constructed from two real vectors that become the real and imaginary parts of Y.
Error handlingnone
Return valuenone
See alsoVF_CtoReIm,   VF_RetoC,   VF_PolartoC

 

VF_ReImtoPVD_ReImtoPVE_ReImtoP
FunctionConstruct a polar complex vector from real and imaginary parts
Syntax C/C++#include <VPFstd.h>
void VF_ReImtoP( pfVector Y, fVector Re, fVector Im, ui size );
C++ VecObj#include <OptiVec.h>
void vector<polar<T>>::ReImtoP( const vector<T>& Re, const vector<T>& Im );
Pascal/Delphiuses VPFstd;
procedure VF_ReImtoP( X:pfVector; Re, Im:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVPFstd.h>
int cudaVF_ReImtoP( pfVector Y, fVector d_Re, fVector d_Im, ui size );
void VFcu_ReImtoP( pfVector Y, fVector h_Re, fVector h_Im, ui size );
CUDA function Pascal/Delphiuses VPFstd;
function cudaVF_ReImtoP( d_X:pfVector; d_Re, d_Im:fVector; size:UIntSize ): IntBool;
procedure VFcu_ReImtoP( h_X:pfVector; h_Re, h_Im:fVector; size:UIntSize );
DescriptionThe polar complex vector Y is constructed from cartesian coordinates entered as the two real vectors Re and Im.
Error handlingnone
Return valuenone
See alsoVF_PtoReIm,   VF_MagArgtoP

 

VF_reldevCVD_reldevCVE_reldevC
FunctionRelative Deviation (in absolute terms) of the elements of a vector from a reference value
Syntax C/C++#include <VFmath.h>
void VF_reldevC( fVector Y, fVector X, ui size, float C );
C++ VecObj#include <OptiVec.h>
void vector<T>::reldevC( const vector<T>& X, const T& C );
Pascal/Delphiuses VFmath;
procedure VF_reldevC( Y, X:fVector; size:UIntSize; C:Single );
CUDA Function C/C++#include <cudaVFmath.h>
#include <cudaVDmath.h>
int cudaVF_reldevC( fVector d_Y, fVector d_X, ui size, float C );
int cusdVF_reldevC( fVector d_Y, fVector d_X, ui size, float *d_C );
void VFcu_reldevC( fVector d_Y, fVector d_X, ui size, float C );
CUDA Function Pascal/Delphiuses VFmath, VDmath;
function cudaVF_reldevC( d_Y, d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_reldevC( d_Y, d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
procedure VF_reldevC( Y, X:fVector; size:UIntSize; C:Single );
DescriptionYi = |Xi − C|  /  |C|

The reference value C=0 is not allowed, as it would lead to a division by zero.

While VF_reldevC yields the absolute value of the relative deviation, the similar function VF_reldiffC gives the relative deviation with ±sign.

Error handlingnone
Return valuenone
See alsoVF_reldevV,   VF_reldiffC,   VF_maxreldevC,   VF_maxindreldevC

 

VF_reldevVVD_reldevVVE_reldevV
FunctionRelative Deviation (in absolute terms) of the elements of one vector from the corresponding elements of another vector, normalized by the larger of the two input values
Syntax C/C++#include <VFmath.h>
void VF_reldevV( fVector Z, fVector X, fVector Y, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::reldevV( const vector<T>& X, const vector<T>& Y );
Pascal/Delphiuses VFmath;
procedure VF_reldevV( Z, X, Y:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_reldevV( fVector d_Z, fVector d_X, fVector d_Y,ui size );
void VFcu_reldevV( fVector h_Z, fVector h_X, fVector h_Y,ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_reldevV( d_Z, d_X, d_Y:fVector; size:UIntSize ): IntBool;
procedure VFcu_reldevV( h_Z, h_X, h_Y:fVector; size:UIntSize );
DescriptionZi = |Xi − Yi|  /  max(|Xi|, |Yi|),   if |Xi| > 0 or |Yi| > 0
Zi = 0,   if Xi = 0 and Yi = 0

While VF_reldevV yields the absolute value of the relative deviation, the similar function VF_reldiffV gives the relative deviation with ±sign.

Error handlingnone
Return valuenone
See alsoVF_reldiffV,   VF_reldevC,   VF_maxreldevV,   VF_maxindreldevV

 

VF_reldiffCVD_reldiffCVE_reldiffC
FunctionRelative Deviation (with correct sign) of the elements of a vector from a reference value
Syntax C/C++#include <VFmath.h>
void VF_reldiffC( fVector Y, fVector X, ui size, float C );
C++ VecObj#include <OptiVec.h>
void vector<T>::reldiffC( const vector<T>& X, const T& C );
Pascal/Delphiuses VFmath;
procedure VF_reldiffC( Y, X:fVector; size:UIntSize; C:Single );
CUDA Function C/C++#include <cudaVFmath.h>
#include <cudaVDmath.h>
int cudaVF_reldiffC( fVector d_Y, fVector d_X, ui size, float C );
int cusdVF_reldiffC( fVector d_Y, fVector d_X, ui size, float *d_C );
void VFcu_reldiffC( fVector d_Y, fVector d_X, ui size, float C );
CUDA Function Pascal/Delphiuses VFmath, VDmath;
function cudaVF_reldiffC( d_Y, d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_reldiffC( d_Y, d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
procedure VF_reldiffC( Y, X:fVector; size:UIntSize; C:Single );
DescriptionYi = (Xi − C)  /  |C|

The reference value C=0 is not allowed, as it would lead to a division by zero.

While VF_reldiffC yields the signed relative diffiation (negative for Xi < C), the similar function VF_reldevC gives the absolute value of relative deviation.

Error handlingnone
Return valuenone
See alsoVF_reldiffV,   VF_reldevC,   VF_maxreldiffC,   VF_maxindreldiffC

 

VF_reldiffVVD_reldiffVVE_reldiffV
FunctionRelative Deviation (with correct sign) of the elements of one vector from the corresponding elements of another vector, normalized by the larger of the two input values
Syntax C/C++#include <VFmath.h>
void VF_reldiffV( fVector Z, fVector X, fVector Y, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::reldiffV( const vector<T>& X, const vector<T>& Y );
Pascal/Delphiuses VFmath;
procedure VF_reldiffV( Z, X, Y:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_reldiffV( fVector d_Z, fVector d_X, fVector d_Y,ui size );
void VFcu_reldiffV( fVector h_Z, fVector h_X, fVector h_Y,ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_reldiffV( d_Z, d_X, d_Y:fVector; size:UIntSize ): IntBool;
procedure VFcu_reldiffV( h_Z, h_X, h_Y:fVector; size:UIntSize );
DescriptionZi = (Xi − Yi)  /  max(|Xi|, |Yi|),   if |Xi| > 0 or |Yi| > 0
Zi = 0,   if Xi = 0 and Yi = 0

While VF_reldiffV yields the signed relative diffiation (negative for Xi < Yi, the similar function VF_reldevV gives the absolute value of the relative deviation.

Error handlingnone
Return valuenone
See alsoVF_reldevV,   VF_reldiffC,   VF_maxreldiffV,   VF_maxindreldiffV

 

VF_replaceNANVD_replaceNANVE_replaceNAN
VCF_replaceNANVCD_replaceNANVCE_replaceNAN
VPF_replaceNANVPD_replaceNANVPE_replaceNAN
FunctionReplace NAN by an arbitrary value
Syntax C/C++#include <VFmath.h>
void VF_replaceNAN( fVector Y, fVector X, ui size, float C );
void VCF_replaceNAN( fVector Y, fVector X, ui size, fComplex C );
C++ VecObj#include <OptiVec.h>
void vector<T>::replaceNAN( const vector<T>& X, const T& C );
void vector<T>::replaceNAN( const vector<T>& X, complex<T> C );
Pascal/Delphiuses VFmath;
procedure VF_replaceNAN( Y, X:fVector; size:UIntSize; C:Single );
procedure VCF_replaceNAN( Y, X:cfVector; size:UIntSize; C:fComplex );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_replaceNAN( fVector d_Y, fVector d_X, ui size, float C );
int cusdVF_replaceNAN( fVector d_Y, fVector d_X, ui size, float *d_C );
void VFcu_replaceNAN( fVector h_Y, fVector h_X, ui size, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_replaceNAN( d_Y, d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_replaceNAN( d_Y, d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
procedure VFcu_replaceNAN( h_Y, h_X:fVector; size:UIntSize; C:Single );
DescriptionX is copied into Y, whereby any NAN ("not a number") value (be it SNaN or QNaN) is replaced by a user-defined characteristic value C.
Error handlingnone
Return valuenone
See alsoVF_absHuge,   VF_maxC,   VF_minC,   VF_min,   VF_flush0,   VF_limit

 

VF_RetoCVD_RetoCVE_RetoC
FunctionOverwrite the real part of a cartesian complex vector with a real vector
Syntax C/C++#include <VCFstd.h>
void VF_RetoC( cfVector Y, fVector Re, ui size );
C++ VecObj#include <OptiVec.h>
void vector<complex<T>>::RetoC( const vector<T>& Re );
Pascal/Delphiuses VCFstd;
procedure VF_RetoC( X:cfVector; Re:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVCFstd.h>
int cudaVF_RetoC( cfVector d_Y, fVector d_Im, ui size );
void VFcu_RetoC( cfVector h_Y, fVector h_Im, ui size );
CUDA function Pascal/Delphiuses VCFstd;
function cudaVF_RetoC( d_X:cfVector; d_Im:fVector; size:UIntSize ): IntBool;
procedure VFcu_RetoC( h_X:cfVector; h_Im:fVector; size:UIntSize );
DescriptionThe real part of the complex vector Y is overwritten with the elements of the real-valued vector Re. The imaginary part of Y is not affected.
Error handlingnone
Return valuenone
See alsoVF_CtoReIm,   VF_ReImtoC,   VF_ImtoC,   VF_PolartoC

 

VF_revVD_revVE_rev
VCF_revVCD_revVCE_rev
VPF_revVPD_revVPE_rev
VI_revVBI_revVSI_revVLI_revVQI_rev 
VU_revVUB_revVUS_revVUL_revVUQ_revVUI_rev
FunctionReverse the ordering of the elements of a vector
Syntax C/C++#include <VFstd.h>
void VF_rev( fVector Y, fVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::rev( const vector<T>& X );
Pascal/Delphiuses VFstd;
procedure VF_rev( Y, X:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_rev( fVector d_Y, fVector d_X, ui size );
void VF_rev( fVector h_Y, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_rev( d_Y, d_X:fVector; size:UIntSize ): IntBool;
procedure VFcu_rev( h_Y, h_X:fVector; size:UIntSize );
DescriptionYi = Xsize-i−1
Error handlingnone
Return valuenone
See alsoVF_reflect,   VF_rotate,   VF_revconj

 

VCF_revconjVCD_revconjVCE_revconj
VPF_revconjVPD_revconjVPE_revconj
FunctionComplex conjugate in reversed element order
Syntax C/C++#include <VCFmath.h>
int VCF_revconj( cfVector Y, cfVector X, ui size );
C++ VecObj#include <OptiVec.h>
int vector<complex<T>>::revconj( const vector<complex<T>>& X );
Pascal/Delphiuses VCFmath;
function VCF_revconj( Y, X:cfVector; size:UIntSize ): IntBool;
CUDA function C/C++#include <cudaVCFmath.h>
int cudaVCF_revconj( cfVector d_Y, cfVector d_X, ui size );
void VCFcu_revconj( cfVector h_Y, cfVector h_X, ui size );
CUDA function Pascal/Delphiuses VCFmath;
function cudaVCF_revconj( d_Y, d_X:cfVector; size:UIntSize ): IntBool;
procedure VCFcu_revconj( h_Y, h_X:cfVector; size:UIntSize );
DescriptionRe(Ysize-i−1) = Re(Xi)
Im(Ysize-i−1) = -Im(Xi)
Error handlingnone
Return valuealways FALSE (0)
See alsoVCF_rev,   VCF_conj,   VCF_abs

 

VF_rmsVD_rmsVE_rms
FunctionRoot of the mean square
Syntax C/C++#include <VFstd.h>
float VF_rms( fVector X, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::rms();
Pascal/Delphiuses VFstd;
function VF_rms( X:fVector; size:UIntSize ); Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_rms( float *h_RetVal, fVector d_X, ui size );
int cusdVF_rms( float *d_RetVal, fVector d_X, ui size );
float VFcu_rms( fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_rms( var h_RetVal:Single; d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_rms( d_RetVal:PSingle; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_rms( h_X:fVector; size:UIntSize ): Single;
Descriptionrms = sqrt( (1/size) * sum( Xi2 ) )
Error handlingnone
Return valuerms
See alsoVF_ssq,   VF_Euclid,   VF_mean

 

VF_rotateVD_rotateVE_rotate
VCF_rotateVCD_rotateVCE_rotate
VPF_rotateVPD_rotateVPE_rotate
VI_rotateVBI_rotateVSI_rotateVLI_rotateVQI_rotate 
VU_rotateVUB_rotateVUS_rotateVUL_rotateVUQ_rotateVUI_rotate
FunctionRotate the ordering of the elements of a vector
Syntax C/C++#include <VFstd.h>
void VF_rotate( fVector Y, fVector X, ui size, int pos );
C++ VecObj#include <OptiVec.h>
void vector<T>::rotate( const vector<T>& X, int pos );
Pascal/Delphiuses VFstd;
procedure VF_rotate( Y, X:fVector; size:UIntSize; pos:Integer );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_rotate( fVector d_Y, fVector d_X, ui size, int pos );
void VFcu_rotate( fVector h_Y, fVector h_X, ui size, int pos );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_rotate( d_Y, d_X:fVector; size:UIntSize; pos:Integer ): IntBool;
procedure VFcu_rotate( h_Y, h_X:fVector; size:UIntSize; pos:Integer );
DescriptionYi = Xsize-pos+i,   i=0,..,pos−1
Yi = Xi-pos,      i=pos,..,size−1
The output vector equals the rotated input vector. Clockwise rotation is achieved by a positive number pos.
Error handlingnone
Return valuenone
See alsoVF_reflect,   VF_rev

 

VF_rotate_bufVD_rotate_bufVE_rotate_buf
VCF_rotate_bufVCD_rotate_bufVCE_rotate_buf
VPF_rotate_bufVPD_rotate_bufVPE_rotate_buf
VI_rotate_bufVBI_rotate_bufVSI_rotate_bufVLI_rotate_bufVQI_rotate_buf 
VU_rotate_bufVUB_rotate_bufVUS_rotate_bufVUL_rotate_bufVUQ_rotate_bufVUI_rotate_buf
FunctionRotate the ordering of the elements of a vector
Syntax C/C++#include <VFstd.h>
void VF_rotate_buf( fVector Y, fVector X, ui size, int pos, fVector Buf );
C++ VecObj#include <OptiVec.h>
void vector<T>::rotate( const vector<T> X, int pos, const vector<T> Buf );
Pascal/Delphiuses VFstd;
procedure VF_rotate_buf( Y, X:fVector; size:UIntSize; pos:Integer; Buf:fVector );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_rotate_buf( fVector d_Y, fVector d_X, ui size, int pos, fVector d_Buf );
void VFcu_rotate_buf( fVector h_Y, fVector h_X, ui size, int pos, fVector h_Buf );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_rotate_buf( d_Y, d_X:fVector; size:UIntSize; pos:Integer; d_Buf:fVector ): IntBool;
procedure VFcu_rotate_buf( h_Y, h_X:fVector; size:UIntSize; pos:Integer; h_Buf:fVector );
DescriptionYi = Xsize-pos+i,   i=0,..,pos−1
Yi = Xi-pos,      i=pos,..,size−1
This is a more efficient variant of VF_rotate. Instead of allocating buffer memory each time the function is called, it takes the necessary buffer as the argument Buf. Buf must be a vector generated by the OptiVec memory management function (VF_vector etc.). The size of Buf must be greater or equal to the shift, pos.
Error handlingnone
Return valuenone
See alsoVF_rotate

 

VF_rotateCoordinatesVD_rotateCoordinatesVE_rotateCoordinates
VCF_rotateCoordinatesVCD_rotateCoordinatesVCE_rotateCoordinates
FunctionCounter-clockwise rotation of cartesian coordinates
Syntax C/C++#include <VFmath.h>
void VF_rotateCoordinates( fVector Xrot, fVector Yrot, fVector X, fVector Y, ui size, float costheta, float sintheta );

void VCF_rotateCoordinates( cfVector XYrot, cfVector XY, ui size, float costheta, float sintheta );
C++ VecObj#include <OptiVec.h>
void vector<T>::rotateCoordinates( const vector<T>& Yrot, const vector<T>& X,const vector<T>& Y, T costheta, T sintheta );
void vector<complex<T> >::rotateCoordinates( const vector<complex<T> >& XY, T costheta, T sintheta );
Pascal/Delphiuses VFmath;
procedure VF_rotateCoordinates( Xrot, Yrot, X, Y:fVector; size:UIntSize; costheta, sintheta:Single );

procedure VCF_rotateCoordinates( XYrot, XY:cfVector; size:UIntSize; costheta, sintheta:Single );
CUDA function C/C++#include <cudaVFmath.h>
void cudaVF_rotateCoordinates( fVector d_Xrot, fVector d_Yrot, fVector d_X, fVector d_Y, ui size, float costheta, float sintheta );
void cusdVF_rotateCoordinates( fVector d_Xrot, fVector d_Yrot, fVector d_X, fVector d_Y, ui size, float *d_costheta, float *d_sintheta );
void cudaVCF_rotateCoordinates( cfVector d_XYrot, cfVector d_XY, ui size, float costheta, float sintheta );
void cusdVCF_rotateCoordinates( cfVector d_XYrot, cfVector d_XY, ui size, float *d_costheta, float *d_sintheta );
void VFcu_rotateCoordinates( fVector h_Xrot, fVector h_Yrot, fVector h_X, fVector h_Y, ui size, float costheta, float sintheta );
void VCFcu_rotateCoordinates( cfVector h_XYrot, cfVector h_XY, ui size, float costheta, float sintheta );
CUDA function Pascal/Delphiuses VFmath;
procedure cudaVF_rotateCoordinates( d_Xrot, d_Yrot, d_X, d_Y:fVector; size:UIntSize; costheta, sintheta:Single );
procedure cusdVF_rotateCoordinates( d_Xrot, d_Yrot, d_X, d_Y:fVector; size:UIntSize; d_costheta, d_sintheta:Single );
procedure cudaVCF_rotateCoordinates( d_XYrot, d_XY:cfVector; size:UIntSize; costheta, sintheta:Single );
procedure cusdVCF_rotateCoordinates( d_XYrot, d_XY:cfVector; size:UIntSize; d_costheta, d_sintheta:Single );
procedure VFcu_rotateCoordinates( h_Xrot, h_Yrot, h_X, h_Y:fVector; size:UIntSize; costheta, sintheta:Single );
procedure VCFcu_rotateCoordinates( h_XYrot, h_XY:cfVector; size:UIntSize; costheta, sintheta:Single );
DescriptionThe coordinates specified either in the real vector pair X,Y or in the complex vector XY are rotated counter-clockwise by the angle theta, specified as its cosine and sine, costheta and sintheta:
Xroti = cos(theta) * Xi - sin(theta) * Yi,
Yroti = sin(theta) * Xi + cos(theta) * Yi

The result can be scaled by a constant factor: Just multiply the arguments costheta and sintheta by the desired scaling factor. costheta and sintheta need not actually correspond to any real angle.

Error handlingnone
Return valuenone
See alsoVF_lincomb

 

VF_roundVD_roundVE_round
VF_roundtoIVD_roundtoIVE_roundtoI
VF_roundtoBIVD_roundtoBIVE_roundtoBI
VF_roundtoSIVD_roundtoSIVE_roundtoSI
VF_roundtoLIVD_roundtoLIVE_roundtoLI
VF_roundtoQIVD_roundtoQIVE_roundtoQI
VF_roundtoUVD_roundtoUVE_roundtoU
VF_roundtoUBVD_roundtoUBVE_roundtoUB
VF_roundtoUSVD_roundtoUSVE_roundtoUS
VF_roundtoULVD_roundtoULVE_roundtoUL
VF_roundtoUQVD_roundtoUQVE_roundtoUQ
VF_roundtoUIVD_roundtoUIVE_roundtoUI
FunctionRounding to the nearest whole number.
Syntax C/C++#include <VFmath.h>
int VF_round( fVector Y, fVector X, ui size );
int VF_roundtoI( iVector Y, fVector X, ui size );
int VF_roundtoLI( liVector Y, fVector X, ui size );

    (similarly all other functions of this family)
C++ VecObj#include <OptiVec.h>
int vector<T>::round( const vector<T>& X );
int vector<int>::roundtoI( const vector<T>& X );
int vector<long>::roundtoLI( const vector<T>& X );
Pascal/Delphiuses VFmath;
function VF_round( Y, X:fVector; size:UIntSize ): IntBool;
function VF_roundtoI( Y:iVector; X:fVector; size:UIntSize ): IntBool;
function VF_roundtoLI( Y:liVector; X:fVector; size:UIntSize ): IntBool;

    (similarly all other functions of this family)
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_round( fVector d_Y, fVector d_X, ui size );
int cudaVF_roundtoI( iVector d_Y, fVector d_X, ui size );
int VFcu_round( fVector h_Y, fVector h_X, ui size );
int VFcu_roundtoI( iVector h_Y, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_round( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVF_roundtoI( d_Y:iVector; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_round( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFcu_roundtoI( h_Y:iVector; h_X:fVector; size:UIntSize ): IntBool;
DescriptionEach element of X is rounded to the nearest integer value. In case of a fractional part of exactly 0.5, the nearest even integer value is chosen and stored in Y. For example, 2.5 is rounded to 2, and 3.5 is rounded to 4.
The functions VF_roundtoI,   VF_roundtoLI,   VF_roundtoU, etc. convert the result into the various integer data types.
Error handlingOVERFLOW and DOMAIN errors are handled "silently", i.e., without any error message and without being indicated by the return value. In the case of OVERFLOW errors, the result is set to the extreme value possible. Negative numbers in the versions VF_roundtoU,   VF_roundtoUB,   VF_roundtoUS,   VF_roundtoUL, and VF_roundtoUI (which would lead to DOMAIN errors) are handled by setting the result to 0.
Return valuealways FALSE (0)
See alsoVF_ceil,   VF_floor,   VF_chop,   VF_trunc

 

VF_rcubicVD_rcubicVE_rcubic
VFx_rcubicVDx_rcubicVEx_rcubic
VFu_rcubicVDu_rcubicVEu_rcubic
VFux_rcubicVDux_rcubicVEux_rcubic
FunctionReciprocal Cubic (reciprocal of third power)
Syntax C/C++#include <VFmath.h>
int VF_rcubic( fVector Y, fVector X, ui size );
int VFx_rcubic( fVector Y, fVector X, ui size, float A, float B );
int VFu_rcubic( fVector Y, fVector X, ui size );
int VFux_rcubic( fVector Y, fVector X, ui size, float A, float B );
C++ VecObj#include <OptiVec.h>
int vector<T>::rcubic( const vector<T>& X );
int vector<T>::x_rcubic( const vector<T>& X, const T& A, const T& B );
int vector<T>::u_rcubic( const vector<T>& X );
int vector<T>::ux_rcubic( const vector<T>& X, const T& A, const T& B );
Pascal/Delphiuses VFmath;
function VF_rcubic( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_rcubic( Y, X:fVector; size:UIntSize; A, B:Single ): IntBool;
function VFu_rcubic( Y, X:fVector; size:UIntSize ): IntBool;
function VFux_rcubic( Y, X:fVector; size:UIntSize; A, B:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_rcubic( fVector d_Y, fVector d_X, ui size );
int cudaVFx_rcubic( fVector d_Y, fVector d_X, ui size, float A, float B );
int cusdVFx_rcubic( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B );
int VFucu_rcubic( fVector h_Y, fVector h_X, ui size );
int VFuxcu_rcubic( fVector h_Y, fVector h_X, ui size, float A, float B );
int cudaVFu_rcubic( fVector d_Y, fVector d_X, ui size );
int cudaVFux_rcubic( fVector d_Y, fVector d_X, ui size, float A, float B );
int cusdVFux_rcubic( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B );
int VFucu_rcubic( fVector h_Y, fVector h_X, ui size );
int VFuxcu_rcubic( fVector h_Y, fVector h_X, ui size, float A, float B );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_rcubic( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_rcubic( d_Y, d_X:fVector; size:UIntSize; A, B:Single ): IntBool;
function cusdVFx_rcubic( d_Y, d_X:fVector; size:UIntSize; d_A, d_B:PSingle ): IntBool;
function VFcu_rcubic( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_rcubic( h_Y, h_X:fVector; size:UIntSize; A, B:Single ): IntBool;
function cudaVFu_rcubic( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFux_rcubic( d_Y, d_X:fVector; size:UIntSize; A, B:Single ): IntBool;
function cusdVFux_rcubic( d_Y, d_X:fVector; size:UIntSize; d_A, d_B:PSingle ): IntBool;
function VFucu_rcubic( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFuxcu_rcubic( h_Y, h_X:fVector; size:UIntSize; A, B:Single ): IntBool;
Descriptionsimple versions: Yi = 1 / Xi3
expanded versions: Yi = 1 / (A*Xi+B)3

"unprotected" versions (prefix VFu_,   VFux_, etc.):
These functions do not perform any error handling, which makes them much faster, but somewhat riskier than the standard versions.

Error handlingSING and OVERFLOW errors lead to a default result of ±HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_square,   VF_quartic,   VF_sqrt,   VF_cubic,   VF_pow,   VF_ipow,   VF_poly

 

VF_rquarticVD_rquarticVE_rquartic
VFx_rquarticVDx_rquarticVEx_rquartic
VFu_rquarticVDu_rquarticVEu_rquartic
VFux_rquarticVDux_rquarticVEux_rquartic
FunctionReciprocal of fourth power
Syntax C/C++#include <VFmath.h>
int VF_rquartic( fVector Y, fVector X, ui size );
int VFx_rquartic( fVector Y, fVector X, ui size, float A, float B );
int VFu_rquartic( fVector Y, fVector X, ui size );
int VFux_rquartic( fVector Y, fVector X, ui size, float A, float B );
C++ VecObj#include <OptiVec.h>
int vector<T>::rquartic( const vector<T>& X );
int vector<T>::x_rquartic( const vector<T>& X, const T& A, const T& B );
int vector<T>::u_rquartic( const vector<T>& X );
int vector<T>::ux_rquartic( const vector<T>& X, const T& A, const T& B );
Pascal/Delphiuses VFmath;
function VF_rquartic( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_rquartic( Y, X:fVector; size:UIntSize; A, B:Single ): IntBool;
function VFu_rquartic( Y, X:fVector; size:UIntSize ): IntBool;
function VFux_rquartic( Y, X:fVector; size:UIntSize; A, B:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_rquartic( fVector d_Y, fVector d_X, ui size );
int cudaVFx_rquartic( fVector d_Y, fVector d_X, ui size, float A, float B );
int cusdVFx_rquartic( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B );
int VFucu_rquartic( fVector h_Y, fVector h_X, ui size );
int VFuxcu_rquartic( fVector h_Y, fVector h_X, ui size, float A, float B );
int cudaVFu_rquartic( fVector d_Y, fVector d_X, ui size );
int cudaVFux_rquartic( fVector d_Y, fVector d_X, ui size, float A, float B );
int cusdVFux_rquartic( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B );
int VFucu_rquartic( fVector h_Y, fVector h_X, ui size );
int VFuxcu_rquartic( fVector h_Y, fVector h_X, ui size, float A, float B );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_rquartic( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_rquartic( d_Y, d_X:fVector; size:UIntSize; A, B:Single ): IntBool;
function cusdVFx_rquartic( d_Y, d_X:fVector; size:UIntSize; d_A, d_B:PSingle ): IntBool;
function VFcu_rquartic( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_rquartic( h_Y, h_X:fVector; size:UIntSize; A, B:Single ): IntBool;
function cudaVFu_rquartic( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFux_rquartic( d_Y, d_X:fVector; size:UIntSize; A, B:Single ): IntBool;
function cusdVFux_rquartic( d_Y, d_X:fVector; size:UIntSize; d_A, d_B:PSingle ): IntBool;
function VFucu_rquartic( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFuxcu_rquartic( h_Y, h_X:fVector; size:UIntSize; A, B:Single ): IntBool;
Descriptionsimple versions: Yi = 1 / Xi 4
expanded versions: Yi = 1 / (A*Xi+B)4
The reciprocal of the fourth power of the elements of X is stored in Y.
The "unprotected" versions (prefix VFu_,   VFux_, etc.) do not perform any error handling, which makes them much faster, but riskier than the standard versions.
Error handlingSING and OVERFLOW errors lead to a default result of HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_square,   VF_cubic,   VF_quartic,   VF_sqrt,   VF_pow,   VF_ipow,   VF_poly

 

VF_rsqrtVD_rsqrtVE_rsqrt
VFu_rsqrtVDu_rsqrtVEu_rsqrt
FunctionReciprocal square root
Syntax C/C++#include <VFmath.h>
int VF_rsqrt( fVector Y, fVector X, ui size );
int VFx_rsqrt( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::rsqrt( const vector<T>& X );
int vector<T>::x_rsqrt( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_rsqrt( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_rsqrt( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_rsqrt( fVector d_Y, fVector d_X, ui size );
int cudaVFx_rsqrt( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_rsqrt( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_rsqrt( fVector h_Y, fVector h_X, ui size );
int VFxcu_rsqrt( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_rsqrt( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_rsqrt( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_rsqrt( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_rsqrt( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_rsqrt( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = 1 / sqrt( Xi )
expanded versions: Yi = C / sqrt( A*Xi+B )

The "unprotected" versions (prefix VFu_,   VFux_, etc.) do not perform any error handling, which makes them much faster than the standard versions. On the other hand, any negative or near-zero input number may lead to an uncontrolled programme crash.

Error handlingNormal versions (VF_, VFx_ etc.): DOMAIN errors occur if, in the real-number versions, the square root of a negative numbers is requested; NAN ("not-a-number") is the default result in this case. SING or OVERFLOW errors are treated with the result HUGE_VAL.
Unprotected versions (VFu_, VFux_ etc.): no error handling.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_square,   VF_sqrt,   VF_pow,   VF_ipow,   VF_poly

 

VF_rsquareVD_rsquareVE_rsquare
VFx_rsquareVDx_rsquareVEx_rsquare
VFu_rsquareVDu_rsquareVEu_rsquare
VFux_rsquareVDux_rsquareVEux_rsquare
FunctionReciprocal square
Syntax C/C++#include <VFmath.h>
int VF_rsquare( fVector Y, fVector X, ui size );
int VFx_rsquare( fVector Y, fVector X, ui size, float A, float B );
int VFu_rsquare( fVector Y, fVector X, ui size );
int VFux_rsquare( fVector Y, fVector X, ui size, float A, float B );
C++ VecObj#include <OptiVec.h>
int vector<T>::rsquare( const vector<T>& X );
int vector<T>::x_rsquare( const vector<T>& X, const T& A, const T& B );
int vector<T>::u_rsquare( const vector<T>& X );
int vector<T>::ux_rsquare( const vector<T>& X, const T& A, const T& B );
Pascal/Delphiuses VFmath;
function VF_rsquare( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_rsquare( Y, X:fVector; size:UIntSize; A, B:Single ): IntBool;
function VFu_rsquare( Y, X:fVector; size:UIntSize ): IntBool;
function VFux_rsquare( Y, X:fVector; size:UIntSize; A, B:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_rsquare( fVector d_Y, fVector d_X, ui size );
int cudaVFx_rsquare( fVector d_Y, fVector d_X, ui size, float A, float B );
int cusdVFx_rsquare( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B );
int VFucu_rsquare( fVector h_Y, fVector h_X, ui size );
int VFuxcu_rsquare( fVector h_Y, fVector h_X, ui size, float A, float B );
int cudaVFu_rsquare( fVector d_Y, fVector d_X, ui size );
int cudaVFux_rsquare( fVector d_Y, fVector d_X, ui size, float A, float B );
int cusdVFux_rsquare( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B );
int VFucu_rsquare( fVector h_Y, fVector h_X, ui size );
int VFuxcu_rsquare( fVector h_Y, fVector h_X, ui size, float A, float B );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_rsquare( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_rsquare( d_Y, d_X:fVector; size:UIntSize; A, B:Single ): IntBool;
function cusdVFx_rsquare( d_Y, d_X:fVector; size:UIntSize; d_A, d_B:PSingle ): IntBool;
function VFcu_rsquare( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_rsquare( h_Y, h_X:fVector; size:UIntSize; A, B:Single ): IntBool;
function cudaVFu_rsquare( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFux_rsquare( d_Y, d_X:fVector; size:UIntSize; A, B:Single ): IntBool;
function cusdVFux_rsquare( d_Y, d_X:fVector; size:UIntSize; d_A, d_B:PSingle ): IntBool;
function VFucu_rsquare( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFuxcu_rsquare( h_Y, h_X:fVector; size:UIntSize; A, B:Single ): IntBool;
Descriptionsimple versions: Yi = 1 / Xi2
expanded versions: Yi = 1 / (A*Xi+B)2

The "unprotected" versions (prefix VFu_,   VFux_, etc.) do not perform any error handling, which makes them much faster, but riskier than the standard versions.

Error handlingSING and OVERFLOW errors lead to a default result of HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_cubic,   VF_square,   VF_sqrt,   VF_pow,   VF_ipow,   VF_poly

 

VF_runintegralCVD_runintegralCVE_runintegralC
Function"running integral" of an array sampled at equally-spaced abscissa points.
Syntax C/C++#include <VFstd.h>
void VF_runintegralC( fVector Y, fVector X, ui size, float DeltaT );
C++ VecObj#include <OptiVec.h>
void vector<T>::runintegralC( const vector<T>& X, T DeltaT );
Pascal/Delphiuses VFstd;
procedure VF_runintegralC( Y, X:fVector; size:UIntSize; DeltaT:Single );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_runintegralC( fVector d_Y, fVector d_X, ui size, float DeltaT );
int cusdVF_runintegralC( fVector d_Y, fVector d_X, ui size, float *d_DeltaT );
void VFcu_runintegralC( fVector h_Y, fVector h_X, ui size, float DeltaT );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_runintegralC( d_Y, d_X:fVector; size:UIntSize; DeltaT:Single ): IntBool;
function cusdVF_runintegralC( d_Y, d_X:fVector; size:UIntSize; d_DeltaT:PSingle ): IntBool;
procedure VFcu_runintegralC( h_Y, h_X:fVector; size:UIntSize; DeltaT:Single );
DescriptionThe vector X is assumed to be a function of a variable t; the t values themselves are equally spaced. Therefore, only their spacing, DeltaT, must be known to the function. Each element of Y is the integral of all elements of X up to and including the one with the same index. Thus, the last element of Y contains the value of the integral over the whole of X (the area under X). If only this value is of interest, VF_integralC should be used.
Error handlingnone
Return valuenone
See alsoVF_runintegralV,   VF_integralC,   VF_derivC,   VF_runsum

 

VF_runintegralVVD_runintegralVVE_runintegralV
Function"running integral"
Syntax C/C++#include <VFmath.h>
void VF_runintegralV( fVector Z, fVector X, fVector Y, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::runintegralV( const vector<T>& X, const vector<T>& Y );
Pascal/Delphiuses VFmath;
procedure VF_runintegralV( Z, X, Y:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_runintegralV( fVector d_Z, fVector d_X, fVector d_Y, ui size );
void VFcu_runintegralV( fVector h_Z, fVector h_X, fVector h_Y, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_runintegralV( d_Z, d_X, d_Y:fVector; size:UIntSize );
procedure VFcu_runintegralV( h_Z, h_X, h_Y:fVector; size:UIntSize );
DescriptionY is a function of the variable x which is represented by X. Each element of Z is the integral over all elements of Y up to and including the one with the same index. The first element of Z is always FALSE (0).0. The last element of Z is equal to the value of the integral, i.e. to the area under Y. If only this value of the integral is of interest, VF_integralV should be used.
Error handlingnone
Return valuenone
See alsoVF_runintegralC,   VF_integralV,   VF_derivV

 

VF_runmaxVD_runmaxVE_runmax
VI_runmaxVBI_runmaxVSI_runmaxVLI_runmaxVQI_runmax 
VU_runmaxVUB_runmaxVUS_runmaxVUL_runmaxVUQ_runmaxVUI_runmax
Function"running" maximum.
Syntax C/C++#include <VFstd.h>
void VF_runmax( fVector Y, fVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::runmax( const vector<T>& X );
Pascal/Delphiuses VFstd;
procedure VF_runmax( Y, X:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_runmax( fVector d_Y, fVector d_X, ui size );
void VFcu_runmax( fVector h_Y, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_runmax( d_Y, d_X:fVector; size:UIntSize );
procedure VFcu_runmax( h_Y, h_X:fVector; size:UIntSize );
DescriptionEach element of Y is the maximum of the corresponding and all preceding elements of X.
Error handlingnone
Return valuenone
See alsoVF_max,   VF_runmin,   VF_runsum

 

VF_runminVD_runminVE_runmin
VI_runminVBI_runminVSI_runminVLI_runminVQI_runmin 
VU_runminVUB_runminVUS_runminVUL_runminVUQ_runminVUI_runmin
Function"running" minimum
Syntax C/C++#include <VFstd.h>
void VF_runmin( fVector Y, fVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::runmin( const vector<T>& X );
Pascal/Delphiuses VFstd;
procedure VF_runmin( Y, X:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_runmin( fVector d_Y, fVector d_X, ui size );
void VFcu_runmin( fVector h_Y, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_runmin( d_Y, d_X:fVector; size:UIntSize );
procedure VFcu_runmin( h_Y, h_X:fVector; size:UIntSize );
DescriptionEach element of Y is the minimum of the corresponding and all preceding elements of X.
Error handlingnone
Return valuenone
See alsoVF_min,   VF_runmax,   VF_runsum

 

VF_runprodVD_runprodVE_runprod
VCF_runprodVCD_runprodVCE_runprod
VPF_runprodVPD_runprodVPE_runprod
Function"running" product
Syntax C/C++#include <VFstd.h>
void VF_runprod( fVector Y, fVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::runprod( const vector<T>& X );
Pascal/Delphiuses VFstd;
procedure VF_runprod( Y, X:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_runprod( fVector d_Y, fVector d_X, ui size );
void VFcu_runprod( fVector h_Y, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_runprod( d_Y, d_X:fVector; size:UIntSize );
procedure VFcu_runprod( h_Y, h_X:fVector; size:UIntSize );
DescriptionEach element of Y is the product of the corresponding and all preceding elements of X. This function should be used with care: overflow is easily reached, and underflow may lead to all elements from a certain position on being zero.
Error handlingnone
Return valuenone
See alsoVF_prod,   VF_runsum

 

VF_runsumVD_runsumVE_runsum
VCF_runsumVCD_runsumVCE_runsum
VI_runsumVBI_runsumVSI_runsumVLI_runsumVQI_runsum 
VU_runsumVUB_runsumVUS_runsumVUL_runsumVUQ_runsumVUI_runsum
Function"running" sum, also called "cumulative sum" or "inclusive sum-scan"
Syntax C/C++#include <VFstd.h>
void VF_runsum( fVector Y, fVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::runsum( const vector<T>& X );
Pascal/Delphiuses VFstd;
procedure VF_runsum( Y, X:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_runsum( fVector d_Y, fVector d_X, ui size );
void VFcu_runsum( fVector h_Y, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_runsum( d_Y, d_X:fVector; size:UIntSize );
procedure VFcu_runsum( h_Y, h_X:fVector; size:UIntSize );
DescriptionEach element of Y is the sum of the corresponding and all preceding elements of X.
Error handlingnone (but be careful: this function may easily overflow!)
Return valuenone
See alsoVF_sum,   VF_runprod

 

VCF_sabsmaxVCD_sabsmaxVCE_sabsmax
FunctionLargest complex vector element in terms of the sum |Re| + |Im|
Syntax C/C++#include <VCFstd.h>
fComplex VCF_sabsmax( cfVector X, ui size);
C++ VecObj#include <OptiVec.h>
T vector<complex<T>>::sabsmax();
Pascal/Delphiuses VCFstd;
function VCF_sabsmax( X:cfVector; size:UIntSize ):fComplex;

Alternative syntax (obsolete, but still supported):
procedure VCF_sabsmax( var RetVal:fComplex; X:cfVector; size:UIntSize );

    (similarly VCD_,   VCE_)
CUDA function C/C++#include <cudaVCFstd.h>
int cudaVCF_sabsmax( fComplex *h_RetVal, cfVector d_X, ui size );
int cusdVCF_sabsmax( fComplex *d_RetVal, cfVector d_X, ui size );
fComplex VCFcu_sabsmax( cfVector h_X, ui size );
CUDA function Pascal/Delphiuses VCFstd;
function cudaVCF_sabsmax( var h_RetVal:fComplex; d_X:cfVector; size:UIntSize ): IntBool;
function cusdVCF_sabsmax( d_RetVal:PfComplex; d_X:cfVector; size:UIntSize ): IntBool;
function VCFcu_sabsmax( h_X:cfVector; size:UIntSize ):fComplex;
DescriptionBy the criterion of the sum |Re| + |Im|, the largest element of a cartesian complex vector is found and returned. In many applications, this function may serve as a much faster replacement for VCF_cabsmax. The latter function uses the absolute value, sqrt(Re2 + Im2), as its criterion.
Error handlingnone
Return valuelargest element
See alsoVCF_absmax,   VCF_absmaxReIm,   VCF_cabsmax

 

VCF_sabsminVCD_sabsminVCE_sabsmin
FunctionSmallest complex vector element in terms of the sum |Re| + |Im|
Syntax C/C++#include <VCFstd.h>
fComplex VCF_sabsmin( cfVector X, ui size);
C++ VecObj#include <OptiVec.h>
T vector<complex<T>>::sabsmin();
Pascal/Delphiuses VCFstd;
function VCF_sabsmin( X:cfVector; size:UIntSize ):fComplex;

Alternative syntax (obsolete, but still supported):
procedure VCF_sabsmin( var RetVal:fComplex; X:cfVector; size:UIntSize );

    (similarly VCD_,   VCE_)
CUDA function C/C++#include <cudaVCFstd.h>
int cudaVCF_sabsmin( fComplex *h_RetVal, cfVector d_X, ui size );
int cusdVCF_sabsmin( fComplex *d_RetVal, cfVector d_X, ui size );
fComplex VCFcu_sabsmin( cfVector h_X, ui size );
CUDA function Pascal/Delphiuses VCFstd;
function cudaVCF_sabsmin( var h_RetVal:fComplex; d_X:cfVector; size:UIntSize ): IntBool;
function cusdVCF_sabsmin( d_RetVal:PfComplex; d_X:cfVector; size:UIntSize ): IntBool;
function VCFcu_sabsmin( h_X:cfVector; size:UIntSize ):fComplex;
DescriptionBy the criterion of the sum |Re| + |Im|, the smallest element of a cartesian complex vector is found and returned. In many applications, this function may serve as a much faster replacement for VCF_cabsmin. The latter function uses the absolute value, sqrt(Re2 + Im2), as its criterion.
Error handlingnone
Return valuesmallest element
See alsoVCF_absmin,   VCF_absminReIm,   VCF_cabsmin

 

VF_scale10VD_scale10VE_scale10
FunctionScaling by an integer power of 10.
Syntax C/C++#include <VFmath.h>
int VF_scale10( fVector Y, fVector X, ui size, int Expo );
C++ VecObj#include <OptiVec.h>
int vector<T>::scale10( const vector<T>& X, int Expo );
Pascal/Delphiuses VFmath;
function VF_scale10( Y, X:fVector; size:UIntSize; Expo:Integer ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_scale10( fVector d_Y, fVector d_X, ui size, int Expo );
int VFcu_scale10( fVector h_Y, fVector h_X, ui size, int Expo );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_scale10( d_Y, d_X:fVector; size:UIntSize; Expo:Integer ): IntBool;
function VFcu_scale10( h_Y, h_X:fVector; size:UIntSize; Expo:Integer ): IntBool;
DescriptionYi = Xi * (10 Expo)
Note that higher powers of ten are not representable as exact numbers, which may lead to the introduction of round-off error by the scaling. If this is a problem, VF_scale2 should be used instead.
Error handlingOVERFLOW errors lead to a default result of ±HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_scale2,   VF_mantexp

 

VF_scale2VD_scale2VE_scale2
FunctionScaling by an integer power of 2.
Syntax C/C++#include <VFmath.h>
int VF_scale2( fVector Y, fVector X, ui size, int Expo );
C++ VecObj#include <OptiVec.h>
int vector<T>::scale2( const vector<T>& X, int Expo );
Pascal/Delphiuses VFmath;
function VF_scale2( Y, X:fVector; size:UIntSize; Expo:Integer ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_scale2( fVector d_Y, fVector d_X, ui size, int Expo );
int VFcu_scale2( fVector h_Y, fVector h_X, ui size, int Expo );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_scale2( d_Y, d_X:fVector; size:UIntSize; Expo:Integer ): IntBool;
function VFcu_scale2( h_Y, h_X:fVector; size:UIntSize; Expo:Integer ): IntBool;
DescriptionYi = Xi * (2 Expo)
Error handlingOVERFLOW errors lead to a default result of ±HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_scale10,   VF_mantexp,   ldexp (C/C++)

 

VF_scalprodVD_scalprodVE_scalprod
FunctionScalar product of two vectors
Syntax C/C++#include <VFstd.h>
float VF_scalprod( fVector X, fVector Y, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::scalprod( const vector<T>& Y );
Pascal/Delphiuses VFstd;
function VF_scalprod( X, Y:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_scalprod( float *h_RetVal, fVector d_X, fVector d_Y, ui size );
int cusdVF_scalprod( float *d_RetVal, fVector d_X, fVector d_Y, ui size );
float VFcu_scalprod( fVector h_X, fVector h_Y, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_scalprod( var h_RetVal:Single; d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cusdVF_scalprod( d_RetVal:PSingle; d_X, d_Y:fVector; size:UIntSize ): IntBool;
function VFcu_scalprod( h_X, h_Y:fVector; size:UIntSize ): Single;
Descriptionscalprod = sum( Xi * Yi )
The scalar (or dot) product of two vectors is defined as the sum of the products of the corresponding elements. The scalar product of a vector with itself is the square of its magnitude and may be calculated using the function VF_ssq.
Error handlingnone
Return valueproduct
See alsoVF_prod,   VF_xprod,   VF_sum,   VF_ssq

 

VF_searchCVD_searchCVE_searchC
FunctionBinary searches of an ordered table for the entry coming closest to a specified value
Syntax C/C++#include <VFstd.h>
ui VF_searchC( fVector X, ui size, float C, int mode );
C++ VecObj#include <OptiVec.h>
ui vector<T>::searchC( const T& C, int mode );
Pascal/Delphiuses VFstd;
function VF_searchC( X:fVector; size:UIntSize; C:Single; mode:Integer ):UIntSize;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_searchC( ui *h_Ind, fVector d_X, ui size, float C, int mode );
int cusdVF_searchC( ui *d_Ind, fVector d_X, ui size, float *d_C, int mode );
ui VFcu_searchC( fVector h_X, ui size, float C, int mode );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_searchC( d_X:fVector; size:UIntSize; C:Single; mode:Integer ): IntBool;
function cusdVF_searchC( d_X:fVector; size:UIntSize; d_C:PSingle; mode:Integer ): IntBool;
function VFcu_searchC( h_X:fVector; size:UIntSize; C:Single; mode:Integer ):UIntSize;
DescriptionIn a binary search, the element of X is located that is closest to the value specified as C. X has to be an ordered table (either ascending or descending); if this condition is not fulfilled, the result will be wrong. If C is outside the range covered by X, the first or the last element of X is chosen, whichever is closer to C. If C is within the range of the table, three modes of the search are available:
mode = +1:find the next element greater than or equal to C
mode =   0:find the element closest to C; if two elements are within equal distance, choose the lower index
mode =  −1:find the next element less than or equal to C
Error handlingnone
Return valueindex of the element found.
See alsoVF_searchV,   VF_sort,   VF_polyinterpol

 

VF_searchVVD_searchVVE_searchV
FunctionBinary search of an ordered table for the entries coming closest to the values specified as the elements of a vector
Syntax C/C++#include <VFstd.h>
void VF_searchV( uiVector Ind, fVector X, ui sizex, fVector Tab, ui sizetab, int mode );
C++ VecObj#include <OptiVec.h>
void vector<ui>::searchV( const vector<T>& X, const vector<T>& Tab, int mode );
Pascal/Delphiuses VFmath;
procedure VF_searchV( Ind:uiVector; X:fVector; sizex:UIntSize; Tab:fVector; sizetab:UIntSize; mode:Integer );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_searchV( uiVector d_Ind, fVector d_X, ui sizex, fVector d_Tab, ui sizetab, int mode );
void VFcu_searchV( uiVector h_Ind, fVector h_X, ui sizex, fVector h_Tab, ui sizetab, int mode );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_searchV( d_Ind:uiVector; d_X:fVector; sizex:UIntSize; d_Tab:fVector; sizetab:UIntSize; mode:Integer ): IntBool;
procedure VFcu_searchV( h_Ind:uiVector; h_X:fVector; sizex:UIntSize; h_Tab:fVector; sizetab:UIntSize; mode:Integer );
DescriptionFor each element of X, the element of the table Tab is located that is closest to it. Tab has to be ordered (either ascending or descending); if this condition is not fulfilled, the results will be wrong.
If Xi is outside the range of the table, the first or the last element of the table is chosen, whichever is appropriate. Otherwise, three modes of the search are available:
mode = +1: find the next element greater than or equal to Xi
mode =   0:find the element closest to Xi; if two elements are within equal distance, choose the lower index
mode =  −1:find the next element less than or equal to Xi

sizex is the number of elements of X and of Ind, whereas sizetab denotes the number of elements of the table Tab.

Error handlingnone
Return valuenone
See alsoVF_searchC,   VF_indpick,   VF_sortind,   VF_polyinterpol

 

VF_secVD_secVE_sec
VFx_secVDx_secVEx_sec
FunctionSecant function
Syntax C/C++#include <VFmath.h>
int VF_sec( fVector Y, fVector X, ui size );
int VFx_sec( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::sec( const vector<T>& X );
int vector<T>::x_sec( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_sec( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_sec( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_sec( fVector d_Y, fVector d_X, ui size );
int cudaVFx_sec( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_sec( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_sec( fVector h_Y, fVector h_X, ui size );
int VFxcu_sec( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_sec( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_sec( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_sec( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_sec( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_sec( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = sec( Xi )    = 1 / cos( Xi )
expanded versions: Yi = C * sec( A*Xi+B )
The secant is defined as the inverse of the cosine (not to be mistaken for the arcus function arccos). For large values of Xi, round-off error becomes appreciable; if the Xi values are representable as rational multiples of p, it is better to use VF_secrpi than VF_sec.
Error handlingSING or OVERFLOW errors lead to the default result ±HUGE_VAL. TLOSS precision errors lead to a result of 1.0 (as if the input were 0.0).
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_sec2,   VF_secrpi,   VF_cos,   VF_sech,   cos

 

VF_sec2VD_sec2VE_sec2
VFx_sec2VDx_sec2VEx_sec2
FunctionSquare of the secant function
Syntax C/C++#include <VFmath.h>
int VF_sec2( fVector Y, fVector X, ui size );
int VFx_sec2( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::sec2( const vector<T>& X );
int vector<T>::x_sec2( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_sec2( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_sec2( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_sec2( fVector d_Y, fVector d_X, ui size );
int cudaVFx_sec2( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_sec2( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_sec2( fVector h_Y, fVector h_X, ui size );
int VFxcu_sec2( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_sec2( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_sec2( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_sec2( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_sec2( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_sec2( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = sec2( Xi )
expanded versions: Yi = C * sec2( A*Xi+B )
Calculating the squared trigonometric functions directly is faster and sometimes more accurate than first calculating the trigonometric function itself and squaring it afterwards.
Error handlingFor SING and OVERFLOW errors, the default result is HUGE_VAL (multiplied by the sign of C in the expanded versions); TLOSS errors lead to a default result of 1.0 or C, resp. (as if the input were 0.0).
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_sec,   VF_secrpi

 

VF_sechVD_sechVE_sech
VFx_sechVDx_sechVEx_sech
FunctionHyperbolic secant function
Syntax C/C++#include <VFmath.h>
int VF_sech( fVector Y, fVector X, ui size );
int VFx_sech( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::sech( const vector<T>& X );
int vector<T>::x_sech( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_sech( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_sech( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_sech( fVector d_Y, fVector d_X, ui size );
int cudaVFx_sech( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_sech( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_sech( fVector h_Y, fVector h_X, ui size );
int VFxcu_sech( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_sech( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_sech( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_sech( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_sech( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_sech( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions:
Yi = sech( Xi )
    = 2 / (exp( Xi ) + exp( −Xi ))
expanded versions:
Yi = C * sech( A*Xi+B )
Error handlingThese functions should be error-proof.
Return valuealways FALSE (0)
See alsoVF_sinh,   VF_sech2,   VF_exp,   sinh

 

VF_sech2VD_sech2VE_sech2
VFx_sech2VDx_sech2VEx_sech2
FunctionSquare of the hyperbolic secant function
Syntax C/C++#include <VFmath.h>
int VF_sech2( fVector Y, fVector X, ui size );
int VFx_sech2( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::sech2( const vector<T>& X );
int vector<T>::x_sech2( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_sech2( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_sech2( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_sech2( fVector d_Y, fVector d_X, ui size );
int cudaVFx_sech2( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_sech2( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_sech2( fVector h_Y, fVector h_X, ui size );
int VFxcu_sech2( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_sech2( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_sech2( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_sech2( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_sech2( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_sech2( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = sech2( Xi )
expanded versions: Yi = C * sech2( A*Xi+B )
The sech2 function is used in physics, e.g., to describe the shape of ultrashort light pulses. Compared to a Gaussian or Lorentzian pulse shape of the same autocorrelation width (see VF_autocorr), the sech2 function has the smallest FWHM (full width to half maximum).
Error handlingThese functions should be error-proof.
Return valuealways FALSE (0)
See alsoVF_sech,   VF_sinh,   VF_exp,   VF_Gauss,   VF_Lorentz

 

VF_secrpiVD_secrpiVE_secrpi
VF_secrpi2VD_secrpi2VE_secrpi2
VF_secrpi3VD_secrpi3VE_secrpi3
FunctionSecant function of fractional multiples of p
Syntax C/C++#include <VFmath.h>
int VF_secrpi( fVector Y, iVector P, ui size, int q );
int VF_secrpi2( fVector Y, iVector P, ui size, int q );
int VF_secrpi3( fVector Y, iVector P, ui size, int q );
C++ VecObj#include <OptiVec.h>
int vector<T>::secrpi( const vector<int>& P, int q );
int vector<T>::secrpi2( const vector<int>& P, int q );
int vector<T>::secrpi3( const vector<int>& P, int q );
Pascal/Delphiuses VFmath;
function VF_secrpi( Y:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
function VF_secrpi2( Y:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
function VF_secrpi3( Y:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_secrpi( fVector d_Y, iVector d_P, ui size, int q );
int cudaVF_secrpi2( fVector d_Y, iVector d_P, ui size, int q );
int cudaVF_secrpi3( fVector d_Y, iVector d_P, ui size, int q );
int VFcu_secrpi( fVector h_Y, iVector h_P, ui size, int q );
int VFcu_secrpi2( fVector h_Y, iVector h_P, ui size, int q );
int VFcu_secrpi3( fVector h_Y, iVector h_P, ui size, int q );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_secrpi( d_Y:fVector; d_P:iVector; size:UIntSize; q:Integer ): IntBool;
function cudaVF_secrpi2( d_Y:fVector; d_P:iVector; size:UIntSize; q:Integer ): IntBool;
function cudaVF_secrpi3( d_Y:fVector; d_P:iVector; size:UIntSize; q:Integer ): IntBool;
function VFcu_secrpi( h_Y:fVector; h_P:iVector; size:UIntSize; q:Integer ): IntBool;
function VFcu_secrpi2( h_Y:fVector; h_P:iVector; size:UIntSize; q:Integer ): IntBool;
function VFcu_secrpi3( h_Y:fVector; h_P:iVector; size:UIntSize; q:Integer ): IntBool;
DescriptionYi = sec( (Pi / q) * p )
The secant of fractional multiples of p is calculated. There are three versions: VF_secrpi is for general use with any arbitrary denominator q. If q is a power of 2, VF_secrpi2 should be used which is a highly optimized version utilizing a look-up table. If q is a multiple of 3, VF_secrpi3 should be used. VF_secrpi2 and VF_secrpi3 work also with q values they are not optimized for; in this case, however, memory space is wasted for the tables.
Error handlingSING errors occur if Pi / q is an odd multiple of 1/2; the default result is 0.0 (which is the mean of +HUGE_VAL and -HUGE_VAL; similarly to VF_cosecrpi2, 0.0 is chosen irrespective to the fact that it is not a valid result of the secant function!);
q must be non-zero; this is, however, not tested for.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_sec,  cos

 

VF_selected_meanVD_selected_meanVE_selected_mean
FunctionMean of the elements of a one-dimensional distribution, falling into a specified interval
Syntax C/C++#include <VFstd.h>
float VF_selected_mean( ui *nsel, fVector X, ui size, float XMin, float XMax );
C++ VecObj#include <OptiVec.h>
T vector<T>::selected_mean( ui *nsel, T XMin, T XMax );
Pascal/Delphiuses VFstd;
function VF_selected_mean( var nsel:UIntSize; X:fVector; size:UIntSize; XMin, XMax:Single ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_selected_mean( ui *h_nsel, fVector d_X, ui size, float XMin, float XMax );
int cusdVF_selected_mean( ui *h_nsel, fVector d_X, ui size, float *d_XMin, float *d_XMax );
float VFcu_selected_mean( ui *h_nsel, fVector h_X, ui size, float XMin, float XMax );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_selected_mean( var h_RetVal:Single; var h_nsel:UIntSize; d_X:fVector; size:UIntSize; XMin, XMax:Single ):: IntBool;
function cusdVF_selected_mean( d_RetVal:PSingle; var h_nsel:UIntSize; d_X:fVector; size:UIntSize; d_XMin, d_XMax:PSingle ):: IntBool;
function VFcu_selected_mean( var h_nsel:UIntSize; h_X:fVector; size:UIntSize; XMin, XMax:Single ): Single;
DescriptionThose elements of X are selected, which fall into the interval XMin ≤ Xi ≤ XMax.
Their mean is calculated, and the number of selected elements is stored at the address nsel. If this number is not needed, nsel may be passed to the function as NULL (C/C++) or nil (Pascal/Delphi).
Error handlingIf no element falls into the specified range, nsel = 0 and the return value is (XMax+XMin)/2. If *nsel was given as NULL / nil, so that it cannot be set to zero, a warning message will be generated in that case.
Return valueMean of the selected vector elements
See alsoVF_mean

 

V_setAutoCudaUse
FunctionDecide if OptiVec functions shall automatically determine if they use the CUDA device or not
Syntax C/C++#include <cudaVecLib.h>
void V_setAutoCudaUse( int UseCuda );
Delphiuses VecLib;
procedure V_setAutoCudaUse( UseCuda: Integer );
DescriptionBy default, the (host) functions contained in the cudaOptiVec libraries (marked by the letter "C" in the library name, like OVVC8C.LIB) will automatically decide if any performance gain is to be expected from transferring part or all of the work to the CUDA device – and do so, if it seems advantageous. As the OptiVec functions cannot easily "know" the relative quality of your CPU and your CUDA device, this decision-making algorithm is far from perfect. Often, you may be better off by switching it off. In that case, one has to change the prefix of those functions which one actually wishes to employ the CUDA device by adding the letters "cu" before the underbar of the function prefix: instead of VF_ write VFcu_ etc.  If one decides to do that, the include-files <cudaVFstd.h>, <cudaVFmath.h> etc. have to be included.
UseCuda = 0 switches the automatic use of the CUDA device off.
Any non-zero value of UseCuda switches the automatic use of the CUDA device on again.
Return valuenone
See alsoCudaOptiVec.htm, Chapter 4. Distinguishing OptiVec Functions for Host and for Device Memory

 

V_setBoundaryCheckWarn
FunctionSwitch warnings about non-OptiVec vectors / matrices on and off (during checks for dimension mismatches)
Syntax C/C++#include <Veclib.h>
void V_setBoundaryCheckWarn( int WarnLevel );
Pascal/Delphiuses Veclib;
procedure V_setBoundaryCheckWarn( WarnLevel: IntBool );
DescriptionThe dimension-checking debug libraries (VCF4WD.LIB for Borland / CodeGear C++, OVVC4D.LIB for Visual C++, units in LIB4D for Delphi) will normally issue a warning, if any array not generated by V?_vector or M?_matrix is encountered. While using non-OptiVec vectors is perfectly legal, it might also be dangerous, as possible dimension-mismatches cannot detected. If you have to use static arrays (or arrays dynamic allocated with malloc or the Windows API memory functions) and do not want to see the warning messages, you may call
V_setBoundaryCheckWarn( 0 );  (C/C++) or
V_setBoundaryCheckWarn( FALSE );  (Pascal / Delphi).
This will switch off only the described warning messages. It does not affect the error messages. For details about the error and warning messages, see V_checkBoundaries.
Error handlingnone
Return valuenone
See alsoV_checkBoundaries

 

V_setCoordSystem
FunctionRestore the scalings and position of a coordinate system previously saved by V_getCoordSystem
Syntax C/C++#include <Vgraph.h>
void V_setCoordSystem( VCOORDSYSTEM *csys );
Pascal/Delphiuses Vgraph;
procedure V_setCoordSystem( csys: VCOORDSYSTEM );
DescriptionIf one wants to "hop" between several coordinate systems, displayed in one and the same window, one has to store the specifications (position and scalings) of each coordinate system separately, using V_getCoordSystem, and to retrieve them as needed, using this function.
The address of a struct VCOORDSYSTEM is passed as the argument. VCOORDSYSTEM is defined in <Vgraph.h> (C/C++) or the unit Vgraph (Pascal/Delphi).
For an example, see V_getCoordSystem.
Error handlingnone
Return valuenone
See alsoV_getCoordSystem,   V_setPlotRegion,   V_continuePlot

 

V_setCudaWorkspace
FunctionSet the OptiVec for CUDA workspace to be used by the following function calls
Syntax C/C++#include <cudaVecLib.h>
overror_t V_setCudaWorkspace( V_CUDAWORKSPACE wsp );
Delphiuses VecLib;
function V_setCudaWorkspace( wsp: V_CUDAWORKSPACE ): Integer;
DescriptionAn OptiVec for CUDA workspace, previously created by V_createCudaWorkspace, is set to be used by the following calls to cudaV?_ functions.
Return value0 if successful; non-zero if the workspace did not exist or did not contain a valid stream / buffer memory handles. As sometimes even an invalid workspace may seem to contain valid values, not all errors would be detected.
See alsoCudaOptiVec.htm, Chapter 5. Streams and Workspaces

 

VF_setElementVD_setElementVE_setElement
VCF_setElementVCD_setElementVCE_setElement
VPF_setElementVPD_setElementVPE_setElement
VI_setElementVBI_setElementVSI_setElementVLI_setElementVQI_setElement 
VU_setElementVUB_setElementVUS_setElementVUL_setElementVUQ_setElementVUI_setElement
FunctionSets a single vector element to a given value
Syntax C/C++#include <VFstd.h>
void VF_setElement( fVector X, ui pos, float C );
C++ VecObj#include <OptiVec.h>
vector<T>::setElement( ui pos, T C );
Pascal/Delphiuses VFstd;
procedure VF_setElement( X:fVector; pos:UIntSize; C:Single );
CUDA function C/C++#include <cudaVFstd.h>
void cudaVF_setElement( fVector d_X, ui pos, float C );
void cusdVF_setElement( fVector d_X, ui pos, float *d_C );
CUDA function Pascal/Delphiuses VFstd;
procedure cudaVF_setElement( d_X:fVector; pos:UIntSize; C:Single );
procedure cusdVF_setElement( d_X:fVector; pos:UIntSize; d_C:PSingle );
DescriptionThe element at the position pos is overwritten with the value C.
This function is needed to set elements of dynamically allocated vectors, for which older versions of Borland C++ had a pointer arithmetics bug, and Pascal/Delphi - unlike C - does not provide an own mechanism at all.
Error handlingnone
Return valuenone
See alsoVF_Pelement,   VF_element,   VF_getElement,   VF_accElement,   VF_decElement

 

V_setErrorEventFile
FunctionPrepare a file for printing error messages into it
Syntax C/C++#include <VecLib.h>
void V_setErrorEventFile( char *filename, unsigned ScreenAndFile );
Pascal/Delphiuses VecLib;
procedure V_setErrorEventFile( filename:PChar; ScreenAndFile:UInt );
DescriptionThis function determines where to print messages notifying errors that occur within OptiVec routines. filename is the desired name of the event file (often called "log-file"). ScreenAndFile decides if you wish to have error messages printed simultaneously into the file and onto the screen:
ScreenAndFile = 0: no screen output.
ScreenAndFile = 1: output into a message box (i.e., Windows default)
ScreenAndFile = 2: output into stderr (for Console programmes only)
 
The event file is closed by V_closeErrorEventFile. After that, OptiVec error messages are emitted according to the paramter ScreenAndFile with which the event file was generated.
 
By callingV_setErrorEventFile with a value of NULL or "NULL" (C/C++), nil or 'nil' (Pascal/Delphi) for filename no event file is generated:
V_setErrorEventFile( "NULL", 0 );: Any OptiVec messages are completely suppressed (which is probably not a wise choice in most instances).
V_setErrorEventFile( "NULL", 1 );: messages are printed into a message box.
V_setErrorEventFile( "NULL", 2 );: for Console programmes only: messages are emitted to stderr. In Visual C++, this option is possible only if the dynamic RTL is used; in the configurations DebugStatic and ReleaseStatic, it cannot be used and would be treated as "0".
Any previously generated event file remaines unchanged by this, of course.
 
If a user-defined _matherr function (C/C++) or any other custom error handler (both C/C++ and Pascal/Delphi) calls V_noteError, also errors occurring outside OptiVec routines will lead to a message printed into the event file (see chapter 5.5).
Error handlingIf the desired event file cannot be opened or created, the program is aborted with a message "Cannot open error event file".
Return valuenone
See alsoV_noteError,   V_closeErrorEventFile

 

V_setFPAccuracy
FunctionSet the coprecessor to a specific precision
Syntax C/C++#include <VecLib.h>
void V_setFPAccuracy( unsigned level );
Pascal/Delphiuses VecLib;
procedure V_setFPAccuracy( level:UInt );
DescriptionThis function changes the FPU Control-Word to switch the FPU to a specified accuracy, passed to the function as the argument level. For level=1, float / Single precision is obtained, level=2 leads to double precision, whereas level=3 switches the FPU into extended precision. The actual accuracy the coprocessor is switched to may be read through V_getFPAccuracy.
Operating the floating-point processor at float / Single precision may significantly speed up program execution, especially for any functions involving divisions (on Pentium or higher). This is true for functions (including OptiVec functions) of any floating-point data type. Thereby, you may even operate VD_ and VE_ functions at float / Single accuracy ? preserving double or extended range, but calculating results to single precision only.
On the other hand, as some versions of Windows XP and Vista automatically reduce the accuracy to double-precision instead of the standard 80-bit extended precision, you may actually wish to set V_setFPAccuracy( 3 ); in order to get full-precision results from the VD_ and VE_ functions.
There are several groups of functions which rely on full coprocessor accuracy for intermediate results, or which use precision-controlled iterations. Obviously, if the FPU operates in single precision only, such a function will never attain double precision and may get caught in an infinite loop. You should never call any of the following functions while the FPU is switched to single precision (or, for VE_ functions, to double precision):
V?_Kepler,
M?_SVdecompose,
or any of the nonlinear data fitting functions like VF_nonlinfit.
Return valuenone
See alsoV_getFPAccuracy

 

V_setFPErrorHandling
FunctionDefine the action taken in the case of floating-point errors
Syntax C/C++#include <VecLib.h>
void V_setFPErrorHandling( int fpHandlingMode );
Syntax Pascal/Delphiuses VecLib;
type V_fphand = 0..$1717;
procedure V_setFPErrorHandling( hand:V_fpHand );
DescriptionV_setFPErrorHandling allows to control the actions to be taken in the case of floating-point errors occurring within OptiVec functions in the debug libraries. This function has no effect in the production libraries.
A number of pre-defined constants fperrXXX is available for the construction of the desired error-handling mode:
 
ConstantValueMeaning
fperrIgnore0Ignore all floating-point errors: handle them silently, do not print a message, continue program execution
fperrNoteDOMAIN$0001Print a message in case of a DOMAIN error
fperrNoteSING$0002Print a message in case of a SING error
fperrNoteOVERFLOW$0003Print a message in case of an OVERFLOW error
fperrNoteTLOSS$0004Print a message in case of a TLOSS error
fperrAbortDOMAIN$0101Abort program in case of a DOMAIN error
fperrAbortSING$0202Abort program in case of a SING error
fperrAbortOVERFLOW$0303Abort program in case of an OVERFLOW error
fperrAbortTLOSS$0404Abort program in case of a TLOSS error
fperrDefaultHandling$0107Same as fperrAbortDOMAIN or fperrNoteSING or fperrNoteOVERFLOW
 
ExampleV_setFPErrorHandling( fperrAbortDOMAIN + fperrAbortSING + fperrAbortOVERFLOW + fperrNoteTLOSS );
In this example, program execution will be aborted (with the appropriate message) in the case of the most severe errors, DOMAIN and SING. In the case of OVERFLOW and TLOSS errors, a warning will be displayed, but program execution will be continued with default results set by the respective functions where the errors occur. The repeated occurrence of the same type of error within one and the same function will lead to only one message being generated. Subsequent errors will be treated silently.
Error handlingnone
Return valuenone
See alsoV_setIntErrorHandling,   V_setErrorEventFile,   V_noteError,   V_printErrorMsg

 

V_setIntErrorHandling
FunctionDefine the action taken in the case of INTEGER OVERFLOW and INTEGER DOMAIN errors (32-bit only).
Syntax C/C++#include <VecLib.h>
typedef enum {
    ierrIgnore = 0, ierrNote, ierrAbort
} V_ihand;
void V_setIntErrorHandling( V_ihand ihand );
Pascal/Delphiuses VecLib;
type V_ihand = 0..2;
procedure V_setIntErrorHandling( ihand:V_iHand );
DescriptionThis function allows to set the handling mode for OVERFLOW and DOMAIN errors occurring within integer functions of the 32-bit libraries of OptiVec. The 64-bit libraries are not affected by this function. It has to be called with one of the following pre-defined constants as argument:
    ierrIgnore = 0;
    ierrNote = 1;
    ierrAbort = 2;

The default is that these errors are ignored, i.e., they are treated by discarding overflowing bits (see chapter 5.2 for details on integer error handling). If you wish to change this behaviour, call, e.g.,
V_setIntErrorHandling( ierrNote );
and add the letter "o" to the prefixes of those integer functions for which you wish to trap errors: VIo_,   VUSo_, etc.
Error handlingnone
Return valuenone
See alsoV_setFPErrorHandling,   V_setErrorEventFile,   V_noteError,   V_printErrorMsg,  chapter 5.2

 

V_setLineThickness
FunctionModify the line thickness used in plotting functions
Syntax C/C++#include <Vgraph.h>
void V_setLineThickness( unsigned linethickness );
Pascal/Delphiuses Vgraph;
procedure V_setLineThickness( linethickness:UInt );
DescriptionThe line thickness used in the plotting functions VF_xyAutoPlot,   VCF_autoPlot, etc., is set to linethickness. To reset the default value, call V_setLineThickness with linethickness = 1.
Any value of linethickness between 1 and 500 is allowed, useful values ranging from 1 to about 10. A minimum thickness of one pixel is always secured, even if linethickness is set to 0. Note that broken or dotted lines are plotted accurately only with a linethicknes of 1. At higher values of linethickness, all lines will look like solid lines. Thicker lines are plotted considerably slower than thinner ones.
Error handlingA value of linethickness greater than 500 leads to a warning message "Cannot use line thicker than 500 pixels." Program execution is continued with linethickness set to 500.
Return valuenone
See alsoVF_xyAutoPlot,   V_setSymbolSize

 

VF_setNWriteSeparateVD_setNWriteSeparateVE_setNWriteSeparate
VCF_setNWriteSeparateVCD_setNWriteSeparateVCE_setNWriteSeparate
VPF_setNWriteSeparateVPD_setNWriteSeparateVPE_setNWriteSeparate
VI_setNWriteSeparateVBI_setNWriteSeparateVSI_setNWriteSeparate
VLI_setNWriteSeparateVQI_setNWriteSeparate
VU_setNWriteSeparateVUB_setNWriteSeparateVUS_setNWriteSeparate
VUL_setNWriteSeparateVUQ_setNWriteSeparateVUI_setNWriteSeparate
FunctionDefinition of the string to be used by the V.._nwrite functions to separate table entries.
Syntax C/C++#include <VFstd.h>
void VF_setNWriteSeparate( char *SepString );
Pascal/Delphiuses VFstd;
procedure VF_setNWriteSeparate( SepString:PChar );
DescriptionThis function defines the character string to be inserted between the columns of a table written by VF_nwrite. VF_setNWriteSeparate does not influence the end of each line which is always a line-feed character ("\n" for C/C++ and #13 for Pascal/Delphi).
SepString may contain up to twelve characters. The default setting is a tab character ("\t" for C/C++ and #9 for Pascal/Delphi).
Error handlingIn the case of SepString longer than twelve characters, the program is aborted with the error message "Invalid Parameter(s)".
The contents of SepString is not checked.
Return valuenone
See alsoVF_setWriteFormat,   VF_setWriteSeparate,   VF_nwrite,   VF_nread

 

VF_setODThreshVD_setODThreshVE_setODThresh
VU_setODThreshVUB_setODThreshVUS_setODThresh
VUL_setODThreshVUQ_setODThreshVQI_setODThresh
FunctionSet the threshold for optical density calculation
Syntax C/C++#include <VFmath.h>
void VF_setODThresh( float minX, float minX0 );
C++ VecObj#include <OptiVec>
void vector<T>::setODThresh( T minX, T minX0 );
Pascal/Delphiuses VFmath;
procedure VF_setODThresh( minX, minX0:Single );
DescriptionAs described for VF_OD and VF_ODwDark, the threshold below which input numbers for these functions are regarded as "experimental noise", with the OD being set to 0.0, can be set to any positive number by VF_setODThresh etc.
Error handlingnone
Return valuenone
See alsoVF_OD,   VF_ODwDark

 

V_setPlotRegion
FunctionDefines a screen or printer-page region to be used by VectorLib plotting operations.
Syntax C/C++#include <Vgraph.h>
void V_setPlotRegion( int left, int top, int right, int bottom );
Pascal/Delphiuses Vgraph;
procedure V_setPlotRegion( left, top, right, bottom:Integer);
DescriptionThe rectangular region defined by the parameters, passed to V_setPlotRegion, will hold the coordinate system including all labels generated by future calls to VectorLib plotting functions such as VF_xyAutoPlot. The parameters left, top, right, and bottom are in pixels, counting from the upper left corner of the screen or of the printer page.
V_setPlotRegion has to be called after (!) V_initPlot or V_initPrint.
Error handlingnone
Return valuenone
See alsoV_initPlot,   V_initPrint

 

V_setRadix
FunctionDefine the radix for the whole-number read functions: C/C++ only!
Syntax C/C++#include <VIstd.h>
    (or <VSIstd.h>, <VLIstd.h>, <VUstd.h>, ... *)
void V_setRadix( int radix );
DescriptionBy default, the V.._read functions for the whole-number data types interpret all numbers as decimal numbers. V_setRadix allows to change this default behaviour.
The radix set by V_setRadix will be used in VI_read,   VI_nread and their VBI_,   VSI_,   VLI_,   VUB_,   VUS_,   VU_,   VUL_, and VUI_ analogues. It does, however, not affect VQI_read, VQI_nread, VUQ_read, or VUQ_nread (where the radix is always 10).

radix may take on values between 2 and 36 or 0.
In the case of radix=0, the basis of each number is determined at run-time:
All numbers beginning with the ciphers 1-9 are recognized as decimal numbers. All numbers beginning with "0x" are interpreted as hexadecimal and all numbers beginning with "0" without "x" are read as octal numbers.

Error handlingradix < 0, radix=1, or radix > 36 lead to a program abort with the error message "Invalid Parameter(s)".
Return valuenone
See alsoVI_read,   VI_nread,   strtol,   strtoul

 

VF_setRspEditVD_setRspEditVE_setRspEdit
FunctionModify the treatment of round-off errors in VF_convolve and VF_deconvolve
Syntax C/C++#include <VFstd.h>
void VF_setRspEdit( fComplex Trunc );
C++ VecObj#include <OptiVec.h>
void vector<T>::setRspEdit( const complex<T>& Trunc );
Pascal/Delphiuses VFstd;
procedure VF_setRspEdit( Trunc:fComplex );
CUDA function C/C++#include <cudaVFstd.h>
void cudaVF_setRspEdit( fComplex Trunc );
CUDA function Pascal/Delphiuses VFstd;
procedure cudaVF_setRspEdit( Trunc:fComplex );
DescriptionIn the functions VF_convolve and VF_deconvolve, a frequency filter is calculated by Fourier-transforming a given response function. The filter is then applied to a vector. Due to accumulated round-off, filter elements that should be zero may be not so, but contain small non-zero numbers.

The maximum round-off error in the construction of Flt accumulates roughly to (size * big * prec), where big is the largest element of Flt and prec the relative floating-point precision. Any element smaller than that should be regarded as zero. In order to determine the exact threshold for the real and imaginary parts separately, the function uses the real and imaginary parts of Trunc, substituting them for prec in the above expression. Normally, you would choose
Trunc.Re = Trunc.Im, although a stricter (i.e. larger) value for Trunc.Im is also reasonable. Both Trunc.Re and Trunc.Im must be < 1.0; otherwise an error message "Invalid Parameter(s)" is generated and the program terminated.

By default, Trunc.Re = 16*EPSILON and Trunc.Im = 32*EPSILON, where EPSILON is the relative floating-point accuracy of the respective data type. (For C/C++, EPSILON is FLT_EPSILON,  DBL_EPSILON, or LDBL_EPSILON, as defined in <float.h>).

In order to switch the editing of the filter completely off, choose Trunc.Re = Trunc.Im = 0.

During convolutions, the editing of the filter leads to slightly smoother results. During deconvolutions, the editing has also another meaning: for all "lost" frequencies (i.e., those for which the Fourier transform of the response function contains only numbers near zero), the filter is set to 0 instead of the inverse of these small numbers. Thereby, possible OVERFLOW and SING errors are avoided.

To read the currently set threshold, call VF_getRspEdit.

Error handlingIf either Trunc.Re or Trunc.Im (or both) are ≥ 1.0, an error message "Invalid Parameter(s)" is generated and the program terminated.
Return valuenone
See alsoVF_convolve,   VF_deconvolve,   VF_getRspEdit

 

V_setSymbolSize
FunctionModify the size of the symbols used in plotting functions
Syntax C/C++#include <Vgraph.h>
void V_setSymbolSize( float symsiz );
Pascal/Delphiuses Vgraph;
procedure V_setSymbolSize( symsize:Single );
DescriptionThe size of the symbols used in the plotting functions VF_xyAutoPlot,   VCF_autoPlot, etc., is modified by scaling with symsiz. To reset the symbol size to the default value, call V_setSymbolSize with symsiz=1.0. Note that it is not possible to make the symbols completely vanish (e.g., by setting symsiz = 0.0), since a minimum radius of one pixel is always secured. Useful values of symsiz range from about 0.5 to 5.0. Values above 50.0 are prohibited.

When magnifying the symbols, you should also consider modifying the thickness of the connecting lines, if you are using any. See V_setLineThickness.

Note: An automatic scaling is always performed in order to maintain a constant relation between the symbol size and the overall size of the coordinate grid (which is especially important for Windows applications). The factor symsiz of this function scales the symbol size with respect to the automatically-found value. The automatic scaling cannot be switched off.

Error handlingA value of symsiz greater than 50.0 leads to a warning message "Cannot scale symbols by more than a factor of 50.0". Program execution is continued with symsiz set to 50.0.
Return valuenone
See alsoVF_xyAutoPlot,   V_setLineThickness

 

V_setThreadHandler
FunctionInstall worker-thread handler of main programm in a DLL ("M" libraries only)
Syntax C/C++#include <VecLib.h>
int V_setThreadHandler( V_THREADHANDLERFUNC ThreadHandler );
Pascal/Delphiuses VecLib;
function V_setThreadHandler( ThreadHandler:V_THREADHANDLERFUNC ): IntBool;
DescriptionThis function installs a callback, through which the worker threads, employed by OptiVec routines in a DLL, are managed by the main program. For details, see V_initMT.
Return valueFALSE (0), if the callback could be installed without errors, otherwise TRUE (≠ 0)
See alsoV_initMT,  chap. 1.1.2.

 

VF_setWriteFormatVD_setWriteFormatVE_setWriteFormat
VCF_setWriteFormatVCD_setWriteFormatVCE_setWriteFormat
VPF_setWriteFormatVPD_setWriteFormatVPE_setWriteFormat
VI_setWriteFormatVBI_setWriteFormantVSI_setWriteFormat
VLI_setWriteFormatVQI_setWriteFormat
VU_setWriteFormatVUB_setWriteFormatVUS_setWriteFormat
VUL_setWriteFormatVUQ_setWriteFormatVUI_setWriteFormat
FunctionDefinition of the format to be used by V.._write and V.._nwrite: C/C++ only!
Syntax C/C++#include <VFstd.h>
void VF_setWriteFormat( char *FormatString );
C++ VecObj#include <OptiVec.h>
void vector<T>::setWriteFormat( char *FormatString );
DescriptionThe functions of the VF_write and VF_nwrite families employ internally the ANSI C function fprintf in order to print numbers into a stream.
According to the rules described in the documentation of your C compiler's printf function, the format may be specified as fits your needs. When defining a write format, one should always be aware of the restrictions imposed by the read functions (not all formats you can write will be read correcly, see VF_read).

VF_setWriteFormat should not be used for the definition of whitespace before or after the numbers. This is the task of VF_setWriteSeparate.

For details about the formats used for each of the various data types, please refer to the following table. The last column of this table gives the maximum length of the format string.
 
VersionStandard FormatAlternative Examplemax. length
VF_"% 11.8e""% 8.4f"16
VD_"% 19.16le""% 16.8lf"16
VE_"% 22.19Le""% 22.19LG"16
VCF_"% 11.8e, % 11.8e""{% 8.4f, % 8.4f}"32
VCD_"% 19.16le, % 19.16le""{% 19.16lE % 19.16lE}"32
VCE_"% 22.19Le, % 22.19Le""{% 22.19Lg % 22.19Lg}"32
VPF_"% 11.8e @% 11.8e""{% 8.4f @% 8.4f}"32
VPD_"% 19.16le @% 19.16le""{% 19.16lE @% 19.16lE}"32
VPE_"% 22.19Le @% 22.19Le""{% 22.19Lg @% 22.19Lg}"32
VI_"% 10d""0x% 8x"12
VBI_"% 3hd""0x% 2hX"12
VSI_"% 5hd""0x% 4hX"12
VLI_"% 10ld""%08lXh"12
VQI_"% 20lld"16
VU_"%10u""%04xh"12
VUB_"%3hu""0%02ho"12
VUS_"%5hu""0%04ho"12
VUL_"%10lu""0%08lO"12
VUQ_"%20I64u" 12

Note that byte-sized integers are extended to 16-bit before being printed, so that the format specifier has to be for 16-bit numbers.

Error handlingFormat strings longer than the maximum length specified in the above table lead to a program abort with the error message "Invalid Parameter(s)".
The contents of the format string is not checked. So you have to be very careful to specify a format which is valid for the respective data type.
Return valuenone
See alsoVF_setWriteSeparate,   VF_write,   VF_nwrite,   VF_read,   VF_nread

 

VF_setWriteSeparateVD_setWriteSeparateVE_setWriteSeparate
VCF_setWriteSeparateVCD_setWriteSeparateVCE_setWriteSeparate
VPF_setWriteSeparateVPD_setWriteSeparateVPE_setWriteSeparate
VI_setWriteSeparateVBI_setWriteSeparateVSI_setWriteSeparate
VLI_setWriteSeparateVQI_setWriteSeparate
VU_setWriteSeparateVUB_setWriteSeparateVUS_setWriteSeparate
VUL_setWriteSeparateVUQ_setWriteSeparateVUI_setWriteSeparate
FunctionDefinition of the separation string used by V.._write
Syntax C/C++#include <VFstd.h>
void VF_setWriteSeparate( char *SepString );
C++ VecObj#include <OptiVec.h>
void vector<T>::setWriteSeparate( char *SepString );
Pascal/Delphiuses VFstd;
procedure VF_setWriteSeparate( SepString:PChar );
DescriptionBy default, VF_write puts a line feed character after each vector element written into a stream. This means that each element gets its own line. You may use VF_setWriteSeparate to define another separation string. This may be, for example, a tab character ("\t" for C/C++ or #9 for Pascal/Delphi) or a series of spaces (e.g., "    " for C/C++ or '    ' for Pascal/Delphi).

VF_write will insert the separation string only in between the vector elements. At the end, after the last element, there is always a line feed ("\n") instead of the separation string.

SepString may contain up to twelve characters.
C/C++ only:
If you use VF_write with the output sent directly to the printer (stream = stdprn), you probably have to explicitly use a carriage return character in addition to the line feed. To do this, call
VF_setWriteSeparate( "\n\r" );

Error handlingIn the case of SepString longer than twelve characters, the program is aborted with the error message "Invalid Parameter(s)".
The contents of SepString is not checked.
Return valuenone
See alsoVF_setWriteFormat,   VF_setNWriteSeparate,   VF_write,   VF_read

 

VF_sgnVD_sgnVE_sgn
FunctionSignum function, compares each element of a vector with 0.
Syntax C/C++#include <VFmath.h>
void VF_sgn( fVector Y, fVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::sgn( const vector<T>& X );
Pascal/Delphiuses VFmath;
procedure VF_sgn( Y, X:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_sgn( fVector d_Y, fVector d_X, ui size );
void VFcu_sgn( fVector h_Y, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_sgn( d_Y, d_X:fVector; size:UIntSize ): IntBool;
procedure VFcu_sgn( h_Y, h_X:fVector; size:UIntSize );
DescriptionEach element of X is compared with 0 and the result of the comparison stored in Y:
Yi = +1.0, if Xi > 0
Yi =   0.0, if Xi = 0
Yi =  −1.0, if Xi < 0.
This function is identical to VF_cmp0.
Error handlingnone
Return valuenone
See alsoVF_cmp_...,   VF_cmpC,   VF_cmpV

 

VI_shlVBI_shlVSI_shlVLI_shlVQI_shl 
VU_shlVUB_shlVUS_shlVUL_shlVUQ_shlVUI_shl
Function"Shift to the left", i.e. multiply by integer powers of 2.
Syntax C/C++#include <VImath.h>
void VI_shl( iVector Y, iVector X, ui size, unsigned C );
void VUL_shl( ulVector Y, ulVector X, ui size, unsigned C );

    (similarly all other functions of this family)
C++ VecObj#include <OptiVec.h>
void vector<T>::shl( const vector<T>& X, unsigned C );
Pascal/Delphiuses VImath;
procedure VI_shl( Y, X:iVector; size:UIntSize; C:UInt );
procedure VUL_shl( Y, X:ulVector; size:UIntSize; C:UInt );

    (similarly all other functions of this family)
CUDA function C/C++#include <cudaVImath.h>
int cudaVI_shl( iVector d_Y, iVector d_X, ui size, unsigned C );
int cudaVUL_shl( ulVector d_Y, ulVector d_X, ui size, unsigned C );
void VIcu_shl( iVector h_Y, iVector h_X, ui size, unsigned C );
void VULcu_shl( ulVector h_Y, ulVector h_X, ui size, unsigned C );
CUDA function Pascal/Delphiuses VImath;
function cudaVI_shl( d_Y, d_X:iVector; size:UIntSize; C:UInt ): IntBool;
function cudaVUL_shl( d_Y, d_X:ulVector; size:UIntSize; C:UInt ): IntBool;

procedure VIcu_shl( h_Y, h_X:iVector; size:UIntSize; C:UInt );
procedure VULcu_shl( h_Y, h_X:ulVector; size:UIntSize; C:UInt );
DescriptionYi = Xi << C
All bits of Xi are shifted to the left by as many positions as indicated in the parameter C. This corresponds to a multiplication by 2C, neglecting possible overflow (in all versions) and loss of the sign bit (for signed numbers, i.e. in the VI_,   VBI_,   VSI_,   VLI_, and VQI_ versions).
Note that by shifting 8-bit numbers (VBI_,   VUB_ versions) by more than 7 positions, any non-zero bit present in the original number is lost and the result is 0. The same is true for 16-bit numbers (VSI_,   VUS_ versions) shifted by more than 15 positions, for 32-bit numbers (VLI_, VUL_) shifted by more than 31 positions, and for 64-bit numbers (VQI_, VUQ_) shifted by more than 63 positions.
C is always of the data type unsigned. Shifting by negative numbers C is, therefore, not possible. To perform a right-shift, the appropriate function of the VI_shr family has to be used.
Error handlingnone
Return valuenone
See alsoVI_mulC,   VI_shr

 

VI_shrVBI_shrVSI_shrVLI_shrVQI_shr 
VU_shrVUB_shrVUS_shrVUL_shrVUQ_shrVUI_shr
Function"Shift to the right", i.e., divide by integer powers of 2.
Syntax C/C++#include <VImath.h>
void VI_shr( iVector Y, iVector X, ui size,unsigned C );
void VUL_shr( ulVector Y, ulVector X, ui size, unsigned C );

    (similarly all other functions of this family)
C++ VecObj#include <OptiVec.h>
void vector<T>::shr( const vector<T>& X, unsigned C );
Pascal/Delphiuses VImath;
procedure VI_shr( Y, X:iVector; size:UIntSize; C:UInt );
procedure VUL_shr( Y, X:ulVector; size:UIntSize; C:UInt );

    (similarly all other functions of this family)
CUDA function C/C++#include <cudaVImath.h>
int cudaVI_shr( iVector d_Y, iVector d_X, ui size, unsigned C );
int cudaVUL_shr( ulVector d_Y, ulVector d_X, ui size, unsigned C );
void VIcu_shr( iVector h_Y, iVector h_X, ui size, unsigned C );
void VULcu_shr( ulVector h_Y, ulVector h_X, ui size, unsigned C );
CUDA function Pascal/Delphiuses VImath;
function cudaVI_shr( d_Y, d_X:iVector; size:UIntSize; C:UInt ): IntBool;
function cudaVUL_shr( d_Y, d_X:ulVector; size:UIntSize; C:UInt ): IntBool;

procedure VIcu_shr( h_Y, h_X:iVector; size:UIntSize; C:UInt );
procedure VULcu_shr( h_Y, h_X:ulVector; size:UIntSize; C:UInt );
DescriptionYi = Xi >> C
All bits of Xi are shifted to the right by as many positions as indicated in the parameter C. This corresponds to an integer division by 2C. The sign of Yi is always the same as of Xi. In contrast to explicit integer divisions, the result is always rounded toward minus infinity: −15 / 2 = -7, but −15 >> 1 = -8.
Note that by shifting 8-bit numbers by more than 7 positions, any unsigned or positive number yields 0, whereas any negative number yields −1 in this case.
The same is true for 16-bit numbers upon shifting by more than 15 positions, and for 32-bit numbers being shifted by more than 31 positions.

C is always of the data type unsigned. Shifting by negative numbers C is, therefore, not possible. To perform a left-shift, the appropriate function of the VI_shl family has to be used.

Error handlingnone
Return valuenone
See alsoVI_divC,   VI_shl

 

VF_sinVD_sinVE_sin
VFx_sinVDx_sinVEx_sin
VFr_sinVDr_sinVEr_sin
VFrx_sinVDrx_sinVErx_sin
VCF_sinVCD_sinVCE_sin
VCFx_sinVCDx_sinVCEx_sin
FunctionSine function
Syntax C/C++#include <VFmath.h>
int VF_sin( fVector Y, fVector X, ui size );
int VFx_sin( fVector Y, fVector X, ui size, float A, float B, float C );
int VFr_sin( fVector Y, fVector X, ui size );
int VFrx_sin( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::sin( const vector<T>& X );
int vector<T>::x_sin( const vector<T>& X, const T& A, const T& B, const T& C );
int vector<T>::r_sin( const vector<T>& X );
int vector<T>::rx_sin( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_sin( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_sin( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function VFr_sin( Y, X:fVector; size:UIntSize ): IntBool;
function VFrx_sin( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_sin( fVector d_Y, fVector d_X, ui size );
int cudaVFx_sin( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_sin( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_sin( fVector h_Y, fVector h_X, ui size );
int VFxcu_sin( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_sin( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_sin( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_sin( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_sin( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_sin( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = sin( Xi )
expanded versions: Yi = C * sin( A*Xi+B )

For large values of Xi, round-off error becomes larger and larger; if the Xi values are representable as fractional multiples of p, it is better to use VF_sinrpi than VF_sin.

If, on the other hand, one can be sure that all Xi are within a reasonable range one can employ the faster reduced-range versions with the prefixes VFr_ and VFrx_. The range requirements for the reduced-range versions are:
64-bit: |Xi| < 232 (roughly 4.2*109)
32-bit: |Xi| ≤ 2p).
These reduced-range functions are not available for CUDA.

Error handlingPrecision errors lead to a default result of 0.0 and a non-zero return value, but are ignored otherwise; _matherr is not called.
OVERFLOW errors can only occur in the complex versions and lead to a result of ±HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_sin2,   VF_sinrpi,   VF_cos,   VF_sinh,   VF_asin,   sin

 

VF_sin2VD_sin2VE_sin2
VFx_sin2VDx_sin2VEx_sin2
VFr_sin2VDr_sin2VEr_sin2
VFrx_sin2VDrx_sin2VErx_sin2
FunctionSquare of the sine function
Syntax C/C++#include <VFmath.h>
int VF_sin2( fVector Y, fVector X, ui size );
int VFx_sin2( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::sin2( const vector<T>& X );
int vector<T>::x_sin2( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_sin2( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_sin2( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_sin2( fVector d_Y, fVector d_X, ui size );
int cudaVFx_sin2( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_sin2( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_sin2( fVector h_Y, fVector h_X, ui size );
int VFxcu_sin2( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_sin2( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_sin2( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_sin2( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_sin2( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_sin2( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = sin2( Xi )
expanded versions: Yi = C * sin2( A*Xi+B )
Calculating the squared trigonometric functions directly is faster and sometimes more accurate than first calculating the trigonometric function itself and squaring it afterwards.

If, on the other hand, one can be sure that all Xi are within a reasonable range one can employ the faster reduced-range versions with the prefixes VFr_ and VFrx_. The range requirements for the reduced-range versions are:
64-bit: |Xi| < 232 (roughly 4.2*109)
32-bit: |Xi| ≤ 2p).
These reduced-range functions are not available for CUDA.

Error handlingPrecision errors lead to a default result of 0.0 and a non-zero return value, but are otherwise ignored; _matherr is not called.
OVERFLOW errors can only occur in the complex versions and lead to a result of ±HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_sin,   VF_sinrpi,  sin

 

VF_sincVD_sincVE_sinc
VFx_sincVDx_sincVEx_sinc
FunctionSinc function
Syntax C/C++#include <VFmath.h>
int VF_sinc( fVector Y, fVector X, ui size );
int VFx_sinc( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::sinc( const vector<T>& X );
int vector<T>::x_sinc( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_sinc( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_sinc( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_sinc( fVector d_Y, fVector d_X, ui size );
int cudaVFx_sinc( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_sinc( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_sinc( fVector h_Y, fVector h_X, ui size );
int VFxcu_sinc( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_sinc( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_sinc( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_sinc( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_sinc( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_sinc( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = sinc( Xi ) = sin( Xi ) / Xi
expanded versions: Yi = C * sinc( A*Xi+B )
The sinc function for an argument of 0.0 is defined as 1.0. The sinc function is the Fourier transform of a square pulse and is used, for example, to describe the diffraction pattern of a slit.
Error handlingThese functions should be error-proof.
Return valuealways FALSE (0).
See alsoVF_sin,   VF_sinrpi,   sin

 

VF_sincosVD_sincosVE_sincos
VFx_sincosVDx_sincosVEx_sincos
VFr_sincosVDr_sincosVEr_sincos
VFrx_sincosVDrx_sincosVErx_sincos
FunctionSine and Cosine simultaneously
Syntax C/C++#include <VFmath.h>
int VF_sincos( fVector YSin, fVector YCos, fVector X, ui size );
int VFx_sincos( fVector YSin, fVector YCos, fVector X, ui size, float A, float B, float C );
int VFr_sincos( fVector YSin, fVector YCos, fVector X, ui size );
int VFrx_sincos( fVector YSin, fVector YCos, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::sincos( vector<T> YCos, const vector<T>& X );
int vector<T>::x_sincos( vector<T> YCos, const vector<T>& X, const T& A, const T& B, const T& C );
int vector<T>::r_sincos( vector<T> YCos, const vector<T>& X );
int vector<T>::rx_sincos( vector<T> YCos, const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_sincos( Sin, Cos, X:fVector; size:UIntSize ): IntBool;
function VFx_sincos( Sin, Cos, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function VFr_sincos( Sin, Cos, X:fVector; size:UIntSize ): IntBool;
function VFrx_sincos( Sin, Cos, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_sincos( fVector d_YSin, fVector d_YCos, fVector d_X, ui size );
int cudaVFx_sincos( fVector d_YSin, fVector d_YCos, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_sincos( fVector d_YSin, fVector d_YCos, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_sincos( fVector h_YSin, fVector h_YCos, fVector h_X, ui size );
int VFxcu_sincos( fVector h_YSin, fVector h_YCos, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_sincos( d_YSin, d_YCos, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_sincos( d_YSin, d_YCos, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_sincos( d_YSin, d_YCos, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_sincos( h_YSin, h_YCos, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_sincos( h_YSin, h_YCos, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions:
YSini = sin( Xi )
YCosi = cos( Xi )
expanded versions:
YSini = C * sin( A*Xi+B )
YCosi = C * cos( A*Xi+B )
The sine and the cosine are calculated simultaneously, which is far more efficient than calculating them separately if both of them are needed.

For large values of Xi, round-off error becomes larger and larger; if the Xi values are representable as fractional multiples of p, it is better to use VF_sincosrpi than VF_sincos.

If, on the other hand, one can be sure that all Xi are within a reasonable range one can employ the faster reduced-range versions with the prefixes VFr_ and VFrx_. The range requirements for the reduced-range versions are:
64-bit: |Xi| < 232 (roughly 4.2*109)
32-bit: |Xi| ≤ 2p).
The reduced-range versions are not available for CUDA.

Error handlingPrecision errors lead to a result of 0.0 for the sine and 1.0 for the cosine (as if the input were 0.0) along with a non-zero return value, but are otherwise ignored; _matherr is not called. Other errors should not occur.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_sincos2,   VF_sincosrpi,   sin,   cos

 

VF_sincos2VD_sincos2VE_sincos2
VFx_sincos2VDx_sincos2VEx_sinco2
VFr_sincos2VDr_sincos2VEr_sincos2
VFrx_sincos2VDrx_sincos2VErx_sinco2
FunctionSquare of the sine and of the cosine simultaneously
Syntax C/C++#include <VFmath.h>
int VF_sincos2( fVector YSin2, fVector YCos2, fVector X, ui size );
int VFx_sincos2( fVector YSin2, fVector YCos2, fVector X, ui size, float A, float B, float C );
int VFr_sincos2( fVector YSin, fVector YCos, fVector X, ui size );
int VFrx_sincos2(fVector YSin, fVector YCos, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::sincos2( vector<T> YCos2, const vector<T>& X );
int vector<T>::x_sincos2( vector<T> YCos2, const vector<T>& X, const T& A, const T& B, const T& C );
int vector<T>::r_sincos2( vector<T> YCos, const vector<T>& X );
int vector<T>::rx_sincos2( vector<T> YCos, const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_sincos2( Sin, Cos, X:fVector; size:UIntSize ): IntBool;
function VFx_sincos2( Sin, Cos, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function VFr_sincos2( Sin, Cos, X:fVector; size:UIntSize ): IntBool;
function VFrx_sincos2(Sin, Cos, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_sincos2( fVector d_YSin, fVector d_YCos, fVector d_X, ui size );
int cudaVFx_sincos2( fVector d_YSin, fVector d_YCos, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_sincos2( fVector d_YSin, fVector d_YCos, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_sincos2( fVector h_YSin, fVector h_YCos, fVector h_X, ui size );
int VFxcu_sincos2( fVector h_YSin, fVector h_YCos, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_sincos2( d_YSin, d_YCos, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_sincos2( d_YSin, d_YCos, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_sincos2( d_YSin, d_YCos, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_sincos2( h_YSin, h_YCos, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_sincos2( h_YSin, h_YCos, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions:
YSin2i = sin2( Xi )
YCos2i = cos2( Xi )
expanded versions:
YSin2i = C * sin2( A*Xi+B )
YCos2i = C * cos2( A*Xi+B )
The squared sine and the squared cosine are calculated simultaneously, which is far more efficient than calculating them separately, if both of them are needed.

If, on the other hand, one can be sure that all Xi are within a reasonable range one can employ the faster reduced-range versions with the prefixes VFr_ and VFrx_. The range requirements for the reduced-range versions are:
64-bit: |Xi| < 232 (roughly 4.2*109)
32-bit: |Xi| ≤ 2p).
The reduced-range versions are not available for CUDA.

Error handlingPrecision errors lead to a result of 0.0 for the sin2 and of 1.0 for the cos2 (as if the input were 0.0) along with a non-zero return value, but are otherwise ignored; _matherr is not called. Other errors should not occur.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_sincos,   sin,   cos

 

VF_sincosrpiVD_sincosrpiVE_sincosrpi
VF_sincosrpi2VD_sincosrpi2VE_sincosrpi2
VF_sincosrpi3VD_sincosrpi3VE_sincosrpi3
FunctionSine and cosine of fractional multiples of p
Syntax C/C++#include <VFmath.h>
int VF_sincosrpi( fVector YSin, fVector YCos, iVector P, ui size, int q );
int VF_sincosrpi2( fVector YSin, fVector YCos, iVector P, ui size, int q );
int VF_sincosrpi3( fVector YSin, fVector YCos, iVector P, ui size, int q );
C++ VecObj#include <OptiVec.h>
int vector<T>::sincosrpi( vector<T> YCos, const vector<int>& P, int q );
int vector<T>::sincosrpi2( vector<T> YCos, const vector<int>& P, int q );
int vector<T>::sincosrpi3( vector<T> YCos, const vector<int>& P, int q );
Pascal/Delphiuses VFmath;
function VF_sincosrpi( YSin, YCos:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
function VF_sincosrpi2( YSin, YCos:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
function VF_sincosrpi3( YSin, YCos:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_sincosrpi( fVector d_YSin, fVector d_YCos, iVector d_P, ui size, int q );
int cudaVF_sincosrpi2( fVector d_YSin, fVector d_YCos, iVector d_P, ui size, int q );
int cudaVF_sincosrpi3( fVector d_YSin, fVector d_YCos, iVector d_P, ui size, int q );
int VFcu_sincosrpi( fVector h_YSin, fVector h_YCos, iVector h_P, ui size, int q );
int VFcu_sincosrpi2( fVector h_YSin, fVector h_YCos, iVector h_P, ui size, int q );
int VFcu_sincosrpi3( fVector h_YSin, fVector h_YCos, iVector h_P, ui size, int q );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_sincosrpi( d_YSin, d_YCos:fVector; d_P:iVector; size:UIntSize; q:Integer ): IntBool;
function cudaVF_sincosrpi2( d_YSin, d_YCos:fVector; d_P:iVector; size:UIntSize; q:Integer ): IntBool;
function cudaVF_sincosrpi3( d_YSin, d_YCos:fVector; d_P:iVector; size:UIntSize; q:Integer ): IntBool;
function VFcu_sincosrpi( h_YSin, h_YCos:fVector; h_P:iVector; size:UIntSize; q:Integer ): IntBool;
function VFcu_sincosrpi2( h_YSin, h_YCos:fVector; h_P:iVector; size:UIntSize; q:Integer ): IntBool;
function VFcu_sincosrpi3( h_YSin, h_YCos:fVector; h_P:iVector; size:UIntSize; q:Integer ): IntBool;
DescriptionYSini = sin( (Pi / q) * p )
YCosi = cos( (Pi / q) * p )
The sine and the cosine of fractional multiples of p are calculated. There are three versions: VF_sincosrpi is for general use with any arbitrary denominator q. If q is a power of 2, VF_sincosrpi2 should be used which is a highly optimized version reading the results from a table named VF_sintab2, if possible. If q is a multiple of 3, VF_sincosrpi3 should be used which utilizes a table named VF_sintab3. The use of VF_sincosrpi3 is a convenient way to use degrees instead of radians; if, for example, q is 180, then the unit of the elements of P is "degree". VF_sincosrpi2 and VF_sincosrpi3 work also with q values they are not optimized for; in this case, however, memory space is wasted for the (then useless) tables.
Error handlingThese functions should be error-proof, as long as q≠0.
Return valuealways FALSE (0)
See alsoVF_sincos,   sin,   cos

 

VF_sinhVD_sinhVE_sinh
VCF_sinhVCD_sinhVCE_sinh
VFx_sinhVDx_sinhVEx_sinh
VCFx_sinhVCDx_sinhVCEx_sinh
FunctionHyperbolic sine function
Syntax C/C++#include <VFmath.h>
int VF_sinh( fVector Y, fVector X, ui size );
int VFx_sinh( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::sinh( const vector<T>& X );
int vector<T>::x_sinh( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_sinh( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_sinh( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_sinh( fVector d_Y, fVector d_X, ui size );
int cudaVFx_sinh( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_sinh( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_sinh( fVector h_Y, fVector h_X, ui size );
int VFxcu_sinh( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_sinh( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_sinh( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_sinh( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_sinh( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_sinh( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = sinh( Xi )
expanded versions: Yi = C * sinh ( A*Xi+B )
Error handlingOVERFLOW errors lead to a default result of ±HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_cosh,   VF_exp,   sinh

 

VF_sinrpiVD_sinrpiVE_sinrpi
VF_sinrpi2VD_sinrpi2VE_sinrpi2
VF_sinrpi3VD_sinrpi3VE_sinrpi3
FunctionSine function of fractional multiples of p
Syntax C/C++#include <VFmath.h>
int VF_sinrpi( fVector Y, iVector P, ui size, int q );
int VF_sinrpi2( fVector Y, iVector P, ui size, int q );
int VF_sinrpi3( fVector Y, iVector P, ui size, int q );
C++ VecObj#include <OptiVec.h>
int vector<T>::sinrpi( const vector<int>& P, int q );
int vector<T>::sinrpi2( const vector<int>& P, int q );
int vector<T>::sinrpi3( const vector<int>& P, int q );
Pascal/Delphiuses VFmath;
function VF_sinrpi( Y:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
function VF_sinrpi2( Y:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
function VF_sinrpi3( Y:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_sinrpi( fVector d_Y, iVector d_P, ui size, int q );
int cudaVF_sinrpi2( fVector d_Y, iVector d_P, ui size, int q );
int cudaVF_sinrpi3( fVector d_Y, iVector d_P, ui size, int q );
int VFcu_sinrpi( fVector h_Y, iVector h_P, ui size, int q );
int VFcu_sinrpi2( fVector h_Y, iVector h_P, ui size, int q );
int VFcu_sinrpi3( fVector h_Y, iVector h_P, ui size, int q );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_sinrpi( d_Y:fVector; d_P:iVector; size:UIntSize; q:Integer ): IntBool;
function cudaVF_sinrpi2( d_Y:fVector; d_P:iVector; size:UIntSize; q:Integer ): IntBool;
function cudaVF_sinrpi3( d_Y:fVector; d_P:iVector; size:UIntSize; q:Integer ): IntBool;
function VFcu_sinrpi( h_Y:fVector; h_P:iVector; size:UIntSize; q:Integer ): IntBool;
function VFcu_sinrpi2( h_Y:fVector; h_P:iVector; size:UIntSize; q:Integer ): IntBool;
function VFcu_sinrpi3( h_Y:fVector; h_P:iVector; size:UIntSize; q:Integer ): IntBool;
DescriptionYi = sin( (Pi / q) * p )
The sine of fractional multiples of p is calculated. There are three versions: VF_sinrpi is for general use with any arbitrary denominator q. If q is a power of 2, VF_sinrpi2 should be used which is a highly optimized version reading the results from a look-up table, if possible. If q is a multiple of 3, VF_sinrpi3 should be used. VF_sinrpi3 offers a convenient way to use degrees instead of radians; if, for example, q is 180, then the unit of the elements of P is "degree". VF_sinrpi2 and VF_sinrpi3 work also with q values they are not optimized for; in this case, however, memory space is wasted for the tables.
Error handlingThese functions should be error-proof, as long as q≠0.
Return valuealways FALSE (0)
See alsoVF_sin,   sin

 

VF_sintab2VD_sintab2VE_sintab2
VF_sintab3VD_sintab3VE_sintab3
 Table of sine values for arguments between 0 and p/2
Syntax C/C++#include <xmath.h>
extern float    VF_sintab2[ VF_tabsz2+1 ];
extern double   VD_sintab2[ VD_tabsz2+1 ];
extern extended VE_sintab2[ VE_tabsz2+1 ];
extern float    VF_sintab3[ VF_tabsz3+1 ];
extern double   VD_sintab3[ VD_tabsz3+1 ];
extern extended VE_sintab3[ VE_tabsz3+1 ];

Pascal/Delphiuses FSINTAB2, DSINTAB2, ESINTAB2, FSINTAB3, DSINTAB3, ESINTAB3;
VF_sintab2: array[0..VF_tabsz2] of Single;
VD_sintab2: array[0..VD_tabsz2] of Double;
VE_sintab2: array[0..VE_tabsz2] of Extended;
VF_sintab3: array[0..VF_tabsz3] of Single;
VD_sintab3: array[0..VD_tabsz3] of Double;
VE_sintab3: array[0..VE_tabsz3] of Extended;

DescriptionVF_sintab2[ i ] = sin( i/(2*VF_tabsz2) * p ),     i=0,...,VF_tabsz2
VF_sintab3[ i ] = sin( i/(2*VF_tabsz3) * p ),     i=0,...,VF_tabsz3
These look-up tables of sine values for arguments between 0 and p/2 are used by VF_sinrpi2 and the other functions of that family and are also available for other purposes.
C/C++: The symbols VF_tabsz2 etc., denoting the size of the tables, are defined in <xmath.h>.
Pascal/Delphi: The symbols VF_tabsz2 etc. are defined in the same units as the tables themselves.
FreePascal/Lazarus: These tables are not available for FreePascal/Lazarus.
See alsoVF_sinrpi2,   VF_tantab2,   VF_cosectab2

 

VF_smoothVD_smoothVE_smooth
FunctionData smoothing
Syntax C/C++#include <VFstd.h>
void VF_smooth( fVector Y, fVector X, ui size, unsigned deg);
C++ VecObj#include <OptiVec.h>
void vector<T>::smooth( const vector<T>& X, unsigned deg );
Pascal/Delphiuses VFstd;
procedure VF_smooth( Y, X:fVector; size:UIntSize; deg:UInt );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_smooth( fVector d_Y, fVector d_X, ui size, unsigned deg);
void VFcu_smooth( fVector h_Y, fVector h_X, ui size, unsigned deg);
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_smooth( d_Y, d_X:fVector; size:UIntSize; deg:UInt ): IntBool;
procedure VFcu_smooth( h_Y, h_X:fVector; size:UIntSize; deg:UInt );
DescriptionA primitive, but very fast low-frequency filtering of the vector X is performed. For each point, a weighted average of the point itself and its one or few nearest neighbours is calculated. The argument deg decides how many points are taken into accout. E.g., deg=3 means 3-point smoothing by the formula:
Yi = 0.25 * (2*Xi + Xi−1 + Xi+1)
Higher degrees (5, 7, 9...) of smoothing are achieved internally by repeated 3-point smoothing. deg = 0 or 1 means no smoothing at all; deg = 2 or 3 is interpreted as 3-point smoothing, deg = 4 or 5 as 5-point smoothing, and so on.
Error handlingnone
Return valuenone
See alsoVF_filter,   VF_biquad

 

VF_sortVD_sortVE_sort
VI_sortVBI_sortVSI_sortVLI_sortVQI_sort 
VU_sortVUB_sortVUS_sortVUL_sortVUQ_sortVUI_sort
FunctionSorting into ascending or descending order
Syntax C/C++#include <VFstd.h>
void VF_sort( fVector Y, fVector X, ui size, int dir );
C++ VecObj#include <OptiVec.h>
void vector<T>::sort( const vector<T>& X, int dir=1 );
Pascal/Delphiuses VFstd;
procedure VF_sort( Y, X:fVector; size:UIntSize; dir:Integer );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_sort( fVector d_Y, fVector d_X, ui size, int dir );
void VFcu_sort( fVector h_Y, fVector h_X, ui size, int dir );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_sort( d_Y, d_X:fVector; size:UIntSize; dir:Integer ): IntBool;
procedure VFcu_sort( h_Y, h_X:fVector; size:UIntSize; dir:Integer );
DescriptionThe vector is sorted in ascending order, if dir is positive; negative dir yields descending order. The present implementation uses the "Heapsort" algorithm.
Error handlingnone
Return valuenone
See alsoVF_sortind,   VF_rotate,   VF_rev,   qsort (C/C++ only)

 

VF_sortindVD_sortindVE_sortind
VI_sortindVBI_sortindVSI_sortindVLI_sortindVQI_sortind 
VU_sortindVUB_sortindVUS_sortindVUL_sortindVUQ_sortindVUI_sortind
FunctionSort the index-array of a vector
Syntax C/C++#include <VFstd.h>
void VF_sortind( uiVector Ind, fVector X, ui size, int dir );
C++ VecObj#include <OptiVec.h>
void vector<ui>::sortind( const vector<T>& X, int dir=1 );
Pascal/Delphiuses VFstd;
procedure VF_sortind( Ind:uiVector; X:fVector; size:UIntSize; dir:Integer );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_sortind( uiVector d_Ind, fVector d_X, ui size, int dir );
void VFcu_sortind( uiVector h_IndY, fVector h_X, ui size, int dir );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_sortind( d_Ind:uiVector; d_X:fVector; size:UIntSize; dir:Integer ): IntBool;
procedure VFcu_sortind( h_Ind:uiVector; h_X:fVector; size:UIntSize; dir:Integer );
DescriptionThe routine is similar to VF_sort, but this time it is the index-array of X rather than the vector X itself that is ordered. Ascending order is obtained by setting dir to any positive number. Here, ascending order means that Ind0 will contain the index of the smallest element of X, Ind1 the index of the second-smallest, and so on, up to Indsize−1, the index of the largest element in X. Descending order is obtained by setting dir negative. In the case of two or more identical vector elements, the lower index comes first (regardless of the sortind direction).
This routine is used if other vectors are correlated with X and the correlation of the individual elements has to be maintained. After sorting the index-array, use VF_indpick (VD_indpick,   VI_indpick, etc.) to actually perform the sorting of X and the other vectors correlated with X.
Error handlingnone
Return valuenone
See alsoVF_sort,   VF_indpick

 

VF_spectrumVD_spectrumVE_spectrum
VFb_spectrumVDb_spectrumVEb_spectrum
FunctionOne-sided power-density spectrum
Syntax C/C++#include <VFstd.h>
float VF_spectrum( fVector Spc, ui specsiz, fVector X, ui xsiz, fVector Win );
float VFb_spectrum( fVector Spc, ui specsiz, fVector X, ui xsiz, fVector Win, fVector Buf );
C++ VecObj#include <OptiVec.h>
T vector<T>::spectrum( const vector<T>& X, const vector<T>& Win );
T vector<T>::b_spectrum( const vector<T>& X, const vector<T>& Win, vector<T>& Buf );
Pascal/Delphiuses VFstd;
function VF_spectrum( Spc:fVector; specsiz:UIntSize; X:fVector; xsiz:UIntSize; Win:fVector ): Single;
function VFb_spectrum( Spc:fVector; specsiz:UIntSize; X:fVector; xsiz:UIntSize; Win, Buf:fVector ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_spectrum( float *h_psdfNyq, fVector d_Spc, ui specsiz, fVector d_X, ui xsiz, fVector d_Win );
int cusdVF_spectrum( float *d_psdfNyq, fVector d_Spc, ui specsiz, fVector d_X, ui xsiz, fVector d_Win );
float VFcu_spectrum( fVector h_Spc, ui specsiz, fVector h_X, ui xsiz, fVector h_Win );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_spectrum( var h_psdfNyq:Single; d_Spc:fVector; specsiz:UIntSize; d_X:fVector; xsiz:UIntSize; d_Win:fVector ): IntBool;
function cusdVF_spectrum( d_psdfNyq:PSingle; d_Spc:fVector; specsiz:UIntSize; d_X:fVector; xsiz:UIntSize; d_Win:fVector ): IntBool;
function VFcu_spectrum( h_Spc:fVector; specsiz:UIntSize; h_X:fVector; xsiz:UIntSize; h_Win:fVector );
DescriptionThe data set X is analyzed for its power spectral density (PSD), i.e. the mean square amplitude. The result is stored in Spc. xsiz must be at least 2*specsiz, and specsiz has to be an integer power of 2. Internally, X is divided into (xsiz/specsiz)−1 segments and the average over the spectra of the individual segments is calculated. Each segment of length 2*specsiz yields the PSD for specsiz+1 frequencies (see VF_FFT). In order to keep specsiz an integer power of 2, there are only specsiz points stored in Spc and the last one, the PSD at the Nyquist frequency fNyquist = 0.5 / sampling_interval, is given as the return value of the function. It may either be neglected (by calling the function like a void function) or stored as the last element in Spc by calling the function as
Spc[specsiz] = VF_spectrum( Spc, specsiz, X, xsiz, Win );
in this case, Spc must have a length of specsiz+1.

Win is a window that is applied to the data segments. The size of the Win vector must be 2*specsiz. Within the VectorLib library, three functions are available that give suitable Windows: VF_Welch,   VF_Parzen, and VF_Hann. A square window (i.e. no windowing at all) is achieved by setting all elements of Win to 1.0 using VF_equ1. Use of the square window is not recommended here, though.

You may wish to test the quality of the calculated spectrum by applying Parseval's theorem (provided you called VF_spectrum as in the above example and stored the PSD for the Nyquist frequency):
1.0/xsize * VF_ssq( X, xsize ) must be about equal to VF_sum( Spc, specsiz+1 ).
If the deviation between both results is large, the sampling interval in X probably is too large.

Internally, VF_spectrum allocates and frees additional workspace memory. For repeated calls, this would be inefficient. In such a case, it is recommended to use VFb_spectrum instead. The size of Buf must be ≥ 2*xsiz + 2*specsiz. Additionally, Buf must be 128-bit (P8) or 256-bit (P9) aligned. This usually means you can only take a vector allocated by the VF_vector family as Buf.

For an example for VF_spectrum, see the demo program VDEMO.

Error handlingIf size is not a power of 2, VF_FFT (on which VF_spectrum is based) complains "Size must be an integer power of 2" and the program is aborted.
Return valuePSD at the Nyquist frequency
See alsoVF_FFT,   VF_xspectrum,   VF_convolve,   VF_autocorr,   VF_xcorr,   VF_filter

 

VF_splinederiv2VD_splinederiv2VE_splinederiv2
FunctionGenerate a second-derivative table from an X-Y-table to be used for cubic-spline interpolation.
Syntax C/C++#include <VFstd.h>
void VF_splinederiv2( fVector Y2, fVector XTab, fVector YTab, ui size, int specify, float Yp0, float Ypn );
C++ VecObj#include <OptiVec.h>
void vector<T>::splinederiv2( const vector<T>& XTab, const vector<T>& YTab, int specify, T Yp0, T Ypn );
Pascal/Delphiuses VFstd;
procedure VF_splinederiv2( Y2, XTab, YTab:fVector; size:UIntSize; specify:IntBool; Yp0, Ypn:Single );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_splinederiv2( fVector d_Y2, fVector d_XTab, fVector d_YTab, ui size, int specify, float Yp0, float Ypn );
int cusdVF_splinederiv2( fVector d_Y2, fVector d_XTab, fVector d_YTab, ui size, int specify, float *d_Yp0, float *d_Ypn );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_splinederiv2( d_Y2, d_XTab, d_YTab:fVector; size:UIntSize; specify:IntBool; Yp0, Ypn:Single );
function cusdVF_splinederiv2( d_Y2, d_XTab, d_YTab:fVector; size:UIntSize; specify:IntBool; d_Yp0, d_Ypn:PSingle );
DescriptionA table of second derivatives of YTab is generated to be used for cubic-spline interpolation with VF_splineinterpol. In order to get a unique solution, two additional conditions have to be specified. Setting specify to FALSE (0) yields the "natural cubic spline" with Y2 being set to zero at both end-points; in this case, Yp0 and Ypn have no influence. Setting specify to TRUE (1) yields Y2 calculated in such a way that the first(!) derivative at the zero'th and at the last position equals Yp0 and Ypn, resp.

CUDA versions only: These functions are very slow, as the actual calculation of the derivative table is performed on the CPU rather than on the GPU. This is also the reason why there are no V?cu_ versions.

Error handlingnone
Return valuenone
See alsoVF_splineinterpol

 

VF_splineinterpolVD_splineinterpolVE_splineinterpol
FunctionCubic-spline interpolation of X-Y-table values with given second derivatives of the table
Syntax C/C++#include <VFstd.h>
void VF_splineinterpol( fVector Y, fVector X, ui sizex, fVector XTab, fVector YTab, fVector Y2Tab, ui sizetab );
C++ VecObj#include <OptiVec.h>
void vector<T>::splineinterpol( const vector<T>& X, const vector<T>& XTab, const vector<T>& YTab, const vector<T>& Y2Tab );
Pascal/Delphiuses VFstd;
procedure VF_splineinterpol( Y, X:fVector; sizex:UIntSize; XTab, YTab, Y2Tab:fVector; sizetab:UIntSize );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_splineinterpol( fVector d_Y, fVector d_X, ui sizex, fVector d_XTab, fVector d_YTab, fVector d_Y2Tab, ui sizetab );
void VFcu_splineinterpol( fVector h_Y, fVector h_X, ui sizex, fVector h_XTab, fVector h_YTab, fVector h_Y2Tab, ui sizetab );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_splineinterpol( d_Y, d_X:fVector; sizex:UIntSize; d_XTab, d_YTab, d_Y2Tab:fVector; sizetab:UIntSize );
procedure VFcu_splineinterpol( h_Y, h_X:fVector; sizex:UIntSize; h_XTab, h_YTab, h_Y2Tab:fVector; sizetab:UIntSize );
DescriptionFor each of the sizex elements of X, the corresponding element of Y is interpolated from the XTab-YTab value pairs. A table of second derivatives of YTab is needed that has to be generated by a call to VF_splinederiv2 prior to calling VF_splineinterpol. XTab must be ordered (either ascending or descending). All values of XTab must be distinct; otherwise a division by zero may occur and lead to a program abort. sizetab must be greater than or equal to 3.
For a simplified alternative to this function, consider VF_natCubSplineInterpol.
Error handlingnone (you have to take care yourself that the XTab values are distinct and that the YTab values are not near the limit of overflowing).
Return valuenone
See alsoVF_natCubSplineInterpol,   VF_splinederiv2,   VF_ratinterpol,   VF_polyinterpol

 

VF_sqrtVD_sqrtVE_sqrt
VFu_sqrtVDu_sqrtVEu_sqrt
VCF_sqrtVCD_sqrtVCE_sqrt
VFx_sqrtVDx_sqrtVEx_sqrt
VFux_sqrtVDux_sqrtVEux_sqrt
VCFx_sqrtVCDx_sqrtVCEx_sqrt
VPF_sqrtVPD_sqrtVPE_sqrt
FunctionSquare root
Syntax C/C++#include <VFmath.h>
int VF_sqrt( fVector Y, fVector X, ui size );
int VFx_sqrt( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::sqrt( const vector<T>& X );
int vector<T>::x_sqrt( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_sqrt( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_sqrt( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_sqrt( fVector d_Y, fVector d_X, ui size );
int cudaVFx_sqrt( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_sqrt( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_sqrt( fVector h_Y, fVector h_X, ui size );
int VFxcu_sqrt( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_sqrt( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_sqrt( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_sqrt( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_sqrt( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_sqrt( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = sqrt( Xi )
expanded versions: Yi = C * sqrt( A*Xi+B )

The "unprotected" versions (prefix VFu_,   VFux_, etc.) do not perform any error handling, which makes them much faster (up to 350% for VFux_sqrt) than the standard versions. On the other hand, any negative input number may lead to an uncontrolled programme crash. Input numbers near the underflow limit may lead to a result of 0. Apart from allowing no negative input numbers, the "unprotected" expanded version (prefix VFux_) also requires that neither the product A*Xi nor the sum A*Xi+B may overflow.

Error handlingNormal versions (VF_, VFx_ etc.): DOMAIN errors occur if, in the real-number versions, the square root of a negative numbers is requested; NAN ("not-a-number") is the default result in this case.
Unprotected versions (VFu_, VFux_ etc.): no error handling.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_square,   VF_rsqrt,   VF_pow,   VF_ipow,   VF_poly

 

VF_squareVD_squareVE_square
VFx_squareVDx_squareVEx_square
VFu_squareVDu_squareVEu_square
VFux_squareVDux_squareVEux_square
VCF_squareVCD_squareVCE_square
VCFx_squareVCDx_squareVCEx_square
VCFu_squareVCDu_squareVCEu_square
VCFux_squareVCDux_squareVCEux_square
VPF_squareVPD_squareVPE_square
VPFu_squareVPDu_squareVPEu_square
FunctionSquare
Syntax C/C++#include <VFmath.h>
int VF_square( fVector Y, fVector X, ui size );
int VFx_square( fVector Y, fVector X, ui size, float A, float B );
int VFu_square( fVector Y, fVector X, ui size );
int VFux_square( fVector Y, fVector X, ui size, float A, float B );
C++ VecObj#include <OptiVec.h>
int vector<T>::square( const vector<T>& X );
int vector<T>::x_square( const vector<T>& X, const T& A, const T& B );
int vector<T>::u_square( const vector<T>& X );
int vector<T>::ux_square( const vector<T>& X, const T& A, const T& B );
Pascal/Delphiuses VFmath;
function VF_square( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_square( Y, X:fVector; size:UIntSize; A, B:Single ): IntBool;
function VFu_square( Y, X:fVector; size:UIntSize ): IntBool;
function VFux_square( Y, X:fVector; size:UIntSize; A, B:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_square( fVector d_Y, fVector d_X, ui size );
int cudaVFx_square( fVector d_Y, fVector d_X, ui size, float A, float B );
int cusdVFx_square( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B );
int VFucu_square( fVector h_Y, fVector h_X, ui size );
int VFuxcu_square( fVector h_Y, fVector h_X, ui size, float A, float B );
int cudaVFu_square( fVector d_Y, fVector d_X, ui size );
int cudaVFux_square( fVector d_Y, fVector d_X, ui size, float A, float B );
int cusdVFux_square( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B );
int VFucu_square( fVector h_Y, fVector h_X, ui size );
int VFuxcu_square( fVector h_Y, fVector h_X, ui size, float A, float B );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_square( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_square( d_Y, d_X:fVector; size:UIntSize; A, B:Single ): IntBool;
function cusdVFx_square( d_Y, d_X:fVector; size:UIntSize; d_A, d_B:PSingle ): IntBool;
function VFcu_square( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_square( h_Y, h_X:fVector; size:UIntSize; A, B:Single ): IntBool;
function cudaVFu_square( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFux_square( d_Y, d_X:fVector; size:UIntSize; A, B:Single ): IntBool;
function cusdVFux_square( d_Y, d_X:fVector; size:UIntSize; d_A, d_B:PSingle ): IntBool;
function VFucu_square( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFuxcu_square( h_Y, h_X:fVector; size:UIntSize; A, B:Single ): IntBool;
Descriptionsimple versions: Yi = Xi2
expanded versions: Yi = (A*Xi+B)2

The "unprotected" versions (prefix VFu_,   VFux_, etc.) do not perform any error handling, which makes them much faster, but riskier than the standard versions. The extended-precision complex (VCEu_ and VCEux_) versions do not take some of the security measures present in the standard version and might fail for results very near the overflow limit; results near the underflow limit might be rendered as 0.

Error handlingOVERFLOW errors lead to a default result of HUGE_VAL.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)
See alsoVF_cubic,   VF_rsquare,   VF_sqrt,   VF_pow,   VF_ipow,   VF_poly

 

VF_ssqVD_ssqVE_ssq
FunctionSum-of-squares
Syntax C/C++#include <VFstd.h>
float VF_ssq( fVector X, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::ssq();
Pascal/Delphiuses VFstd;
function VF_ssq( X:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_ssq( float *h_RetVal, fVector d_X, ui size );
int cusdVF_ssq( float *d_RetVal, fVector d_X, ui size );
float VFcu_ssq( fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_ssq( var h_RetVal:Single; d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_ssq( d_RetVal:PSingle; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_ssq( h_X:fVector; size:UIntSize ): Single;
Descriptionssq = sum( Xi2 )
Error handlingnone (but be careful: this function may lead to an overflow!)
Return valuesum of the squares of the vector elements.
See alsoVF_sum,   VF_rms,   VF_ssqdevC,   VF_scalprod,   VF_Euclid

 

VF_ssqdevCVD_ssqdevCVE_ssqdevC
FunctionSum of the squares of the deviations from a preset value.
Syntax C/C++#include <VFstd.h>
float VF_ssqdevC( fVector X, ui size, float C );
C++ VecObj#include <OptiVec.h>
T vector<T>::ssqdevC( const T& C );
Pascal/Delphiuses VFstd;
function VF_ssqdevC( X:fVector; size:UIntSize; C:Single ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_ssqdevC( float *h_RetVal, fVector d_X, ui size, float C );
int cusdVF_ssqdevC( float *d_RetVal, fVector d_X, ui size, float *d_C );
float VFcu_ssqdevC( fVector X, ui size, float C );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_ssqdevC( var h_RetVal:Single; d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_ssqdevC( d_RetVal:PSingle; d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
function VFcu_ssqdevC( h_X:fVector; size:UIntSize; C:Single ): Single;
DescriptionssqdevC = sum( (Xi - C)2 )
Error handlingnone
Return valuesum of the squares of the deviations.
See alsoVF_ssq,   VF_ssqdevV,   VF_avdevC,   VF_sumdevC,   VF_chi2

 

VF_ssqdevVVD_ssqdevVVE_ssqdevV
VF_ssqdevVwSaturationVD_ssqdevVwSaturationVE_ssqdevVwSaturation
FunctionSum of the squares of the deviations of the elements of one vector from the corresponding elements of another
Syntax C/C++#include <VFstd.h>
float VF_ssqdevV( fVector X, fVector Y, ui size );
float VF_ssqdevVwSaturation( fVector X, fVector Y, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::ssqdevV( const vector<T>& Y );
T vector<T>::ssqdevVwSaturation( const vector<T>& Y );
Pascal/Delphiuses VFstd;
function VF_ssqdevV( X, Y:fVector; size:UIntSize ): Single;
function VF_ssqdevVwSaturation( X, Y:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_ssqdevV( float *h_RetVal, fVector X, fVector Y, ui size );
int cusdVF_ssqdevV( float *d_RetVal, fVector X, fVector Y, ui size );
float VFcu_ssqdevV( fVector h_X, fVector h_Y, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_ssqdevV( var h_RetVal:Single; d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cusdVF_ssqdevV( d_RetVal:PSingle; d_X, d_Y:fVector; size:UIntSize ): IntBool;
function VFcu_ssqdevV( h_X, h_Y:fVector; size:UIntSize ): Single;
DescriptionssqdevV = sum( (Xi - Yi)2 )
The deviation of each element of X from the corresponding element of Y is calculated and the squares of the deviations summed up and returned.

V?_ssqdevVwSaturation is almost identical to V?_ssqdevV, except for the treatment of infinities and NAN values. While V?_ssqdevV may overflow to INF and will return NAN, if any input element is a NAN, V?_ssqdevVwSaturation will saturate possible overflow into HUGE_VAL and treats input values of ±NAN as ±HUGE_VAL.

Error handlingnone
Return valuesum of the squares of the deviations.
See alsoVF_ssq,   VF_ssqdevC,   VF_avdevV,   VF_sumdevV,   VF_chi2

 

VF_storeVD_storeVE_store
VCF_storeVCD_storeVCE_store
VPF_storeVPD_storeVPE_store
VI_storeVBI_storeVSI_storeVLI_storeVQI_store 
VU_storeVUB_storeVUS_storeVUL_storeVUQ_storeVUI_store
FunctionStore a vector in binary format into a stream
Syntax C/C++#include <VFstd.h>
int VF_store( FILE *stream, fVector X, ui size );
C++ VecObj#include <OptiVec.h>
int vector<T>::store( FILE *stream );
Pascal/Delphiuses VFstd;
function VF_store( var Stream:FILE; X:fVector; size:UIntSize ): Integer;
CUDA function C/C++#include <cudaVFstd.h>
void cudaVF_store( FILE *stream, fVector d_X, ui size );
void cudaVF_store_buf( FILE *stream, fVector d_X, ui size, fVector h_Wk );
CUDA function Pascal/Delphiuses VFstd;
procedure cudaVF_store( var Stream:FILE; d_X:fVector; size:UIntSize );
procedure cudaVF_store_buf( var Stream:FILE; d_X:fVector; size:UIntSize; h_Wk:fVector );
Descriptionsize elements of X are written to stream in binary format. The stream must be already open for binary write operations.
The VecObj version stores not only the vector elements, but the whole vector object by first storing size. Please note that VF_recall etc. can only read vectors stored with VF_store etc., whereas the VecObj function recall is used to retrieve vector objects stored with the VecObj function store. You can, however, employ the calling sequence
VUI_store( stream, &size, 1 );
VF_store( stream, X, size );   /* C/C++ */

or
VU_store( stream, @size, 1 );
VF_store( stream, X, size );   (* Pascal/Delphi *)

to make the stored vector X readable as a vector object later.

CUDA versions only: cudaV?_store_buf takes a host vector h_Wk as additional argument. The latter serves as buffer memory and needs to be (at least) of the same size as X. By avoiding the need of cudaV?_store to allocate its own buffer memory, cudaV?_store_buf is slightly faster.

GCC and CLang only: GCC and CLang (including BCC32C) pad the 10-byte data type long double to 12 or 16 bytes in memory (12 byte in 32-bit, 16 byte in 64 bit). In order to maintain compatibility of the generated data files between compilers, the VE_store / VE_recall, VCE_store / VCE_recall, and VPE_store / VPE_recall pairs always use 10-byte storage on disk.

Thread safetyDifferent threads may safely call any functions of the VF_ / MF_store and VF_ / MF_recall families simultaneously, as long as the refer to different streams. If they have to access one and the same stream, however, the user must take appropriate measures (critical sections, mutexes), in order to prevent race conditions.
Error handlingError handling is performed by the C function fwrite or the Delphi function BlockWrite, on which VF_store etc. are based.
Return value0, if successful; otherwise 1. In order to obtain more information, inspect errno (C/C++) or IOResult (Delphi).
See alsoVF_recall,   VF_write,   VF_cprint,   VF_print

 

VF_subCVD_subCVE_subC
VCF_subCVCD_subCVCE_subC
VCF_subReCVCD_subReCVCE_subReC
VI_subCVBI_subCVSI_subCVLI_subCVQI_subC 
VU_subCVUB_subCVUS_subCVUL_subCVUQ_subCVUI_subC
FunctionSubtract a constant from each vector element
Syntax C/C++#include <VFmath.h>
void VF_subC( fVector Y, fVector X, ui size, float C );
void VCF_subC( cfVector Y, cfVector X, ui size, fComplex C );
void VCF_subReC( cfVector Y, cfVector X, ui size, float CRe );
C++ VecObj#include <OptiVec.h>
void vector<T>::subC( const vector<T>& X, const T& C );
void vector<complex<T>>::subC( const vector<complex<T>>& X, complex<T> C );
void vector<complex<T>>::subReC( const vector<complex<T>>& X, const T& CRe );
Pascal/Delphiuses VFmath;
procedure VF_subC( Y, X:fVector; size:UIntSize; C:Single );
procedure VCF_subC( Y, X:cfVector; size:UIntSize; C:fComplex );
procedure VCF_subReC( Y, X:cfVector; size:UIntSize; CRe:Single );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_subC( fVector d_Y, fVector d_X, ui size, float C );
int cusdVF_subC( fVector d_Y, fVector d_X, ui size, float *d_C );
void VFcu_subC( fVector d_Y, fVector d_X, ui size, float C );
#include <cudaVCFmath.h>
int cudaVCF_subReC( cfVector d_Y, cfVector d_X, ui size, float CRe );
int cusdVCF_subReC( cfVector d_Y, cfVector d_X, ui size, float *d_CRe );
void VCFcu_subReC( cfVector h_Y, cfVector h_X, ui size, float CRe );
CUDA function Pascal/Delphiuses VFmath, VCFmath;
function cudaVF_subC( d_Y, d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_subC( d_Y, d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
procedure VFcu_subC( h_Y, h_X:fVector; size:UIntSize; C:Single );
function cudaVCF_subReC( d_Y, d_X:cfVector; size:UIntSize; CRe:Single );
function cusdVCF_subReC( d_Y, d_X:cfVector; size:UIntSize; d_CRe:PSingle );
procedure VCFcu_subReC( h_Y, h_X:cfVector; size:UIntSize; CRe:Single );
DescriptionYi = Xi - C
The complex floating-point versions exist in two variants, one for complex constants C, the other for real-valued constants CRe subtracted from the complex vector.
Error handlingfloating-point versions: none;
integer versions: see chapter 5.2.
Return valuenone
See alsoVF_subV,   VF_subrC,   VF_addC,   VF_mulC,   VF_divC

 

VF_subrCVD_subrCVE_subrC
VCF_subrCVCD_subrCVCE_subrC
VCF_subrReCVCD_subrReCVCE_subrReC
VI_subrCVBI_subrCVSI_subrCVLI_subrCVQI_subrC 
VU_subrCVUB_subrCVUS_subrCVUL_subrCVUQ_subrCVUI_subrC
FunctionReverse subtraction: subtract a vector from a constant
Syntax C/C++#include <VFmath.h>
void VF_subrC( fVector Y, fVector X, ui size, float C );
void VCF_subrC( cfVector Y, cfVector X, ui size, fComplex C );
void VCF_subrReC( cfVector Y, cfVector X, ui size, float CRe );
C++ VecObj#include <OptiVec.h>
void vector<T>::subrC( const vector<T>& X, const T& C );
void vector<complex<T>>::subrC( const vector<complex<T>>& X, complex<T> C );
void vector<complex<T>>::subrReC( const vector<complex<T>>& X, const T& CRe );
Pascal/Delphiuses VFmath;
procedure VF_subrC( Y, X:fVector; size:UIntSize; C:Single );
procedure VCF_subrC( Y, X:cfVector; size:UIntSize; C:fComplex );
procedure VCF_subrReC( Y, X:cfVector; size:UIntSize; CRe:Single );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_subrC( fVector d_Y, fVector d_X, ui size, float C );
int cusdVF_subrC( fVector d_Y, fVector d_X, ui size, float *d_C );
void VFcu_subrC( fVector d_Y, fVector d_X, ui size, float C );
#include <cudaVCFmath.h>
int cudaVCF_subrReC( cfVector d_Y, cfVector d_X, ui size, float CRe );
int cusdVCF_subrReC( cfVector d_Y, cfVector d_X, ui size, float *d_CRe );
void VCFcu_subrReC( cfVector h_Y, cfVector h_X, ui size, float CRe );
CUDA function Pascal/Delphiuses VFmath, VCFmath;
function cudaVF_subrC( d_Y, d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_subrC( d_Y, d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
procedure VFcu_subrC( h_Y, h_X:fVector; size:UIntSize; C:Single );
function cudaVCF_subrReC( d_Y, d_X:cfVector; size:UIntSize; CRe:Single );
function cusdVCF_subrReC( d_Y, d_X:cfVector; size:UIntSize; d_CRe:PSingle );
procedure VCFcu_subrReC( h_Y, h_X:cfVector; size:UIntSize; CRe:Single );
DescriptionYi = C - Xi
The complex floating-point versions exist in two variants, one for complex constants C, the other for real-valued constants CRe from which the complex vector is subtracted.
Error handlingfloating-point versions: none;
integer versions: see chapter 5.2.
Return valuenone
See alsoVF_addV,   VF_subC,   VF_mulC,   VF_divC,   VF_visC,   VF_redC

 

VF_subrVVD_subrVVE_subrV
VCF_subrVVCD_subrVVCE_subrV
VCF_subrReVVCD_subrReVVCE_subrReV
VFx_subrVVDx_subrVVEx_subrV
VCFx_subrVVCDx_subrVVCEx_subrV
VCFx_subrReVVCDx_subrReVVCEx_subrReV
VI_subrVVBI_subrVVSI_subrVVLI_subrVVQI_subrV 
VU_subrVVUB_subrVVUS_subrVVUL_subrVVUQ_subrVVUI_subrV
FunctionSubtraction in reverse order
Syntax C/C++#include <VFmath.h>
void VF_subrV( fVector Z, fVector X, fVector Y, ui size );
void VFx_subrV( fVector Z, fVector X, fVector Y, ui size, float A, float B );
void VCF_subrV( cfVector Z, cfVector X, cfVector Y, ui size );
void VCF_subrReV( cfVector Z, cfVector X, fVector Y, ui size );
void VCFx_subrV( cfVector Z, cfVector X, cfVector Y, ui size, fComplex A, fComplex B );
void VCFx_subrReV( cfVector Z, cfVector X, fVector Y, ui size, fComplex A, fComplex B );
C++ VecObj#include <OptiVec.h>
void vector<T>::subrV( const vector<T>& X, const vector<T>& Y );
void vector<T>::x_subrV( const vector<T>& X, const vector<T>& Y, const T& A, const T& B );
void vector<complex<T>>::subrV( const vector<complex<T>>& X, const vector<complex<T>>& Y );
void vector<complex<T>>::subrReV( const vector<complex<T>>& X, const vector<T>& Y );
void vector<complex<T>>::x_subrV( const vector<complex<T>>& X, const vector<complex<T>>& Y, complex<T> A, complex<T> B );
void vector<complex<T>>::x_subrReV( const vector<complex<T>>& X, const vector<T>& Y, complex<T> A, complex<T> B );
Pascal/Delphiuses VFmath;
procedure VF_subrV( Z, X, Y:fVector; size:UIntSize );
procedure VFx_subrV( Z, X, Y:fVector; size:UIntSize; A, B:Single);
procedure VCF_subrV( Z, X, Y:cfVector; size:UIntSize );
procedure VCF_subrReV( Z, X:cfVector; Y:fVector; size:UIntSize );
procedure VCFx_subrV( Z, X, Y:cfVector; size:UIntSize; A, B:fComplex );
procedure VCFx_subrReV( Z, X:cfVector; Y:fVector; size:UIntSize; A, B:fComplex );
CUDA function C/C++#include <cudaVFmath.h>
#include <cudaVCFmath.h>
int cudaVF_subrV( fVector d_Z, fVector d_X, fVector d_Y,ui size );
int cudaVFs_subrV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float C );
int cusdVFs_subrV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float *d_C );
int cudaVFx_subrV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float A, float B );
int cusdVFx_subrV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float *d_A, float *d_B );
int cudaVCF_subrReV( cfVector d_Z, cfVector d_X, fVector d_Y, ui size );
int cudaVCFx_subrReV( cfVector d_Z, cfVector d_X, fVector d_Y, ui size, fComplex A, fComplex B );
int cusdVCFx_subrReV( cfVector d_Z, cfVector d_X, fVector d_Y, ui size, fComplex *d_A, fComplex *d_B );
void VFcu_subrV( fVector h_Z, fVector h_X, fVector h_Y,ui size );
void VFscu_subrV( fVector h_Z, fVector h_X, fVector h_Y, ui size, float C );
void VFxcu_subrV( fVector h_Z, fVector h_X, fVector h_Y, ui size, float A, float B );
void VCFcu_subrReV( cfVector h_Z, cfVector h_X, fVector h_Y, ui size );
void VCFxcu_subrV( cfVector h_Z, cfVector h_X, cfVector h_Y, ui size, fComplex A, fComplex B );
void VCFxcu_subrReV( cfVector h_Z, cfVector h_X, fVector h_Y, ui size, fComplex A, fComplex B );
CUDA function Pascal/Delphiuses VFmath, VCFmath;
function cudaVF_subrV( d_Z, d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cudaVFs_subrV( d_Z, d_X, d_Y:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVFs_subrV( d_Z, d_X, d_Y:fVector; size:UIntSize; d_C:PSingle ): IntBool;
function cudaVFx_subrV( d_Z, d_X, d_Y:fVector; size:UIntSize; A, B:Single ): IntBool;
function cusdVFx_subrV( d_Z, d_X, d_Y:fVector; size:UIntSize; d_A, d_B:PSingle ): IntBool;
function cudaVCF_subrReV( d_Z, d_X:cfVector; d_Y:fVector; size:UIntSize ): IntBool;
function cudaVCFx_subrReV( d_Z, d_X:cfVector; d_Y:fVector; size:UIntSize; A, B:fComplex ): IntBool;
function cusdVCFx_subrReV( d_Z, d_X:cfVector; d_Y:fVector; size:UIntSize; d_A, d_B:PfComplex ): IntBool;
procedure VFcu_subrV( h_Z, h_X, h_Y:fVector; size:UIntSize );
procedure VFscu_subrV( h_Z, h_X, h_Y:fVector; size:UIntSize; C:Single );
procedure VFxcu_subrV( h_Z, h_X, h_Y:fVector; size:UIntSize; A, B:Single );
procedure VCFcu_subrReV( h_Z, h_X:cfVector; h_Y:fVector; size:UIntSize );
procedure VCFxcu_subrReV( h_Z, h_X:cfVector; h_Y:fVector; size:UIntSize; A, B:fComplex );
Descriptionsimple versions: Zi = Yi - Xi
expanded versions: Zi = Yi - (A*Xi+B)
The complex floating-point versions exist in two variants: in the first variant (e.g., VCF_subrV,   VCFx_subrV), X, Y, and Z are all complex; in the second variant, Y is real-valued (e.g., VCF_subrReV - "reverse subtraction of a real vector", i.e., subtraction of a complex vector from a real vector).
Error handlingfloating-point versions: none;
integer versions: see chapter 5.2.
Return valuenone
See alsoVF_subrC,   VF_addV,   VF_mulV,   VF_divV,   VF_subV,   VF_subrVI

 

VF_subrVIVD_subrVIVE_subrVI
VF_subrVBIVD_subrVBIVE_subrVBI
VF_subrVSIVD_subrVSIVE_subrVSI
VF_subrVLIVD_subrVLIVE_subrVLI
VF_subrVQIVD_subrVQIVE_subrVQI
VF_subrVUVD_subrVUVE_subrVU
VF_subrVUBVD_subrVUBVE_subrVUB
VF_subrVUSVD_subrVUSVE_subrVUS
VF_subrVULVD_subrVULVE_subrVUL
VF_subrVUQVD_subrVUQVE_subrVUQ
VF_subrVUIVD_subrVUIVE_subrVUI
FunctionReverse subtraction: subtract a floating-point vector from an integer vector
Syntax C/C++#include <VFmath.h>
void VF_subrVI( fVector Z, fVector X, iVector Y,ui size );
void VF_subrVUB( fVector Z, fVector X, ubVector Y, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::subrVI( const vector<T>& X, const vector<int>& Y );
void vector<T>::subrVUS( const vector<T>& X, const vector<unsigned short>& Y, );
Pascal/Delphiuses VFmath;
procedure VF_subrVI( Z, X:fVector; Y:iVector; size:UIntSize );
procedure VF_subrVUL( Z, X:fVector; Y:ulVector; size:UIntSize );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_subrVI( fVector d_Z, fVector d_X, iVector d_Y,ui size );
int cudaVF_subrVUB( fVector d_Z, fVector d_X, ubVector d_Y, ui size );
void VFcu_subrVI( fVector h_Z, fVector h_X, iVector h_Y,ui size );
void VFcu_subrVUB( fVector h_Z, fVector h_X, ubVector h_Y, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_subrVI( d_Z, d_X:fVector; d_Y:iVector; size:UIntSize ): IntBool;
function cudaVF_subrVUL( d_Z, d_X:fVector; d_Y:ulVector; size:UIntSize ): IntBool;
procedure VFcu_subrVI( h_Z, h_X:fVector; h_Y:iVector; size:UIntSize );
procedure VFcu_subrVUL( h_Z, h_X:fVector; h_Y:ulVector; size:UIntSize );
DescriptionZi = Yi - Xi
Error handlingnone
Return valuenone
See alsoVF_subrV,   VF_subVI,   VF_addVI

 

VF_subVVD_subVVE_subV
VCF_subVVCD_subVVCE_subV
VCF_subReVVCD_subReVVCE_subReV
VFs_subVVDs_subVVEs_subV
VFx_subVVDx_subVVEx_subV
VCFx_subVVCDx_subVVCEx_subV
VCFx_subReVVCDx_subReVVCEx_subReV
VI_subVVBI_subVVSI_subVVLI_subVVQI_subV 
VU_subVVUB_subVVUS_subVVUL_subVVUQ_subVVUI_subV
FunctionSubtract two vectors
Syntax C/C++#include <VFmath.h>
void VF_subV( fVector Z, fVector X, fVector Y, ui size );
void VFs_subV( fVector Z, fVector X, fVector Y, ui size, float C );
void VFx_subV( fVector Z, fVector X, fVector Y, ui size, float A, float B );
void VCF_subV( cfVector Z, cfVector X, cfVector Y, ui size );
void VCF_subReV( cfVector Z, cfVector X, fVector Y, ui size );
void VCFx_subV( cfVector Z, cfVector X, cfVector Y, ui size, fComplex A, fComplex B );
void VCFx_subReV( cfVector Z, cfVector X, fVector Y, ui size, fComplex A, fComplex B );
C++ VecObj#include <OptiVec.h>
void vector<T>::subV( const vector<T>& X, const vector<T>& Y );
void vector<T>::s_subV( const vector<T>& X, const vector<T>& Y, const T& C );
void vector<T>::x_subV( const vector<T>& X, const vector<T>& Y, const T& A, const T& B );
void vector<complex<T>>::subV( const vector<complex<T>>& X, const vector<complex<T>>& Y );
void vector<complex<T>>::subReV( const vector<complex<T>>& X, const vector<T>& Y );
void vector<complex<T>>::x_subV( const vector<complex<T>>& X, const vector<complex<T>>& Y, complex<T> A, complex<T> B );
void vector<complex<T>>::x_subReV( const vector<complex<T>>& X, const vector<T>& Y, complex<T> A, complex<T> B );
Pascal/Delphiuses VFmath;
procedure VF_subV( Z, X, Y:fVector; size:UIntSize );
procedure VFx_subV( Z, X, Y:fVector; size:UIntSize; A, B:Single);
procedure VCF_subV( Z, X, Y:cfVector; size:UIntSize );
procedure VCF_subReV( Z, X:cfVector; Y:fVector; size:UIntSize );
procedure VCFx_subV( Z, X, Y:cfVector; size:UIntSize; A, B:fComplex );
procedure VCFx_subrReV( Z, X:cfVector; Y:fVector; size:UIntSize; A, B:fComplex );
CUDA function C/C++#include <cudaVFmath.h>
#include <cudaVCFmath.h>
int cudaVF_subV( fVector d_Z, fVector d_X, fVector d_Y,ui size );
int cudaVFs_subV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float C );
int cusdVFs_subV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float *d_C );
int cudaVFx_subV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float A, float B );
int cusdVFx_subV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float *d_A, float *d_B );
int cudaVCF_subReV( cfVector d_Z, cfVector d_X, fVector d_Y, ui size );
int cudaVCFx_subReV( cfVector d_Z, cfVector d_X, fVector d_Y, ui size, fComplex A, fComplex B );
int cusdVCFx_subReV( cfVector d_Z, cfVector d_X, fVector d_Y, ui size, fComplex *d_A, fComplex *d_B );
void VFcu_subV( fVector h_Z, fVector h_X, fVector h_Y,ui size );
void VFscu_subV( fVector h_Z, fVector h_X, fVector h_Y, ui size, float C );
void VFxcu_subV( fVector h_Z, fVector h_X, fVector h_Y, ui size, float A, float B );
void VCFcu_subReV( cfVector h_Z, cfVector h_X, fVector h_Y, ui size );
void VCFxcu_subV( cfVector h_Z, cfVector h_X, cfVector h_Y, ui size, fComplex A, fComplex B );
void VCFxcu_subReV( cfVector h_Z, cfVector h_X, fVector h_Y, ui size, fComplex A, fComplex B );
CUDA function Pascal/Delphiuses VFmath, VCFmath;
function cudaVF_subV( d_Z, d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cudaVFs_subV( d_Z, d_X, d_Y:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVFs_subV( d_Z, d_X, d_Y:fVector; size:UIntSize; d_C:PSingle ): IntBool;
function cudaVFx_subV( d_Z, d_X, d_Y:fVector; size:UIntSize; A, B:Single ): IntBool;
function cusdVFx_subV( d_Z, d_X, d_Y:fVector; size:UIntSize; d_A, d_B:PSingle ): IntBool;
function cudaVCF_subReV( d_Z, d_X:cfVector; d_Y:fVector; size:UIntSize ): IntBool;
function cudaVCFx_subReV( d_Z, d_X:cfVector; d_Y:fVector; size:UIntSize; A, B:fComplex ): IntBool;
function cusdVCFx_subReV( d_Z, d_X:cfVector; d_Y:fVector; size:UIntSize; d_A, d_B:PfComplex ): IntBool;
procedure VFcu_subV( h_Z, h_X, h_Y:fVector; size:UIntSize );
procedure VFscu_subV( h_Z, h_X, h_Y:fVector; size:UIntSize; C:Single );
procedure VFxcu_subV( h_Z, h_X, h_Y:fVector; size:UIntSize; A, B:Single );
procedure VCFcu_subReV( h_Z, h_X:cfVector; h_Y:fVector; size:UIntSize );
procedure VCFxcu_subReV( h_Z, h_X:cfVector; h_Y:fVector; size:UIntSize; A, B:fComplex );
Descriptionsimple versions: Zi = Xi - Yi
scaled versions: Zi = C * (Xi - Yi)
expanded versions: Zi = (A*Xi+B) - Yi
The complex floating-point versions exist in two variants: in the first variant (e.g., VCF_subV,   VCFx_subV), X, Y, and Z are all complex; in the second variant, Y is real-valued (e.g., VCF_subReV - "subtract a real vector").
Error handlingfloating-point versions: none;
integer versions: see chapter 5.2.
Return valuenone
See alsoVF_subC,   VF_addV,   VF_mulV,   VF_divV,   VF_subVI

 

VF_subVIVD_subVIVE_subVI
VF_subVBIVD_subVBIVE_subVBI
VF_subVSIVD_subVSIVE_subVSI
VF_subVLIVD_subVLIVE_subVLI
VF_subVQIVD_subVQIVE_subVQI
VF_subVUVD_subVUVE_subVU
VF_subVUBVD_subVUBVE_subVUB
VF_subVUSVD_subVUSVE_subVUS
VF_subVULVD_subVULVE_subVUL
VF_subVUQVD_subVUQVE_subVUQ
VF_subVUIVD_subVUIVE_subVUI
FunctionSubtract an integer vector from a floating-point vector
Syntax C/C++#include <VFmath.h>
void VF_subVI( fVector Z, fVector X, iVector Y,ui size );
void VF_subVUB( fVector Z, fVector X, ubVector Y, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::subVI( const vector<T>& X, const vector<int>& Y );
void vector<T>::subVUS( const vector<T>& X, const vector<unsigned short>& Y, );
Pascal/Delphiuses VFmath;
procedure VF_subVI( Z, X:fVector; Y:iVector; size:UIntSize );
procedure VF_subVUL( Z, X:fVector; Y:ulVector; size:UIntSize );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_subVI( fVector d_Z, fVector d_X, iVector d_Y,ui size );
int cudaVF_subVUB( fVector d_Z, fVector d_X, ubVector d_Y, ui size );
void VFcu_subVI( fVector h_Z, fVector h_X, iVector h_Y,ui size );
void VFcu_subVUB( fVector h_Z, fVector h_X, ubVector h_Y, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_subVI( d_Z, d_X:fVector; d_Y:iVector; size:UIntSize ): IntBool;
function cudaVF_subVUL( d_Z, d_X:fVector; d_Y:ulVector; size:UIntSize ): IntBool;
procedure VFcu_subVI( h_Z, h_X:fVector; h_Y:iVector; size:UIntSize );
procedure VFcu_subVUL( h_Z, h_X:fVector; h_Y:ulVector; size:UIntSize );
DescriptionZi = Xi - Yi
Error handlingnone
Return valuenone
See alsoVF_subV,   VF_subrVI,   VF_addVI

 

VF_subV_chiabsVD_subV_chiabsVE_subV_chiabs
FunctionSubtract two vectors and calculate the chiabs merit function
Syntax C/C++#include <VFmath.h>
float VF_subV_chiabs( fVector Z, fVector X, fVector Y, uifVector Wt,  size );
C++ VecObj#include <OptiVec.h>
T vector<T>::subV_chiabs( const vector<T>& X, const vector<T>& Y, const vector<T>& Wt );
Pascal/Delphiuses VFmath;
function VF_subV_chiabs( Z, X, Y, Wt:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_subV_chiabs( float *h_RetVal, fVector d_Z, fVector d_X, fVector d_Y, fVector d_Wt, ui size );
int cusdVF_subV_chiabs( float *d_RetVal, fVector d_Z, fVector d_X, fVector d_Y, fVector d_Wt, ui size );
float VFcu_subV_chiabs( fVector h_Z, fVector h_X, fVector h_Y, fVector h_Wt, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_subV_chiabs( var h_RetVal:Single; d_Z, d_X, d_Y, d_Wt:fVector; size:UIntSize ): IntBool;
function cusdVF_subV_chiabs( d_RetVal:PSingle; d_Z, d_X, d_Y, d_Wt:fVector; size:UIntSize ): IntBool;
DescriptionZi = Xi - Yi
chiabs = Sum(| Zi | * Wti )

This function saturates infinities into HUGE_VAL and treats input values of ±NAN as ±HUGE_VAL. The reasoning behind this is that V?_subV_chiabs finds its main use inside nonlinear fitting routines. If the fitting routine tries a bad parameter set, you want it to get the feedback that the guess was far off; you do not want it to be punished by an exception or programme crash.

Error handlingnone
Return valuechiabs merit function of the difference of the two vectors
See alsoVF_subV,   VF_chiabs,   VF_subV_ssq,   VF_subV_chi2,   chapter 13 of MATRIX.HTM

 

VF_subV_chi2VD_subV_chi2VE_subV_chi2
FunctionSubtract two vectors and calculate the c2 merit function
Syntax C/C++#include <VFmath.h>
float VF_subV_chi2( fVector Z, fVector X, fVector Y, uifVector InvVar,  size );
C++ VecObj#include <OptiVec.h>
T vector<T>::subV_chi2( const vector<T>& X, const vector<T>& Y, const vector<T>& InvVar );
Pascal/Delphiuses VFmath;
function VF_subV_chi2( Z, X, Y, InvVar:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_subV_chi2( float *h_RetVal, fVector d_Z, fVector d_X, fVector d_Y, fVector d_InvVar, ui size );
int cusdVF_subV_chi2( float *d_RetVal, fVector d_Z, fVector d_X, fVector d_Y, fVector d_InvVar, ui size );
float VFcu_subV_chi2( fVector h_Z, fVector h_X, fVector h_Y, fVector h_InvVar, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_subV_chi2( var h_RetVal:Single; d_Z, d_X, d_Y, d_InvVar:fVector; size:UIntSize ): IntBool;
function cusdVF_subV_chi2( d_RetVal:PSingle; d_Z, d_X, d_Y, d_InvVar:fVector; size:UIntSize ): IntBool;
DescriptionZi = Xi - Yi
c2 = Summe( 1/si2 * (Zi)2 )

This function saturates infinities into HUGE_VAL and treats input values of ±NAN as ±HUGE_VAL. The reasoning behind this is that V?_subV_chi2 finds its main use inside nonlinear fitting routines. If the fitting routine tries a bad parameter set, you want it to get the feedback that the guess was far off; you do not want it to be punished by an exception or programme crash.

Error handlingnone
Return valuec2 merit function of the difference of the two vectors
See alsoVF_subV,   VF_chi2,   VF_subV_ssq,   VF_subV_chiabs,   chapter 13 of MATRIX.HTM

 

VF_subV_ssqVD_subV_ssqVE_subV_ssq
FunctionSubtract two vectors and return the sum-of-squares of the differences
Syntax C/C++#include <VFmath.h>
float VF_subV_ssq( fVector Z, fVector X, fVector Y, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::subV_ssq( const vector<T>& X, const vector<T>& Y );
Pascal/Delphiuses VFmath;
function VF_subV_ssq( Z, X, Y:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_subV_ssq( float *h_RetVal, fVector d_Z, fVector d_X, fVector d_Y, ui size );
int cusdVF_subV_ssq( float *d_RetVal, fVector d_Z, fVector d_X, fVector d_Y, ui size );
float VFcu_subV_ssq( fVector h_Z, fVector h_X, fVector h_Y, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_subV_ssq( var h_RetVal:Single; d_Z, d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cusdVF_subV_ssq( d_RetVal:PSingle; d_Z, d_X, d_Y:fVector; size:UIntSize ): IntBool;
DescriptionZi = Xi - Yi
ssq = Sum(Zi2)

This function saturates infinities into HUGE_VAL and treats input values of ±NAN as ±HUGE_VAL. The reasoning behind this is that V?_subV_ssq finds its main use inside nonlinear fitting routines. If the fitting routine tries a bad parameter set, you want it to get the feedback that the guess was far off; you do not want it to be punished by an exception or programme crash.

Error handlingnone
Return valuesum-of-squares of the difference of the two vectors
See alsoVF_subV,   VF_ssqdevV,   VF_subV_sumabs,   VF_subV_chi2,   chapter 13 of MATRIX.HTM

 

VF_subV_sumabsVD_subV_sumabsVE_subV_sumabs
FunctionSubtract two vectors and calculate the sumabs merit function
Syntax C/C++#include <VFmath.h>
float VF_subV_sumabs( fVector Z, fVector X, fVector Y, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::subV_sumabs( const vector<T>& X, const vector<T>& Y );
Pascal/Delphiuses VFmath;
function VF_subV_sumabs( Z, X, Y:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_subV_sumabs( float *h_RetVal, fVector d_Z, fVector d_X, fVector d_Y, ui size );
int cusdVF_subV_sumabs( float *d_RetVal, fVector d_Z, fVector d_X, fVector d_Y, ui size );
float VFcu_subV_sumabs( fVector h_Z, fVector h_X, fVector h_Y, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_subV_sumabs( var h_RetVal:Single; d_Z, d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cusdVF_subV_sumabs( d_RetVal:PSingle; d_Z, d_X, d_Y:fVector; size:UIntSize ): IntBool;
DescriptionZi = Xi - Yi
sumabs = Sum(| Zi |)

This function saturates infinities into HUGE_VAL and treats input values of ±NAN as ±HUGE_VAL. The reasoning behind this is that V?_subV_sumabs finds its main use inside nonlinear fitting routines. If the fitting routine tries a bad parameter set, you want it to get the feedback that the guess was far off; you do not want it to be punished by an exception or programme crash.

Error handlingnone
Return valuesumabs of the difference of the two vectors
See alsoVF_subV,   VF_sumdevV,   VF_subV_ssq,   VF_subV_chi2,   chapter 13 of MATRIX.HTM

 

VF_sub2VVD_sub2VVE_sub2V
FunctionSubtract two vectors simultaneously from one vector
Syntax C/C++#include <VFmath.h>
void VF_sub2V( fVector Z, fVector X, fVector Y1, fVector Y2, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::sub2V( const vector<T>& X, const vector<T>& Y1, const vector<T>& Y2 );
Pascal/Delphiuses VFmath;
procedure VF_sub2V( Z, X, Y1, Y2:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_sub2V( fVector d_Z, fVector d_X, fVector d_Y1, fVector d_Y2, ui size );
void VFcu_sub2V( fVector h_Z, fVector h_X, fVector h_Y1, fVector h_Y2, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_sub2V( d_Z, d_X, d_Y1, d_Y2:fVector; size:UIntSize ): IntBool;
procedure VFcu_sub2V( h_Z, h_X, h_Y1, h_Y2:fVector; size:UIntSize );
DescriptionZi = Xi - Y1i - Y2i
Error handlingnone
Return valuenone
See alsoVF_subV,   VF_add2V

 

VF_subvectorVD_subvectorVE_subvector
VCF_subvectorVCD_subvectorVCE_subvector
VPF_subvectorVPD_subvectorVPE_subvector
VI_subvectorVBI_subvectorVSI_subvectorVLI_subvectorVQI_subvector 
VU_subvectorVUB_subvectorVUS_subvectorVUL_subvectorVUQ_subvectorVUI_subvector
FunctionExtract a sub-vector from the input vector
Syntax C/C++#include <VFstd.h>
void VF_subvector( fVector Y, ui subsize, fVector X, int samp );
C++ VecObj#include <OptiVec.h>
void vector<T>::subvector( const vector<T>& X, int samp, ui start=0 );
Pascal/Delphiuses VFstd;
procedure VF_subvector( Y:fVector; sizey:UIntSize; X:fVector; samp:Integer );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_subvector( fVector d_Y, ui subsize, fVector d_X, int samp );
void VFcu_subvector( fVector h_Y, ui subsize, fVector h_X, int samp );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_subvector( d_Y:fVector; sizey:UIntSize; d_X:fVector; samp:Integer ): IntBool;
procedure VFcu_subvector( h_Y:fVector; sizey:UIntSize; h_X:fVector; samp:Integer );
DescriptionYi = Xi*samp
A sub-vector Y is extracted from X with a sampling interval samp. This means that every samp'th element is taken, up to a total of subsize elements, starting with the zero'th element of X. Since X may be an expression like XX+1000 (C/C++) or VF_Pelement( XX, 1000 ) (Pascal/Delphi), samp does not always need to be positive, but may also take on negative values (or the trivial value of 0). X and Y have to be distinct. Instead of using a samp of 0, 1, or −1, one should use VF_equC,   VF_equV, or VF_rev, respectively.
The VecObj version is called with an additional argument start, denoting the element of X to start with. This is necessary to avoid input expressions like XX+1000, which are possible only with pointers, but would be mis-interpreted as the operator + in the class-based object-oriented interface.
Error handlingnone
Return valuenone
See alsoVF_indpick,   VF_CtoRe

 

VF_subvector_...VD_subvector_...VE_subvector_...
VCF_subvector_...VCD_subvector_...VCE_subvector_...
VPF_subvector_...VPD_subvector_...VPE_subvector_...
 ..._addC..._addV
 ..._divC..._divV
 ..._divrC..._divrV
 ..._mulC..._mulV
 ..._subC..._subV
 ..._subrC..._subrV
FunctionArithmetic functions working on a sub-set of elements within a vector of one of the floating-point data types.
Syntax C/C++#include <VFmath.h>
void VF_subvector_addC( fVector Y, ui subsize, unsigned samp, float C );
void VF_subvector_addV( fVector Y, ui subsize, unsigned samp, fVector X );

    (similarly all other functions of this family)
C++ VecObj#include <OptiVec.h>
void vector<T>::subvector_addC( unsigned samp, const T& C );
void vector<T>::subvector_addV( unsigned samp, const vector<T>& X );
Pascal/Delphiuses VFmath;
procedure VF_subvector_addC( Y:fVector; subsiz:UIntSize; samp:UIntSize; C:Single );
procedure VF_subvector_addV( Y:fVector; subsiz:UIntSize; samp:UIntSize; X:fVector );

    (similarly all other functions of this family)
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_subvector_addC( fVector d_Y, ui subsize, unsigned samp, float C );
int cusdVF_subvector_addC( fVector d_Y, ui subsize, unsigned samp, float *d_C );
int cudaVF_subvector_addV( fVector d_Y, ui subsize, unsigned samp, fVector X );
void VFcu_subvector_addC( fVector h_Y, ui subsize, unsigned samp, float C );
void VFcu_subvector_addV( fVector h_Y, ui subsize, unsigned samp, fVector X );

    (similarly all other functions of this family)
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_subvector_addC( d_Y:fVector; subsiz:UIntSize; samp:UIntSize; C:Single );
function cusdVF_subvector_addC( d_Y:fVector; subsiz:UIntSize; samp:UIntSize; d_C:PSingle );
function cudaVF_subvector_addV( d_Y:fVector; subsiz:UIntSize; samp:UIntSize; X:fVector );
procedure VFcu_subvector_addC( h_Y:fVector; subsiz:UIntSize; samp:UIntSize; C:Single );
procedure VFcu_subvector_addV( h_Y:fVector; subsiz:UIntSize; samp:UIntSize; X:fVector );

    (similarly all other functions of this family)
Description
..._addC:Yi*samp += C,i=0,...subsize−1
..._addV:Yi*samp += Xi,i=0,...subsize−1
..._subC:Yi*samp -= C,i=0,...subsize−1
..._subV:Yi*samp -= Xi,i=0,...subsize−1
..._subrC:Yi*samp = C - Yi*samp,i=0,...subsize−1
..._subrV:  Yi*samp = Xi- Yi*samp,  i=0,...subsize−1
..._mulC:Yi*samp *= C,i=0,...subsize−1
..._mulV:Yi*samp *= Xi,i=0,...subsize−1
..._divC:Yi*samp /= C,i=0,...subsize−1
..._divV:Yi*samp /= Xi,i=0,...subsize−1
..._divrC:Yi*samp = C / Yi*samp,i=0,...subsize−1
..._divrV:Yi*samp = Xi / Yi*samp,i=0,...subsize−1
 
Polar complex versions:
only multiplication and division are present: ...mulC,  ...mulV,  ...divC,  ...divV,  ...divrC, and ...divrV.

The operation indicated in the suffix of the function name is perfomed on a sub-set of the elements of a vector. The sampling interval is denoted by samp: every samp'th element is taken, up to a total of subsize, starting with the zero'th one (that means, subsize is not the total size of the vector, but rather the size of the sub-set, i.e. the number of elements for which the function is performed). Note that all operations are performed in place, i.e., the input vector itself is changed.
For similar functions not included in the above list, the necessary sequence of calls is similar to the following example (which shows how to calculate the sinc function of the zero'th and then every tenth element of X, assuming that size is an integer multiple of 10):
VF_subvector( Y, size/10, 10, X );
VF_sinc( Y, Y, size/10 );
VF_subvector_equV( X, size/10, 10, Y );

(However, in such cases, you would sometimes prefer the classic style of a loop with the loop-increment set to 10. Only if the desired function is not available in the math library of your compiler, the effort of copying back and forth into the dummy vector Y will pay off.)

Error handlingnone
Return valuenone
See alsoVF_subvector,   VF_subvector_equC,   VF_subvector_equV,   VF_addC

 

VF_subvector_...VD_subvector_...VE_subvector_...
VCF_subvector_...VCD_subvector_...VCE_subvector_...
VPF_subvector_...VPD_subvector_...VPE_subvector_...
VI_subvector_...VBI_subvector_...VSI_subvector_...
VLI_subvector_...VQI_subvector_...
VU_subvector_...VUB_subvector_...VUS_subvector_...
VUL_subvector_...VUQ_subvector_...VUI_subvector_...
 ..._equC..._equV
FunctionInitialize a sub-set of elements within a vector either with a constant value or with values stored as the elements of another vector.
Syntax C/C++#include <VFstd.h>
void VF_subvector_equC( fVector Y, ui subsize, unsigned samp, float C );
void VF_subvector_equV( fVector Y, ui subsize, unsigned samp, fVector X );

    (similarly all other functions of this family)
C++ VecObj#include <OptiVec.h>
void vector<T>::subvector_equC( unsigned samp, const T& C );
void vector<T>::subvector_equV( unsigned samp, const vector<T>& X );
Pascal/Delphiuses VFstd;
procedure VF_subvector_equC( Y:fVector; subsz:UIntSize; samp:UIntSize; C:Single );
procedure VF_subvector_equV( Y:fVector; subsz:UIntSize; samp:UIntSize; X:fVector );

    (similarly all other functions of this family)
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_subvector_equC( fVector d_Y, ui subsize, unsigned samp, float C );
int cusdVF_subvector_equC( fVector d_Y, ui subsize, unsigned samp, float *d_C );
int cudaVF_subvector_equV( fVector d_Y, ui subsize, unsigned samp, fVector X );
void VFcu_subvector_equC( fVector h_Y, ui subsize, unsigned samp, float C );
void VFcu_subvector_equV( fVector h_Y, ui subsize, unsigned samp, fVector X );

    (similarly all other functions of this family)
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_subvector_equC( d_Y:fVector; subsiz:UIntSize; samp:UIntSize; C:Single );
function cusdVF_subvector_equC( d_Y:fVector; subsiz:UIntSize; samp:UIntSize; d_C:PSingle );
function cudaVF_subvector_equV( d_Y:fVector; subsiz:UIntSize; samp:UIntSize; X:fVector );
procedure VFcu_subvector_equC( h_Y:fVector; subsiz:UIntSize; samp:UIntSize; C:Single );
procedure VFcu_subvector_equV( h_Y:fVector; subsiz:UIntSize; samp:UIntSize; X:fVector );

    (similarly all other functions of this family)
Description
..._equC:  Yi*samp = C,i=0,...subsize−1
..._equV:Yi*samp = Xi,  i=0,...subsize−1
 
A sub-set of the elements of a vector is overwritten according to the sampling interval samp: every samp'th element is initialized either with the constant C, or with the value specified as an element of the vector X. A total of subsize elements is initialized, starting with the zeroth one (that means, subsize is not the total size of the vector, but rather the size of the sub-set). VF_subvector_equV is the exact reverse of VF_subvector.
Error handlingnone
Return valuenone
See alsoVF_subvector,   VF_equC,   VF_equV,   VF_subvector_addC

 

VF_sumVD_sumVE_sum
VCF_sumVCD_sumVCE_sum
VI_sumVBI_sumVSI_sumVLI_sumVQI_sum 
VU_sumVUB_sumVUS_sumVUL_sumVUQ_sumVUI_sum
FunctionSum up all the elements of a vector.
Syntax C/C++#include <VFstd.h>
float VF_sum( fVector X, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::sum();
Pascal/Delphiuses VFstd;
function VF_sum( X:fVector; size:UIntSize ): Single;
function VCF_sum( X:cfVector; size:UIntSize ):fComplex;

Alternative syntax for the complex types (obsolete, but still supported): procedure VCF_sum( var Sum:fComplex; X:cfVector; size:UIntSize);
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_sum( float *h_RetVal, fVector d_X, ui size );
int cusdVF_sum( float *d_RetVal, fVector d_X, ui size );
float VFcu_sum( fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_sum( var h_RetVal:Single; d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_sum( d_RetVal:PSingle; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_sum( h_X:fVector; size:UIntSize ): Single;
Descriptionsum = sum( Xi )
The sum over all elements of a vector is calculated.
Error handlingnone (but be careful: this function may easily overflow!)
Return valuesum of the vector elements (except complex versions in Pascal/Delphi).
See alsoVF_runsum,   VI_fsum,   VF_prod,   VF_ssq,   VF_ssqdevC,   VF_mean

 

VF_sumabsVD_sumabsVE_sumabs
FunctionSum up the absolute values of all the elements of a vector.
Syntax C/C++#include <VFstd.h>
float VF_sumabs( fVector X, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::sumabs();
Pascal/Delphiuses VFstd;
function VF_sumabs( X:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_sumabs( float *h_RetVal, fVector d_X, ui size );
int cusdVF_sumabs( float *d_RetVal, fVector d_X, ui size );
float VFcu_sumabs( fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_sumabs( var h_RetVal:Single; d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_sumabs( d_RetVal:PSingle; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_sumabs( h_X:fVector; size:UIntSize ): Single;
Descriptionsumabs = sum(| Xi |)
Error handlingnone (but be careful: this function may easily overflow!)
Return valuesum of the absolute values of all vector elements.
See alsoVF_sum,   VF_meanabs

 

VF_sumdevCVD_sumdevCVE_sumdevC
FunctionSum of the absolute deviations from a preset value.
Syntax C/C++#include <VFstd.h>
float VF_sumdevC( fVector X, ui size, float C );
C++ VecObj#include <OptiVec.h>
T vector<T>::sumdevC( const T& C );
Pascal/Delphiuses VFstd;
function VF_sumdevC( X:fVector; size:UIntSize; C:Single ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_sumdevC( float *h_RetVal, fVector d_X, ui size, float C );
int cusdVF_sumdevC( float *d_RetVal, fVector d_X, ui size, float *d_C );
float VFcu_sumdevC( fVector h_X, ui size, float C );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_sumdevC( var h_RetVal:Single; d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_sumdevC( d_RetVal:PSingle; d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
function VFcu_sumdevC( h_X:fVector; size:UIntSize; C:Single ): Single;
DescriptionsumdevC = sum( |Xi - C| )
Error handlingnone
Return valuesum of the absolute deviations.
See alsoVF_ssqdevC,   VF_sumdevV,   VF_avdevC

 

VF_sumdevVVD_sumdevVVE_sumdevV
VF_sumdevVwSaturationVD_sumdevVwSaturationVE_sumdevVwSaturation
FunctionSum of the absolute deviations of the elements of one vector from the corresponding elements of another
Syntax C/C++#include <VFstd.h>
float VF_sumdevV( fVector X, fVector Y, ui size );
float VF_sumdevVwSaturation( fVector X, fVector Y, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::sumdevV( const vector<T>& Y );
T vector<T>::sumdevVwSaturation( const vector<T>& Y );
Pascal/Delphiuses VFstd;
function VF_sumdevV( X, Y:fVector; size:UIntSize ): Single;
function VF_sumdevVwSaturation( X, Y:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_sumdevV( float *h_RetVal, fVector X, fVector Y, ui size );
int cusdVF_sumdevV( float *d_RetVal, fVector X, fVector Y, ui size );
float VFcu_sumdevV( fVector h_X, fVector h_Y, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_sumdevV( var h_RetVal:Single; d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cusdVF_sumdevV( d_RetVal:PSingle; d_X, d_Y:fVector; size:UIntSize ): IntBool;
function VFcu_sumdevV( h_X, h_Y:fVector; size:UIntSize ): Single;
DescriptionsumdevV = sum( |Xi - Yi| )

V?_sumdevVwSaturation is almost identical to V?_sumdevV, except for the treatment of infinities and NAN values. While V?_sumdevV may overflow to INF and will return NAN, if any input element is a NAN, V?_sumdevVwSaturation will saturate possible overflow into HUGE_VAL and treats input values of ±NAN as ±HUGE_VAL.

Error handlingnone
Return valuesum of the absolute deviations.
See alsoVF_sum,   VF_sumdevC,   VF_avdevV,   VF_ssqdevV

 

cudaV_synchronize
FunctionWait until any active tasks of the current workspace are finished
Syntax C/C++#include <cudaVecLib.h>
void cudaV_synchronize( void );
Delphiuses VecLib;
procedure cudaV_synchronize;
DescriptionAs described in Chapter 4, the functions with the prefixes cudaV?_ and cusdV?_ return control to the calling function before actually finishing their tasks. This makes parallel execution of host and device functions and concurrent execution of several cudaV?_ functions on the device possible. However, whenever the result of one function call is needed for transfer to host memory, or for a call to a cudaV?_ function with a different workspace, calls to cudaV_synchronize have to be inserted in order to ensure proper synchronization.
Return valuenone
See alsoCudaOptiVec.htm - Chapter 4. Distinguishing OptiVec Functions for Host and for Device Memory

 

VF_tanVD_tanVE_tan
VCF_tanVCD_tanVCE_tan
VFx_tanVDx_tanVEx_tan
VCFx_tanVCDx_tanVCEx_tan
FunctionTangent function
Syntax C/C++#include <VFmath.h>
int VF_tan( fVector Y, fVector X, ui size );
int VFx_tan( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::tan( const vector<T>& X );
int vector<T>::x_tan( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_tan( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_tan( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_tan( fVector d_Y, fVector d_X, ui size );
int cudaVFx_tan( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_tan( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_tan( fVector h_Y, fVector h_X, ui size );
int VFxcu_tan( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_tan( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_tan( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_tan( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_tan( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_tan( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = tan ( Xi )
expanded versions: Yi = C * tan( A*Xi+B )
For large values of Xi, round-off error becomes appreciable; if the Xi values are representable as rational multiples of p, it is better to use VF_tanrpi than VF_tan.
Error handlingSING and OVERFLOW errors (for arguments very close to p/2) lead to a default result of ±HUGE_VAL. Precision errors lead to a default result of 0.0.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_tan2,   VF_tanrpi,   VF_sin,   VF_tanh,   VF_atan,   VF_atan2,   tan

 

VF_tan2VD_tan2VE_tan2
VFx_tan2VDx_tan2VEx_tan2
FunctionSquare of the tangent function
Syntax C/C++#include <VFmath.h>
int VF_tan2( fVector Y, fVector X, ui size );
int VFx_tan2( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::tan2( const vector<T>& X );
int vector<T>::x_tan2( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_tan2( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_tan2( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_tan2( fVector d_Y, fVector d_X, ui size );
int cudaVFx_tan2( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_tan2( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_tan2( fVector h_Y, fVector h_X, ui size );
int VFxcu_tan2( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_tan2( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_tan2( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_tan2( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_tan2( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_tan2( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions: Yi = tan2( Xi )
expanded versions: Yi = C * tan2( A*Xi+B )
Calculating the squared trigonometric functions directly is faster and sometimes more accurate than first calculating the trigonometric function itself and squaring it afterwards.
Error handlingSING and OVERFLOW errors (for arguments close to p/2) lead to a default result of ±HUGE_VAL. Precision errors lead to a default result of 0.0.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_tan,   VF_tanrpi

 

VF_tanhVD_tanhVE_tanh
VCF_tanhVCD_tanhVCE_tanh
VFx_tanhVDx_tanhVEx_tanh
VCFx_tanhVCDx_tanhVCEx_tanh
FunctionHyperbolic tangent function
Syntax C/C++#include <VFmath.h>
int VF_tanh( fVector Y, fVector X, ui size );
int VFx_tanh( fVector Y, fVector X, ui size, float A, float B, float C );
C++ VecObj#include <OptiVec.h>
int vector<T>::tanh( const vector<T>& X );
int vector<T>::x_tanh( const vector<T>& X, const T& A, const T& B, const T& C );
Pascal/Delphiuses VFmath;
function VF_tanh( Y, X:fVector; size:UIntSize ): IntBool;
function VFx_tanh( Y, X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_tanh( fVector d_Y, fVector d_X, ui size );
int cudaVFx_tanh( fVector d_Y, fVector d_X, ui size, float A, float B, float C );
int cusdVFx_tanh( fVector d_Y, fVector d_X, ui size, float *d_A, float *d_B, float *d_C );
int VFcu_tanh( fVector h_Y, fVector h_X, ui size );
int VFxcu_tanh( fVector h_Y, fVector h_X, ui size, float A, float B, float C );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_tanh( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVFx_tanh( d_Y, d_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
function cusdVFx_tanh( d_Y, d_X:fVector; size:UIntSize; d_A, d_B, d_C:PSingle ): IntBool;
function VFcu_tanh( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFxcu_tanh( h_Y, h_X:fVector; size:UIntSize; A, B, C:Single ): IntBool;
Descriptionsimple versions:
Yi =  tanh( Xi )
     =  exp( Xi ) - exp( −Xi )
exp( Xi ) + exp( −Xi )
 
expanded versions:
Yi = C * tanh( A*Xi+B )
Error handlingThese functions should be error-proof.
Return valuealways FALSE (0).
See alsoVF_sinh,   VF_exp,   tanh

 

VF_tanrpiVD_tanrpiVE_tanrpi
VF_tanrpi2VD_tanrpi2VE_tanrpi2
VF_tanrpi3VD_tanrpi3VE_tanrpi3
FunctionTangent function of fractional multiples of p
Syntax C/C++#include <VFmath.h>
int VF_tanrpi( fVector Y, iVector P, ui size, int q );
int VF_tanrpi2( fVector Y, iVector P, ui size, int q );
int VF_tanrpi3( fVector Y, iVector P, ui size, int q );
C++ VecObj#include <OptiVec.h>
int vector<T>::tanrpi( const vector<int>& P, int q );
int vector<T>::tanrpi2( const vector<int>& P, int q );
int vector<T>::tanrpi3( const vector<int>& P, int q );
Pascal/Delphiuses VFmath;
function VF_tanrpi( Y:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
function VF_tanrpi2( Y:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
function VF_tanrpi3( Y:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_tanrpi( fVector d_Y, iVector d_P, ui size, int q );
int cudaVF_tanrpi2( fVector d_Y, iVector d_P, ui size, int q );
int cudaVF_tanrpi3( fVector d_Y, iVector d_P, ui size, int q );
int VFcu_tanrpi( fVector h_Y, iVector h_P, ui size, int q );
int VFcu_tanrpi2( fVector h_Y, iVector h_P, ui size, int q );
int VFcu_tanrpi3( fVector h_Y, iVector h_P, ui size, int q );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_tanrpi( d_Y:fVector; d_P:iVector; size:UIntSize; q:Integer ): IntBool;
function cudaVF_tanrpi2( d_Y:fVector; d_P:iVector; size:UIntSize; q:Integer ): IntBool;
function cudaVF_tanrpi3( d_Y:fVector; d_P:iVector; size:UIntSize; q:Integer ): IntBool;
function VFcu_tanrpi( h_Y:fVector; h_P:iVector; size:UIntSize; q:Integer ): IntBool;
function VFcu_tanrpi2( h_Y:fVector; h_P:iVector; size:UIntSize; q:Integer ): IntBool;
function VFcu_tanrpi3( h_Y:fVector; h_P:iVector; size:UIntSize; q:Integer ): IntBool;
DescriptionYi = tan( (Pi / q) * p )
The tangent of fractional multiples of p is calculated. There are three versions: VF_tanrpi is for general use with any arbitrary denominator q. If q is a power of 2, VF_tanrpi2 should be used which is a highly optimized version using a look-up table. If q is a multiple of 3, VF_tanrpi3 should be used. VF_tanrpi2 and VF_tanrpi3 work also with q values they are not optimized for; in this case, however, memory space is wasted for the then useless tables.
Error handlingSING errors occur if Pi / q is an odd multiple of 1/2; the default result is 0.0 (which is the mean of +HUGE_VAL and -HUGE_VAL).
q must be non-zero; this is, however, not tested for.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero).
See alsoVF_tan,   tan

 

VF_tantab2VD_tantab2VE_tantab2
VF_tantab3VD_tantab3VE_tantab3
 Table of tangent values for arguments between 0 and p/2.
Syntax C/C++#include <xmath.h>
extern float    VF_tantab2[ VF_tabsz2+1 ];
extern double   VD_tantab2[ VD_tabsz2+1 ];
extern extended VE_tantab2[ VE_tabsz2+1 ];
extern float    VF_tantab3[ VF_tabsz3+1 ];
extern double   VD_tantab3[ VD_tabsz3+1 ];
extern extended VE_tantab3[ VE_tabsz3+1 ];
Pascal/Delphiuses FTANTAB2, DTANTAB2, ETANTAB2, FTANTAB3, DTANTAB3, ETANTAB3;
VF_tantab2: array[0..VF_tabsz2] of Single;
VD_tantab2: array[0..VD_tabsz2] of Double;
VE_tantab2: array[0..VE_tabsz2] of Extended;
VF_tantab3: array[0..VF_tabsz3] of Single;
VD_tantab3: array[0..VD_tabsz3] of Double;
VE_tantab3: array[0..VE_tabsz3] of Extended;
DescriptionVF_tantab2[ i ] = tan( i/(2*VF_tabsz2) * p ),    i=0,...,VF_tabsz2−1
VF_tantab3[ i ] = tan( i/(2*VF_tabsz3) * p ),    i=0,...,VF_tabsz3−1
VF_tantab2[ VF_tabsz2 ] = VF_tantab3[ VF_tabsz3 ] = 0;

These look-up tables of tangent values for arguments between 0 and p/2 are used by VF_tanrpi2 and the other functions of that family and are also available for other purposes. Since the tangent of p/2 is not defined, zero is stored at its place.
C/C++: The symbols VF_tabsz2 etc., denoting the size of the tables, are defined in <xmath.h>.
Pascal/Delphi: The symbols VF_tabsz2 etc. are defined in the same units as the tables themselves.
FreePascal/Lazarus: These tables are not available for FreePascal/Lazarus.

See alsoVF_tanrpi2,   VF_sintab2,   VF_cosectab2

 

VF_truncVD_truncVE_trunc
VF_trunctoIVD_trunctoIVE_trunctoI
VF_trunctoBIVD_trunctoBIVE_trunctoBI
VF_trunctoSIVD_trunctoSIVE_trunctoSI
VF_trunctoLIVD_trunctoLIVE_trunctoLI
VF_trunctoQIVD_trunctoQIVE_trunctoQI
VF_trunctoUVD_trunctoUVE_trunctoU
VF_trunctoUBVD_trunctoUBVE_trunctoUB
VF_trunctoUSVD_trunctoUSVE_trunctoUS
VF_trunctoULVD_trunctoULVE_trunctoUL
VF_trunctoUQVD_trunctoUQVE_trunctoUQ
VF_trunctoUIVD_trunctoUIVE_trunctoUI
FunctionRounding by "truncating" toward zero.
Syntax C/C++#include <VFmath.h>
int VF_trunc( fVector Y, fVector X, ui size );
int VF_trunctoI( iVector Y, fVector X, ui size );
int VF_trunctoU( uVector Y, fVector X, ui size );

    (similarly all other functions of this family)
C++ VecObj#include <OptiVec.h>
int vector<T>::trunc( const vector<T>& X );
int vector<int>::trunctoI( const vector<T>& X );
int vector<unsigned>::trunctoU( const vector<T>& X );
Pascal/Delphiuses VFmath;
function VF_trunc( Y, X:fVector; size:UIntSize ): IntBool;
function VF_trunctoI( Y:iVector; X:fVector; size:UIntSize ): IntBool;
function VF_trunctoLI( Y:liVector; X:fVector; size:UIntSize ): IntBool;

    (similarly all other functions of this family)
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_trunc( fVector d_Y, fVector d_X, ui size );
int cudaVF_trunctoI( iVector d_Y, fVector d_X, ui size );
int VFcu_trunc( fVector h_Y, fVector h_X, ui size );
int VFcu_trunctoI( iVector h_Y, fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_trunc( d_Y, d_X:fVector; size:UIntSize ): IntBool;
function cudaVF_trunctoI( d_Y:iVector; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_trunc( h_Y, h_X:fVector; size:UIntSize ): IntBool;
function VFcu_trunctoI( h_Y:iVector; h_X:fVector; size:UIntSize ): IntBool;
DescriptionThese functions are identical to those of the VF_chop family. They have been defined in order to maintain consistency with the Pascal/Delphi function trunc. For details, see VF_chop.

 

V_UtoFV_UtoDV_UtoE
V_UBtoFV_UBtoDV_UBtoE
V_UStoFV_UStoDV_UStoE
V_ULtoFV_ULtoDV_ULtoE
V_UQtoFV_UQtoDV_UQtoE
V_UItoFV_UItoDV_UItoE
FunctionData type interconversions. See V_ItoF!

 

VF_varianceCVD_varianceCVE_varianceC
FunctionVariance of a one-dimensional distribution with respect to a pre-set value
Syntax C/C++#include <VFstd.h>
float VF_varianceC( fVector X, ui size, float C );
C++ VecObj#include <OptiVec.h>
T vector<T>::varianceC( const T& C );
Pascal/Delphiuses VFstd;
function VF_varianceC( X:fVector; size:UIntSize; C:Single ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_varianceC( float *h_RetVal, fVector d_X, ui size, float C );
int cusdVF_varianceC( float *d_RetVal, fVector d_X, ui size, float *d_C );
float VFcu_varianceC( fVector h_X, ui size, float C );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_varianceC( var h_RetVal:Single; d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_varianceC( d_RetVal:PSingle; d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
function VFcu_varianceC( h_X:fVector; size:UIntSize; C:Single ): Single;
Descriptionvar = (1 / size) * sum( (Xi - C)2 )
Error handlingnone
Return valueThe variance is returned.
See alsoVF_mean,   VF_varianceV,   VF_ssq,   VF_ssqdevC,   VF_linregress

 

VF_varianceCwWVD_varianceCwWVE_varianceCwW
Function"Variance with weights" of a one-dimensional distribution with respect to a pre-set value.
Syntax C/C++#include <VFstd.h>
float VF_varianceCwW( fVector X, fVector Wt, ui size, float C );
C++ VecObj#include <OptiVec.h>
T vector<T>::varianceCwW( const vector<T>& Wt, const T& C );
Pascal/Delphiuses VFstd;
function VF_varianceCwW( X, Wt:fVector; size:UIntSize; C:Single ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_varianceCwW( float *h_RetVal, fVector d_X, fVector d_Wt, ui size, float C );
int cusdVF_varianceCwW( float *d_RetVal, fVector d_X, fVector d_Wt, ui size, float *d_C );
float VFcu_varianceCwW( fVector h_X, fVector h_Wt, ui size, float C );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_varianceCwW( var h_RetVal:Single; d_X, d_Wt:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_varianceCwW( d_RetVal:PSingle; d_X, d_Wt:fVector; size:UIntSize; d_C:PSingle ): IntBool;
function VFcu_varianceCwW( h_X, h_Wt:fVector; size:UIntSize; C:Single ): Single;
Descriptionvar = (1 / sum( Wti )) * sum( Wti * (Xi - C)2 )
The weights need not be normalized.
Error handlingnone
Return valuevariance of the distribution.
See alsoVF_meanwW,   VF_varianceC,   VF_varianceVwW,   VF_linregress

 

VF_varianceVVD_varianceVVE_varianceV
FunctionVariance between two one-dimensional distributions.
Syntax C/C++#include <VFstd.h>
float VF_varianceV( fVector X, fVector Y, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::varianceV( const vector<T>& Y );
Pascal/Delphiuses VFstd;
function VF_varianceV( X, Y:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_varianceV( float *h_RetVal, fVector X, fVector Y, ui size );
int cusdVF_varianceV( float *d_RetVal, fVector X, fVector Y, ui size );
float VFcu_varianceV( fVector h_X, fVector h_Y, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_varianceV( var h_RetVal:Single; d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cusdVF_varianceV( d_RetVal:PSingle; d_X, d_Y:fVector; size:UIntSize ): IntBool;
function VFcu_varianceV( h_X, h_Y:fVector; size:UIntSize ): Single;
Descriptionvar = (1 / size) * sum( (Xi - Yi)2 )
Error handlingnone
Return valueThe variance is returned.
See alsoVF_mean,   VF_varianceC,   VF_ssq,   VF_ssqdevV,   VF_linregress

 

VF_varianceVwWVD_varianceVwWVE_varianceVwW
Function"Variance with weights" between two one-dimensional distributions.
Syntax C/C++#include <VFstd.h>
float VF_varianceVwW( fVector X, fVector Y, fVector Wt, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::varianceVwW( const vector<T>& Y, const vector<T>& Wt );
Pascal/Delphiuses VFstd;
function VF_varianceVwW( X, Y, Wt:fVector; size:UIntSize ):
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_varianceVwW( float *h_RetVal, fVector X, fVector Y, fVector d_Wt, ui size );
int cusdVF_varianceVwW( float *d_RetVal, fVector X, fVector Y, fVector d_Wt, ui size );
float VFcu_varianceVwW( fVector h_X, fVector h_Y, fVector h_Wt, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_varianceVwW( var h_RetVal:Single; d_X, d_Y, d_Wt:fVector; size:UIntSize ): IntBool;
function cusdVF_varianceVwW( d_RetVal:PSingle; d_X, d_Y, d_Wt:fVector; size:UIntSize ): IntBool;
function VFcu_varianceVwW( h_X, h_Y, h_Wt:fVector; size:UIntSize ): Single;
Descriptionvar = (1 / sum(Wti)) * sum( Wti * (Xi - Yi)2 )
The weights need not be normalized.
Error handlingnone
Return valueweighted variance
See alsoVF_meanwW,   VF_chi2,   VF_varianceV,   VF_varianceCwW,   VF_linregress

 

VF_vectorVD_vectorVE_vector
VCF_vectorVCD_vectorVCE_vector
VPF_vectorVPD_vectorVPE_vector
VI_vectorVBI_vectorVSI_vectorVLI_vectorVQI_vector 
VU_vectorVUB_vectorVUS_vectorVUL_vectorVUQ_vectorVUI_vector
FunctionMemory allocation for a vector
Syntax C/C++#include <VFstd.h>
fVector VF_vector( ui size );
Pascal/Delphiuses VecLib;
function VF_vector( size:UIntSize ): fVector;
CUDA function C/C++#include <cudaVFstd.h>
fVector cudaVF_vector( ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_vector( size:UIntSize ): fVector;
DescriptionBased 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 handlingIf 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 valuePointer to the allocated memory
See alsomalloc,   calloc,   cudaVF_pinnedVector

 

VF_vector0VD_vector0VE_vector0
VCF_vector0VCD_vector0VCE_vector0
VPF_vector0VPD_vector0VPE_vector0
VI_vector0VBI_vector0VSI_vector0VLI_vector0VQI_vector0 
VU_vector0VUB_vector0VUS_vector0VUL_vector0VUQ_vector0VUI_vector0
FunctionMemory allocation for a vector and initialization of all elements with 0
Syntax C/C++#include <VFstd.h>
fVector VF_vector0( ui size );
Pascal/Delphiuses VecLib;
function VF_vector0( size:UIntSize ): fVector;
CUDA function C/C++#include <cudaVFstd.h>
fVector cudaVF_vector0( ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_vector0( size:UIntSize ): fVector;
DescriptionThe functions of this family are almost identical to those of the VF_vector family; in addition to allocating memory, they initialize all elements with 0. (Calls to VF_vector and VF_vector0 may be mixed; they use the same tables to keep track of the handles and pointers). For further information, see VF_vector.
Do not use this function in connection with the object-oriented interface. It has its own automated memory allocation procedure incorporated into the constructors, see chapter 3.
Error handlingIf there is not enough memory available, or if size is zero, an error message "Not enough memory" is displayed and the program aborted.
16-bit models (except HUGE):
If more than 64 kB of memory are requested, an error message "Vector > 64 kB not possible" 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 valueA pointer to the allocated memory is returned.
See alsomalloc,   calloc,   cudaVF_pinnedVector0

 

VF_visCVD_visCVE_visC
FunctionVisibility (or contrast) function of a vector with respect to a constant
Syntax C/C++#include <VFmath.h>
void VF_visC( fVector Y, fVector X, ui size, float C );
C++ VecObj#include <OptiVec.h>
void vector<T>::visC( const vector<T>& X, const T& C );
Pascal/Delphiuses VFmath;
procedure VF_visC( Y, X:fVector; size:UIntSize; C:Single );
CUDA function C/C++#include <cudaVFmath.h>
#include <cudaVDmath.h>
int cudaVF_visC( fVector d_Y, fVector d_X, ui size, float C );
int cusdVF_visC( fVector d_Y, fVector d_X, ui size, float *d_C );
void VFcu_visC( fVector d_Y, fVector d_X, ui size, float C );
CUDA function Pascal/Delphiuses VFmath, VDmath;
function cudaVF_visC( d_Y, d_X:fVector; size:UIntSize; C:Single ): IntBool;
function cusdVF_visC( d_Y, d_X:fVector; size:UIntSize; d_C:PSingle ): IntBool;
procedure VF_visC( Y, X:fVector; size:UIntSize; C:Single );
DescriptionYi = vis( Xi, C ) = (Xi - C) / (Xi + C)
These functions are generalizations of the "visibility" or "contrast" function used in optics, where the contrast between two intensities is defined as their difference divided by their sum.
For Xi=C, the visibility is defined as 0, even in the case of Xi=C=0.
Error handlingnone
Return valuenone
See alsoVF_redV,   VF_addC,   VF_subC,   VF_divC,   VF_visV

 

VF_visVVD_visVVE_visV
VFx_visVVDx_visVVEx_visV
FunctionVisibility function of one vector with respect to another
Syntax C/C++#include <VFmath.h>
void VF_visV( fVector Z, fVector X, fVector Y, ui size );
void VFx_visV( fVector Z, fVector X, fVector Y, ui size, float A, float B );
C++ VecObj#include <OptiVec.h>
void vector<T>::visV( const vector<T>& X, const vector<T>& Y );
void vector<T>::x_visV( const vector<T>& X, const vector<T>& Y, const T& A, const T& B );
Pascal/Delphiuses VFmath;
procedure VF_visV( Z, X, Y:fVector; size:UIntSize );
procedure VFx_visV( Z, X, Y:fVector; size:UIntSize; A, B:Single );
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_visV( fVector d_Z, fVector d_X, fVector d_Y,ui size );
int cudaVFx_visV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float A, float B );
int cusdVFx_visV( fVector d_Z, fVector d_X, fVector d_Y, ui size, float *d_A, float *d_B );
void VFcu_visV( fVector h_Z, fVector h_X, fVector h_Y,ui size );
void VFxcu_visV( fVector h_Z, fVector h_X, fVector h_Y, ui size, float A, float B );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_visV( d_Z, d_X, d_Y:fVector; size:UIntSize ): IntBool;
function cudaVFx_visV( d_Z, d_X, d_Y:fVector; size:UIntSize; A, B:Single ): IntBool;
function cusdVFx_visV( d_Z, d_X, d_Y:fVector; size:UIntSize; d_A, d_B:PSingle ): IntBool;
procedure VFcu_visV( h_Z, h_X, h_Y:fVector; size:UIntSize );
procedure VFxcu_visV( h_Z, h_X, h_Y:fVector; size:UIntSize; A, B:Single );
Descriptionsimple versions:
Zi = vis( Xi, Yi )
    = (Xi - Yi) / (Xi + Yi)
expanded versions:
Zi = vis( A*Xi+B, Yi )
For Xi=Yi, the visibility is defined as 0, even in the case of Xi=Yi=0.
Error handlingnone
Return valuenone
See alsoVF_visC,   VF_addV,   VF_subV,   VF_divV,   VF_redV

 

VF_WelchVD_WelchVE_Welch
Function"Welch" window for use in spectral analysis
Syntax C/C++#include <VFstd.h>
void VF_Welch( fVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::Welch();
Pascal/Delphiuses VFstd;
procedure VF_Welch( X:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_Welch( fVector d_X, ui size );
void VFcu_Welch( fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_Welch( d_X:fVector; size:UIntSize ): IntBool;
procedure VFcu_Welch( h_X:fVector; size:UIntSize );
DescriptionXi = 1 - ( (i - 0.5*(size - 1)) / (0.5*(size + 1)) )2
This function provides a window for power-spectrum estimation with Welch's method of overlapping segments, here implemented as VF_spectrum.
Error handlingnone
Return valuenone
See alsoVF_Parzen,   VF_Hann,   VF_spectrum

 

VF_writeVD_writeVE_write
VCF_writeVCD_writeVCE_write
VPF_writeVPD_writeVPE_write
VI_writeVBI_writeVSI_writeVLI_writeVQI_write 
VU_writeVUB_writeVUS_writeVUL_writeVUQ_writeVUI_write
FunctionWrite a vector in ASCII format to a stream.
Syntax C/C++#include <VFstd.h>
void VF_write( FILE *stream, fVector X, ui size );
C++ VecObj#include <OptiVec.h>
void vector<T>::write( FILE *stream );
Pascal/Delphiuses VFstd;
procedure VF_write( var Stream:Text; X:fVector; size:UIntSize );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_write( FILE *stream, fVector d_X, ui size );
int cudaVF_write_buf( FILE *stream, fVector d_X, ui size, fVector h_Wk );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_write( var Stream:Text; d_X:fVector; size:UIntSize ): IntBool;
function cudaVF_write_buf( var Stream:Text; d_X:fVector; size:UIntSize; h_Wk:fVector ): IntBool;
Descriptionsize elements of X are written to stream in ASCII format. By default, one element is written per line. To use these functions, stream must already be open for write operations in text format.

The number format and the separation of consecutive elements may be specified using VF_setWriteFormat (C/C++ only) and VF_setWriteSeparate, respectively. See these functions for details.

Storing data in ASCII format is useful if the data have to be readable by human eyes, or if they are to be exported into other programs which are not able to read machine-format numbers. If avoidable, these functions should not be used for the storage of intermediate results that later have again to be read in. Instead, the function pairs of the VF_store / VF_recall family are recommended for the following reasons: conversion into ASCII format is slow, may lead to round-off errors, and requires much more disk memory than storage in machine format.
 

CUDA versions only:cudaV?_write_buf takes a host vector h_Wk as additional argument. The latter serves as buffer memory and needs to be (at least) of the same size as X. By avoiding the need of cudaV?_write to allocate its own buffer memory, cudaV?_write_buf is slightly faster.
 
GCC Windows specific:In principle, the Windows port of GCC supports the 80-bit floating point type long double. However, the I/O routines rely on the runtime libraries of Visual C++, where 80-bit reals have disappeared a long time ago. This means that VE_write, VCE_write, and VPE_write work only with double precision and, more importantly, within double range. Input numbers outside double range are treated as ±DBL_MAX.
Error handlingnone
Return valuenone
See alsoVF_setWriteFormat,   VF_setWriteSeparate,   VF_nwrite,   VF_read,   VF_store,   VF_cprint,   VF_print,   fprintf

 

VF_xcorrVD_xcorrVE_xcorr
VFb_xcorrVDb_xcorrVEb_xcorr
FunctionCross-correlation function of two vectors.
Syntax C/C++#include <VFstd.h>
void VF_xcorr( fVector Z, fVector X, fVector Y, ui size );
void VFb_xcorr( fVector Z, fVector X, fVector Y, ui size, fVector Buf );
C++ VecObj#include <OptiVec.h>
void vector<T>::xcorr( const vector<T>& X, const vector<T>& Y );
void vector<T>::b_xcorr( const vector<T>& X, const vector<T>& Y, vector<T>& Buf );
Pascal/Delphiuses VFstd;
procedure VF_xcorr( Z, X, Y:fVector; size:UIntSize );
procedure VFb_xcorr( Z, X, Y:fVector; size:UIntSize; Buf:fVector );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_xcorr( fVector d_Z, fVector d_X, fVector d_Y, ui size );
void VFcu_xcorr( fVector h_Z, fVector h_X, fVector h_Y, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_xcorr( d_Z, d_X, d_Y:fVector; size:UIntSize ): IntBool;
procedure VFcu_xcorr( h_Z, h_X, h_Y:fVector; size:UIntSize );
DescriptionThe cross-correlation function (CCF) of X and Y is calculated and stored in Z in wrap-around order: Z0 to Zsize/2−1 contain the CCF for zero and positive lags. Beginning with the most negative lag in Zsize/2+1, the elements up to Zsize−1 contain the CCF for negative lags. Since this function assumes X to be periodic, the CCF for the most positive lag is identical to the CCF for the most negative lag. This element is stored as Zsize/2.
To get the CCF into normal order, you may call
VF_rotate( Z, Z, size, size/2 );
After that, the zero point is at the position size/2.

In case X is non-periodic, end effects should be avoided by the methods described in connection with VF_convolve.

Internally, VF_xcorr allocates and frees additional workspace memory. For repeated calls, this would be inefficient. In such a case, it is recommended to use VFb_xcorr instead. The size of Buf must be ≥ 3*size. Additionally, Buf must be 128-bit (P8) or 256-bit (P9) aligned. This usually means you can only take a vector allocated by the VF_vector family as Buf.

Error handlingIf size is not a power of 2, VF_FFT (on which VF_xcorr is based) complains "Size must be an integer power of 2" and the program is aborted.
Return valuenone
See alsoVF_FFT,   VF_xspectrum,   VF_coherence,   VF_convolve,   VF_autocorr

 

VI_xorVBI_xorVSI_xorVLI_xorVQI_xor 
VU_xorVUB_xorVUS_xorVUL_xorVUQ_xorVUI_xor
FunctionBit-wise "XOR" operation.
Syntax C/C++#include <VImath.h>
void VI_xor( iVector Y, iVector X, ui size, int C );
void VUL_xor( ulVector Y, ulVector X, ui size, unsigned long C );
C++ VecObj#include <OptiVec.h>
void vector<T>::xor( const vector<T>& X, const T& C );
Pascal/Delphiuses VImath;
procedure VI_xor( Y, X:iVector; size:UIntSize; C:Integer );
procedure VUL_xor( Y, X:ulVector; size:UIntSize; C:ULong );
CUDA function C/C++#include <cudaVImath.h>
int cudaVI_xor( iVector d_Y, iVector d_X, ui size, int C );
int cusdVI_xor( iVector d_Y, iVector d_X, ui size, int *d_C );
void VIcu_xor( iVector h_Y, iVector h_X, ui size, int C );
CUDA function Pascal/Delphiuses VImath;
function cudaVI_xor( d_Y, d_X:iVector; size:UIntSize; C:Integer ): IntBool;
function cusdVI_xor( d_Y, d_X:iVector; size:UIntSize; d_C:PInteger ): IntBool;
procedure VIcu_xor( h_Y, h_X:iVector; size:UIntSize; C:Integer );
DescriptionYi = (Xi) ^ C
The bit-wise "exclusive OR" operation is performed on each element Xi with the bit-mask given by C (i.e., a bit is 0 in Yi, if it was either 0 or 1 both in Xi and C simultaneously. It is 1 if Xi and C differed in this bit position).
Error handlingnone
Return valuenone
See alsoVI_not,   VI_and,   VI_or

 

VF_xprodVD_xprodVE_xprod
FunctionCross-product of two vectors.
Syntax C/C++#include <VFstd.h>
void VF_xprod( fVector Z, fVector X, fVector Y );
C++ VecObj#include <OptiVec.h>
void vector<T>::xprod( const vector<T>& X, const vector<T>& Y );
Pascal/Delphiuses VFstd;
procedure VF_xprod( Z, X, Y:fVector );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_xprod( fVector d_Z, fVector d_X, fVector d_Y );
void VFcu_xprod( fVector h_Z, fVector h_X, fVector h_Y );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_xprod( d_Z, d_X, d_Y:fVector ): IntBool;
procedure VF_xprod( h_Z, h_X, h_Y:fVector );
DescriptionZ = X x Y
The cross-product of X and Y is calculated. Since this operation is defined specifically for vectors representing three dimensions in the geometrical sense, there is no parameter "size" for this function. The number of elements is 3 for each of the participating vectors, implicitly.
Error handlingnone
Return valuenone
See alsoVF_scalprod,   VF_Euclid

 

VF_xspectrumVD_xspectrumVE_xspectrum
VF_xspectrumAbsVD_xspectrumAbsVE_xspectrumAbs
VFb_xspectrumVDb_xspectrumVEb_xspectrum
VFb_xspectrumAbsVDb_xspectrumAbsVEb_xspectrumAbs
FunctionCross Spectral Density (CSD) of two signals
Syntax C/C++#include <VFstd.h>
void VF_xspectrum( cfVector Spc, ui specsiz, fVector X, fVector Y, ui xsiz, fVector Win );
float VF_xspectrumAbs( fVector Spc, ui specsiz, fVector X, fVector Y, ui xsiz, fVector Win );
void VFb_xspectrum( cfVector Spc, ui specsiz, fVector X, fVector Y, ui xsiz, fVector Win, fVector Buf );
float VFb_xspectrumAbs( fVector Spc, ui specsiz, fVector X, fVector Y, ui xsiz, fVector Win, fVector Buf );
C++ VecObj#include <OptiVec.h>
void vector<complex<T>>::xspectrum( const vector<T>& X, const vector<T>& Y, const vector<T>& Win );
T vector<T>::xspectrumAbs( const vector<T>& X, const vector<T>& Y, const vector<T>& Win );
void vector<complex<T>>::b_xspectrum( const vector<T>& X, const vector<T>& Y, const vector<T>& Win, vector<T>& Buf );
T vector<T>::b_xspectrumAbs( const vector<T>& X, const vector<T>& Y, const vector<T>& Win, vector<T>& Buf );
Pascal/Delphiuses VFstd;
procedure VF_xspectrum( Spc:cfVector; specsiz:UIntSize; X,Y:fVector; xsiz:UIntSize; Win:fVector );
function VF_xspectrumAbs( Spc:fVector; specsiz:UIntSize; X,Y:fVector; xsiz:UIntSize; Win:fVector ): Single;
procedure VFb_xspectrum( Spc:cfVector; specsiz:UIntSize; X,Y:fVector; xsiz:UIntSize; Win, Buf:fVector );
function VFb_xspectrumAbs( Spc:fVector; specsiz:UIntSize; X,Y:fVector; xsiz:UIntSize; Win, Buf:fVector ): Single;
CUDA Function C/C++#include <cudaVFstd.h>
int cudaVF_xspectrum( cfVector d_Spc, ui specsiz, fVector d_X, fVector d_Y, ui xsiz, fVector d_Win );
void VFcu_xspectrum( cfVector h_Spc, ui specsiz, fVector h_X, fVector h_Y, ui xsiz, fVector h_Win );
int cudaVF_xspectrumAbs( float *h_csdfNyq, fVector d_Spc, ui specsiz, fVector d_X, fVector d_Y, ui xsiz, fVector d_Win );
int cusdVF_xspectrumAbs( float *d_csdfNyq, fVector d_Spc, ui specsiz, fVector d_X, fVector d_Y, ui xsiz, fVector d_Win );
float VFcu_xspectrumAbs( fVector h_Spc, ui specsiz, fVector h_X, fVector h_Y, ui xsiz, fVector h_Win );
CUDA Function Pascal/Delphiuses VFstd;
function cudaVF_xspectrum( d_Spc:cfVector; specsiz:UIntSize; d_X, d_Y:fVector; xsiz:UIntSize; d_Win:fVector ): IntBool;
procedure VFcu_xspectrum( h_Spc:fVector; specsiz:UIntSize; h_X, h_Y:fVector; xsiz:UIntSize; h_Win:fVector );
function cudaVF_xspectrumAbs( var h_csdfNyq:Single; d_Spc:fVector; specsiz:UIntSize; d_X, d_Y:fVector; xsiz:UIntSize; d_Win:fVector ): IntBool;
function cusdVF_xspectrumAbs( d_csdfNyq:PSingle; d_Spc:fVector; specsiz:UIntSize; d_X, d_Y:fVector; xsiz:UIntSize; d_Win:fVector ): IntBool;
function VFcu_xspectrumAbs( h_Spc:fVector; specsiz:UIntSize; h_X, h_Y:fVector; xsiz:UIntSize; h_Win:fVector ): Single;
DescriptionThe Cross Spectral Density CSD of the two data sets X and Y is calculated. It is defined as the product of the Fourier Transform of X and the complex conjugate of the Fourier Transform of Y:
SXY = F(X) * F*(Y).
As the result is identical for negative and positive frequencies, here the so-called one-sided CSD is stored:
GXY = SXY for f=0,  GXY = 2*SXY for f>0.

The result is complex (except in the case of X = Y, when the CSD is equal to the PSD, calculated by VF_spectrum). Only the values for the frequencies f=0 and f= fNyquist are real. Correspondingly, VF_xspectrum can store the result in compacted from in a complex vector of length specsiz, whereby Spc[0].Re = GXY[0] and Spc[0].Im = GXY[fNyquist].

As the CSD is often not needed in complex form, but only as its absolute value, here a second form of the function exists, VF_xspectrumAbs, which stores this absolute value as the (real) vector Spc. In order to keep specsiz an integer power of 2, there are only specsiz points stored in Spc and the last one, the CSD at the Nyquist frequency fNyquist = 0.5 / sampling_interval, is given as the return value of the function. It may either be neglected (by calling the function like a void function) or stored as the last element in Spc by calling the function as
Spc[specsiz] = VF_xspectrumAbs( Spc, specsiz, X, Y, xsiz, Win );
in this case, Spc must have a length of specsiz+1.

xsiz must be at least 2*specsiz, and specsiz has to be an integer power of 2. Internally, X is divided into (xsiz/specsiz)−1 segments and the average over the spectra of the individual segments is calculated. Each segment of length 2*specsiz yields the CSD for specsiz+1 frequencies (see VF_FFT).

Win is a window that is applied to the data segments. The size of the Win vector must be 2*specsiz. Within the VectorLib library, three functions are available that give suitable Windows: VF_Welch,   VF_Parzen, and VF_Hann. A square window (i.e. no windowing at all) is achieved by setting all elements of Win to 1.0 using VF_equ1. Use of the square window is not recommended here, though.

Internally, VF_xspectrum / VF_xspectrumAbs allocate and frees additional workspace memory. For repeated calls, this would be inefficient. In such a case, it is recommended to use VFb_xspectrum / VFb_xspectrumAbs instead. The size of Buf must be ≥ 4*xsiz + 4*specsiz. Additionally, Buf must be 128-bit (P8) or 256-bit (P9) aligned. This usually means you can only take a vector allocated by the VF_vector family as Buf.

Error handlingIf size is not a power of 2, VF_FFT (on which VF_xspectrum is based) complains "Size must be an integer power of 2" and the program is aborted.
Return valueVF_xspectrum: none.
VF_xspectrumAbs: CSD at the Nyquist frequency
See alsoVF_FFT,   VF_coherence   VF_spectrum,   VF_convolve,   VF_autocorr,   VF_xcorr,   VF_filter

 

VF_xyAutoPlotVD_xyAutoPlotVE_xyAutoPlot
VI_xyAutoPlotVBI_xyAutoPlotVSI_xyAutoPlot
VLI_xyAutoPlotVQI_xyAutoPlot
VU_xyAutoPlotVUB_xyAutoPlotVUS_xyAutoPlot
VUL_xyAutoPlotVUQ_xyAutoPlotVUI_xyAutoPlot
 ..._xyAutoPlot_xlg_ylin 
 ..._xyAutoPlot_xlg_ylg 
 ..._xyAutoPlot_xlin_ylg 
FunctionDraws a Cartesian coordinate system and plots a Y-vector against an X-vector into it.
Syntax C/C++#include <Vgraph.h>
void VF_xyAutoPlot( fVector X, fVector Y, ui size, unsigned form, COLORREF color );
void VF_xyAutoPlot_xlg_ylin( fVector X, fVector Y, ui size, unsigned form, COLORREF color );
void VF_xyAutoPlot_xlg_ylg( fVector X, fVector Y, ui size, unsigned form, COLORREF color );
void VF_xyAutoPlot_xlin_ylg( fVector X, fVector Y, ui size, unsigned form, COLORREF color );
C++ VecObj#include <OptiVec.h>
void vector<T>::xyAutoPlot( const vector<T>& X, unsigned form, COLORREF color );
void vector<T>::xyAutoPlot_xlg_ylin( const vector<T>& X, unsigned form, COLORREF color );
void vector<T>::xyAutoPlot_xlg_ylg( const vector<T>& X, unsigned form, COLORREF color );
void vector<T>::xyAutoPlot_xlin_ylg( const vector<T>& X, unsigned form, COLORREF color );
Pascal/Delphiuses Vgraph;
procedure VF_xyAutoPlot( X, Y:fVector; size:UIntSize; form:UInt; color:COLORREF );
procedure VF_xyAutoPlot_xlg_ylin( X, Y:fVector; size:UIntSize; form:UInt; color:COLORREF );
procedure VF_xyAutoPlot_xlg_ylg( X, Y:fVector; size:UIntSize; form:UInt; color:COLORREF );
procedure VF_xyAutoPlot_xlin_ylg( X, Y:fVector; size:UIntSize; form:UInt; color:COLORREF );
DescriptionA Cartesian coordinate system is drawn with automatic scaling of the axes and the vector Y is plotted against the vector X. You can choose any combination of linear and logarithmic axes:
VF_xyAutoPlot: both X axis and Y axis linear.
VF_xyAutoPlot_xlg_ylinX axis logarithmic, Y axis linear.
VF_xyAutoPlot_xlg_ylg: both X axis and Y axis logarithmic.
VF_xyAutoPlot_xlin_ylg: X axis linear, Y axis logarithmic.
Prior to calling VF_xyAutoPlot etc., the plotting routines have to be initialized by V_initPlot.
The VecObj version of this function has to be called as a member function of Y (rather than of X).
The font of the axis tick labels is the text font of the current device context.

The style of the plot is determined by the parameter form which should be constructed using the symbolic constants defined in <Vgraph.h> (C/C++) or in the unit Vgraph (Pascal/Delphi).
For the line styles, Borland's old BGI notation is still supported along with the standard Windows notation; the necessary macros for the translation are included in <Vgraph.h> and in the unit Vgraph.

1. Style of lines connecting adjacent data points:
 
Windows styleBGI C/C++BGI Pascalappearance
PS_SOLIDSOLID_LINESolidLn–––– (default)
PS_DOTDOTTED_LINEDottedLn·········
PS_DASHDASHED_LINEDashedLn- - - -
PS_DASHDOTCENTER_LINECenterLn- · - · -
PS_DASHDOTDOT  - · · - · ·
PS_NULLNULL_LINENullLn(no line at all)

2. Symbols used to mark data points:
 
SY_NULL(no symbol at all)   (default)
SY_CROSS
SY_PLUS+
SY_STAR*
SY_CIRCLE
SY_BOX
SY_DIAMOND
SY_TRIANGLEUP
SY_TRIANGLEDOWN

3. Fill-style of the symbols:
 
SY_HOLLOWno filling  (default)
SY_FILLEDfilled
SY_DOTTEDhollow, with a dot at the exact position of the data point

The parameter form has to be constructed by adding the appropriate line style, the symbol and its fill-style, e.g. (SOLID_LINE + SY_TRIANGLEUP). Alternatively, the bit-wise "OR" operation may be used, e.g. (PS_SOLID | SY_CIRCLE | SY_DOTTED ).
In Pascal terms, these examples read:
(SolidLn + SY_TRIANGLEUP), and (PS_SOLID or SY_CIRCLE or SY_DOTTED).

Note that NULL_LINE or PS_NULL has to be explicitly specified, if the data points are not to be connected by lines. Just writing, e.g. (SY_BOX | SY_HOLLOW) would be interpreted as using the default line style, which is SOLID_LINE.

SY_NULL and SY_HOLLOW need not be specified, since these are the default symbol and fill-style, resp. For SY_NULL, SY_CROSS, SY_PLUS, and SY_STAR, the choice of fill-style has no effect.

The parameter color denotes the colour that is to be used for the plot (the data type COLORREF is unsigned long / ULong). The "standard" colors BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, BROWN, LIGHTGRAY, DARKGRAY, LIGHTBLUE, LIGHTGREEN, LIGHTCYAN, LIGHTRED, LIGHTMAGENTA, YELLOW, and WHITE are defined in <Vgraph.h> (or the unit Vgraph) by analogy with the COLORS defined for the old BGI. Nevertheless, it is recommended to use fine-tuned colors defined by the RGB macro, instead of the predefined colors.

The size of the symbols may be modified with the function V_setSymbolSize. The thickness of the lines may be modified using V_setLineThickness.
For examples, see the demo programs VDEMO and FITDEMO.

Error handlingnone
Return valuenone
See alsoVF_xyDataPlot,   VF_yAutoPlot,   VCF_autoPlot,   V_drawAxes,   V_findAxes,   V_setSymbolSize,  chapter 4.12

 

VF_xy2AutoPlotVD_xy2AutoPlotVE_xy2AutoPlot
VI_xy2AutoPlotVBI_xy2AutoPlotVSI_xy2AutoPlot
VLI_xy2AutoPlotVQI_xy2AutoPlot
VU_xy2AutoPlotVUB_xy2AutoPlotVUS_xy2AutoPlot
VUL_xy2AutoPlotVUQ_xy2AutoPlotVUI_xy2AutoPlot
 ..._xy2AutoPlot_xlg_ylin 
 ..._xy2AutoPlot_xlg_ylg 
 ..._xy2AutoPlot_xlin_ylg 
FunctionDraws a Cartesian coordinate system and plots two X-Y vector pairs into it.
Syntax C/C++#include <Vgraph.h>
void VF_xy2AutoPlot( fVector X1, fVector Y1, ui size1, unsigned form1, COLORREF color1, fVector X2, fVector Y2, ui size2, unsigned form2, COLORREF color2 );
void VF_xy2AutoPlot_xlg_ylin( fVector X1, fVector Y1, ui size1, unsigned form1, COLORREF color1, fVector X2, fVector Y2, ui size2, unsigned form2, COLORREF color2 );
void VF_xy2AutoPlot_xlg_ylg( fVector X1, fVector Y1, ui size1, unsigned form1, COLORREF color1, fVector X2, fVector Y2, ui size2, unsigned form2, COLORREF color2 );
void VF_xy2AutoPlot_xlin_ylg( fVector X1, fVector Y1, ui size1, unsigned form1, COLORREF color1, fVector X2, fVector Y2, ui size2, unsigned form2, COLORREF color2 );
C++ VecObj#include <OptiVec.h>
void vector<T>::xy2AutoPlot( const vector<T>& X1, unsigned form1, COLORREF color1, const vector<T>& X2, const vector<T>& Y2, unsigned form2, COLORREF color2 );
void vector<T>::xy2AutoPlot_xlg_ylin( const vector<T>& X1, unsigned form1, COLORREF color1, const vector<T>& X2, const vector<T>& Y2, unsigned form2, COLORREF color2 );
void vector<T>::xy2AutoPlot_xlg_ylg( const vector<T>& X1, unsigned form1, COLORREF color1, const vector<T>& X2, const vector<T>& Y2, unsigned form2, COLORREF color2 );
void vector<T>::xy2AutoPlot_xlin_ylg( const vector<T>& X1, unsigned form1, COLORREF color1, const vector<T>& X2, const vector<T>& Y2, unsigned form2, COLORREF color2 );
Pascal/Delphiuses Vgraph;
procedure VF_xy2AutoPlot( X1, Y1:fVector; size1:UIntSize; form1:UInt; color1:COLORREF; X2, Y2:fVector; size2:UIntSize; form2:UInt; color2:COLORREF );
procedure VF_xy2AutoPlot_xlg_ylin( X1, Y1:fVector; size1:UIntSize; form1:UInt; color1:COLORREF; X2, Y2:fVector; size2:UIntSize; form2:UInt; color2:COLORREF );
procedure VF_xy2AutoPlot_xlg_ylg( X1, Y1:fVector; size1:UIntSize; form1:UInt; color1:COLORREF; X2, Y2:fVector; size2:UIntSize; form2:UInt; color2:COLORREF );
procedure VF_xy2AutoPlot_xlin_ylg( X1, Y1:fVector; size1:UIntSize; form1:UInt; color1:COLORREF; X2, Y2:fVector; size2:UIntSize; form2:UInt; color2:COLORREF );
DescriptionThe vector Y1 is plotted against the vector X1 and Y2 against X2 after automatically drawing a Cartesian coordinate system. For a description of the parameters form1, form2, and color1, color2, see VF_xyAutoPlot. You can choose any combination of linear and logarithmic axes:
VF_xy2AutoPlot: both X axis and Y axis linear.
VF_xy2AutoPlot_xlg_ylinX axis logarithmic, Y axis linear.
VF_xy2AutoPlot_xlg_ylg: both X axis and Y axis logarithmic.
VF_xy2AutoPlot_xlin_ylg: X axis linear, Y axis logarithmic.
Prior to calling VF_xy2AutoPlot, the plotting routines have to be initialized by V_initPlot.
The VecObj version of this function has to be called as a member function of Y1 (rather than of X1).
Error handlingnone
Return valuenone
See alsoVF_xyAutoPlot,   VF_yAutoPlot,   VCF_autoPlot,   V_drawAxes,   V_findAxes

 

VF_xyDataPlotVD_xyDataPlotVE_xyDataPlot
VI_xyDataPlotVBI_xyDataPlotVSI_xyDataPlot
VLI_xyDataPlotVQI_xyDataPlot
VU_xyDataPlotVUB_xyDataPlotVUS_xyDataPlot
VUL_xyDataPlotVUQ_xyDataPlotVUI_xyDataPlot
FunctionX-Y-plot into an existing Cartesian coordinate system.
Syntax C/C++#include <Vgraph.h>
void VF_xyDataPlot( fVector X, fVector Y, ui size, unsigned form, COLORREF color );
C++ VecObj#include <OptiVec.h>
void vector<T>::xyDataPlot( const vector<T>& X, unsigned form, COLORREF color );
Pascal/Delphiuses Vgraph;
procedure VF_xyDataPlot( X, Y:fVector; size:UIntSize; form:UInt; color:COLORREF );
DescriptionThe vector Y is plotted against the vector X into a Cartesian coordinate system drawn by a prior call to one of the AutoPlot functions or to V_drawAxes. For a description of the parameters form and color, see VF_xyAutoPlot.
The VecObj version of this function has to be called as a member function of Y (rather than of X).
Error handlingnone
Return valuenone
See alsoVF_xyAutoPlot,   VF_yAutoPlot,   VCF_autoPlot,   V_drawAxes,   V_findAxes

 

VF_yAutoPlotVD_yAutoPlotVE_yAutoPlot
VI_yAutoPlotVBI_yAutoPlotVSI_yAutoPlot
VLI_yAutoPlotVQI_yAutoPlot
VU_yAutoPlotVUB_yAutoPlotVUS_yAutoPlot
VUL_yAutoPlotVUQ_yAutoPlotVUI_yAutoPlot
 ..._yAutoPlot_xlg_ylin 
 ..._yAutoPlot_xlg_ylg 
 ..._yAutoPlot_xlin_ylg 
FunctionDraws a Cartesian coordinate system and plots each element of a Y-vector against its index.
Syntax C/C++#include <Vgraph.h>.
void VF_yAutoPlot( fVector Y, ui size, unsigned form, COLORREF color );
void VF_yAutoPlot_xlg_ylin( fVector Y, ui size, unsigned form, COLORREF color );
void VF_yAutoPlot_xlg_ylg( fVector Y, ui size, unsigned form, COLORREF color );
void VF_yAutoPlot_xlin_ylg( fVector Y, ui size, unsigned form, COLORREF color );
C++ VecObj#include <OptiVec.h>
void vector<T>::yAutoPlot( unsigned form, COLORREF color );
void vector<T>::yAutoPlot_xlg_ylin( unsigned form, COLORREF color );
void vector<T>::yAutoPlot_xlg_ylg( unsigned form, COLORREF color );
void vector<T>::yAutoPlot_xlin_ylg( unsigned form, COLORREF color );
Pascal/Delphiuses Vgraph;
procedure VF_yAutoPlot( Y:fVector; size:UIntSize; form:UInt; color:COLORREF );
procedure VF_yAutoPlot_xlg_ylin( Y:fVector; size:UIntSize; form:UInt; color:COLORREF );
procedure VF_yAutoPlot_xlg_ylg( Y:fVector; size:UIntSize; form:UInt; color:COLORREF );
procedure VF_yAutoPlot_xlin_ylg( Y:fVector; size:UIntSize; form:UInt; color:COLORREF );
DescriptionA Cartesian coordinate system is automatically scaled and drawn. Each element of the vector Y is plotted against its index (forming the X axis) into this coordinate system. For a description of the parameters form and color, see VF_xyAutoPlot. You can choose any combination of linear and logarithmic axes:
VF_yAutoPlot: both X axis and Y axis linear.
VF_yAutoPlot_xlg_ylinX axis logarithmic, Y axis linear.
VF_yAutoPlot_xlg_ylg: both X axis and Y axis logarithmic.
VF_yAutoPlot_xlin_ylg: X axis linear, Y axis logarithmic.
The plotting routines have to be initialized by V_initPlot prior to calling VF_yAutoPlot.
Error handlingnone
Return valuenone
See alsoVF_yDataPlot,   VF_y2AutoPlot,   VF_xyAutoPlot,   VCF_autoPlot,   V_drawAxes,   V_findAxes,  chapter 4.12

 

VF_y2AutoPlotVD_y2AutoPlotVE_y2AutoPlot
VI_y2AutoPlotVBI_y2AutoPlotVSI_y2AutoPlot
VLI_y2AutoPlotVQI_y2AutoPlot
VU_y2AutoPlotVUB_y2AutoPlotVUS_y2AutoPlot
VUL_y2AutoPlotVUQ_y2AutoPlotVUI_y2AutoPlot
 ..._y2AutoPlot_xlg_ylin 
 ..._y2AutoPlot_xlg_ylg 
 ..._y2AutoPlot_xlin_ylg 
FunctionDraws a Cartesian coordinate system and plots two Y-vectors, taking the index as the X-axis.
Syntax C/C++#include <Vgraph.h>
void VF_y2AutoPlot( fVector Y1, ui size1, unsigned form1, COLORREF color1, fVector Y2, ui size2, unsigned form2, COLORREF color2 );
void VF_y2AutoPlot_xlg_ylin( fVector Y1, ui size1, unsigned form1, COLORREF color1, fVector Y2, ui size2, unsigned form2, COLORREF color2 );
void VF_y2AutoPlot_xlg_ylg( fVector Y1, ui size1, unsigned form1, COLORREF color1, fVector Y2, ui size2, unsigned form2, COLORREF color2 );
void VF_y2AutoPlot_xlin_ylg( fVector Y1, ui size1, unsigned form1, COLORREF color1, fVector Y2, ui size2, unsigned form2, COLORREF color2 );
C++ VecObj#include <OptiVec.h>
void vector<T>::y2AutoPlot( unsigned form1, COLORREF color1, const vector<T>& Y2, unsigned form2, COLORREF color2 );
void vector<T>::y2AutoPlot_xlg_ylin( unsigned form1, COLORREF color1, const vector<T>& Y2, unsigned form2, COLORREF color2 );
void vector<T>::y2AutoPlot_xlg_ylg( unsigned form1, COLORREF color1, const vector<T>& Y2, unsigned form2, COLORREF color2 );
void vector<T>::y2AutoPlot_xlin_ylg( unsigned form1, COLORREF color1, const vector<T>& Y2, unsigned form2, COLORREF color2 );
Pascal/Delphiuses Vgraph;
procedure VF_y2AutoPlot( Y1:fVector; size1:UIntSize; form1:UInt; color1:COLORREF; Y2:fVector; size2:UIntSize; form2:UInt; color2:COLORREF );
procedure VF_y2AutoPlot_xlg_ylin( Y1:fVector; size1:UIntSize; form1:UInt; color1:COLORREF; Y2:fVector; size2:UIntSize; form2:UInt; color2:COLORREF );
procedure VF_y2AutoPlot_xlg_ylg( Y1:fVector; size1:UIntSize; form1:UInt; color1:COLORREF; Y2:fVector; size2:UIntSize; form2:UInt; color2:COLORREF );
procedure VF_y2AutoPlot_xlin_ylg( Y1:fVector; size1:UIntSize; form1:UInt; color1:COLORREF; Y2:fVector; size2:UIntSize; form2:UInt; color2:COLORREF );
DescriptionA Cartesian coordinate system is automatically scaled and drawn. Each element of the vectors Y1 and Y2 is plotted at the X-position given by its index. For a description of the parameters form1, form2, and color1, color2, see VF_xyAutoPlot. You can choose any combination of linear and logarithmic axes:
VF_y2AutoPlot: both X axis and Y axis linear.
VF_y2AutoPlot_xlg_ylinX axis logarithmic, Y axis linear.
VF_y2AutoPlot_xlg_ylg: both X axis and Y axis logarithmic.
VF_y2AutoPlot_xlin_ylg: X axis linear, Y axis logarithmic.
The plotting routines have to be initialized by V_initPlot prior to calling VF_y2AutoPlot.
The VecObj version of this function has to be called as a member function of Y1.
Error handlingnone
Return valuenone
See alsoVF_yDataPlot,   VF_y2AutoPlot,   VF_xyAutoPlot,   VCF_autoPlot,   V_drawAxes,   V_findAxes,  chapter 4.12

 

VF_yDataPlotVD_yDataPlotVE_yDataPlot
VI_yDataPlotVBI_yDataPlotVSI_yDataPlot
VLI_yDataPlotVQI_yDataPlot
VU_yDataPlotVUB_yDataPlotVUS_yDataPlot
VUL_yDataPlotVUQ_yDataPlotVUI_yDataPlot
FunctionPlots a Y-vector into an existing Cartesian coordinate system, taking the index as the X-axis.
Syntax C/C++#include <Vgraph.h>
void VF_yDataPlot( fVector Y, ui size, unsigned form, COLORREF color );
C++ VecObj#include <OptiVec.h>
void vector<T>::yDataPlot( unsigned form, COLORREF color );
Pascal/Delphiuses Vgraph;
procedure VF_yDataPlot( Y:fVector; size:UIntSize; form:UInt; color:COLORREF );
DescriptionEach element of the vector Y is plotted into a Cartesian coordinate system that has to be already drawn by a prior call to one of the DataPlot functions or to V_drawAxes. The X-position is given by the index of the Y-element to be plotted. For a description of the parameters form and color, see VF_xyAutoPlot.
Error handlingnone
Return valuenone
See alsoVF_yAutoPlot,   VF_y2AutoPlot,   VF_xyAutoPlot,   VCF_autoPlot,   V_drawAxes,   V_findAxes,  chapter 4.12
 


9. Scalar (non-vectorized) Functions

There are a few non-vectorized functions, stemming from CMATH and XMATH, which are necessary to use VectorLib. They are described here:

 

fcplxdcplxecplx
FunctionInitialization of cartesian-complex numbers
Syntax C/C++#include <VecLib.h>
fComplex fcplx( float ReVal, float ImVal );

    (similarly dcplx,   ecplx)
Pascal/Delphiuses VecLib;
function fcplx( xRe, xIm: Single ): fComplex;

alternative Syntax (a bit clumsy, but slightly more efficient):
procedure fcplx( var zy:fComplex; xRe, xIm: Single );

    (similarly dcplx,   ecplx)
DescriptionThese functions allow to generate complex numbers of the three cartesian data types fComplex, dComplex, and eComplex. CMATH offers overloaded versions of these functions for C++. See CMATH.HTM, chapter 2.1 for details.
fcplx may be used whenever temporary complex variables are needed as arguments for functions. In this case, fcplx replaces the less elegant direct assignment of the real and imaginary parts, e.g.:
  z.Re = 3.0; z.Im = 4.0;
  VCF_equC( X, size, z ); /* less convenient */
  VCF_equC( Y, size, fcplx( 3.0, 4.0 )); /* easier */
Error handlingnone
Return valuethe generated complex number
See alsofpolr

 

isintisintlisintd
Functiontests if a number is a whole number
Syntax C/C++#include <xmath.h>
int isint( double x );
int isintl( long double x );
Pascal/Delphiuses xmath;
function isint( x:Extended ): IntBool;
function isintd( x:Double ): IntBool;
DescriptionReturns TRUE (a value different from 0), if x is an integer number. FALSE (0) is returned, if x contains a non-zero fractional part.
Error handlingnone
Return valuesee above

 

isipow2sisipow2lisipow2
Functiontests if an unsigned integer is an integer power of 2
Syntax C/C++#include <xmath.h>
int isipow2( unsigned x );
int sisipow2( unsigned short x );
int lisipow2( unsigned long x );
Pascal/Delphiuses xmath;
function isipow2( x:UInt ): IntBool;
function sisipow2( x:USmall ): IntBool;
function lisipow2( x:ULong ): IntBool;
DescriptionReturns TRUE (non-zero), if x is an integer power of 2:
x = 2n,   n=1,2,3,...
Otherwise, FALSE (0) is returned.
Error handlingnone
Return valuesee above

 

loglogd
FunctionNatural logarithm: Pascal/Delphi only!
Syntaxuses xmath;
function log( x:Extended x ): Extended;
function logd( x:double x ): Double;
DescriptionThe logarithm of the argument to the basis e is calculated and the result returned. The "extended" version of this function is almost identical to the built-in Pascal function Ln. Only the error handling occurs via the same handler as for the other OptiVec functions, rather than via the built-in handler of Pascal. The "double"-version, logd, is slightly faster.
Error handlingA DOMAIN error with NAN ("not-a-number") as return value results from x < 0 (including −0). A SING error with -HUGE_VAL as return value results from x=0.
Return valueThe natural logarithm of the argument is returned.
See alsolog2,   log2d,   log10,   log10d,   VF_log

 

log2log2llog2d
FunctionBinary logarithm
Syntax C/C++#include <xmath.h>
double       log2( double x );
long double  log2l( long double x );
Pascal/Delphiuses xmath;
function log2( x:Extended ): Extended;
function log2d( x:Double ): Double;
DescriptionThe logarithm of the argument to the basis 2 is calculated and the result returned.
Error handlingA DOMAIN error with NAN ("not-a-number") as return value results from x < 0 (including −0). A SING error with -HUGE_VAL as return value results from x=0.
In C/C++, the handling of both errors can be modified via _matherr or _matherrl, resp.
Return valueThe binary logarithm of the argument is returned.
See alsolog,   log10,   VF_log2

 

log10log10d
FunctionDecadic logarithm: Pascal/Delphi only!
Syntaxuses xmath;
function log10( x:Extended x ): Extended;
function log10d( x:double x ): Double;
DescriptionThe logarithm of the argument to the basis 10 is calculated and the result returned.
Error handlingA DOMAIN error with NAN ("not-a-number") as return value results from x < 0 (including −0). A SING error with -HUGE_VAL as return value results from x=0.
Return valueThe decadic logarithm of the argument is returned.
See alsolog,   logd,   log2,   log2d,   VF_log10

 

fpolrdpolrepolr
FunctionInitialization of polar-complex numbers
Syntax C/C++#include <VecLib.h>
fPolar fpolr( float MagVal, float ArgVal );

    (similarly dpolr,   epolr)
Pascal/Delphiuses VecLib;
function fpolr( xMag, xArg:Single ): fPolar;

alternative Syntax (a bit clumsy, but slightly more efficient):
procedure fpolr( var py:fPolar; xMag, xArg:Single );

    (similarly dpolr,   epolr)
DescriptionThese functions allow to generate numbers of the three polar-complex data types fPolar, dPolar, and ePolar. CMATH offers overloaded versions of these functions for C++. See CMATH.HTM, chapter 2.1 for details.
fpolr may be used whenever temporary complex variables are needed as arguments for functions. In this case, fpolr replaces the less elegant direct assignment of the Mag and Arg parts, e.g.:
  p.Mag = 3.0; p.Arg = 1.5708;
  VPF_equC( X, size, p ); /* less convenient */
  VPF_equC( Y, size, fpolr( 3.0, 1.5708 )); /* easier */
Error handlingnone
Return valuethe generated polar-complex number
See alsofcplx

 

quadtod_quadtold
Functionconvert a quad into a double or long double: C/C++ only!
Syntax C/C++#include <VecLib.h>
double       quadtod( quad x );
long double _quadtold( quad x );
DescriptionThese functions, along with their counterpart, setquad, provide the necessary interface for the use of the data type quad with Borland C++ (where OptiVec still maintains compatibility with earlier versions that had no complete built-in support for 64-bit integers). If, e.g., the value of a quad (say, of x) has to be printed, this must be done by a function call like
printf( "% 20.0Lf", _quadtold( x ));
Error handlingnone
Return valuethe value of x is returned as a double or long double.

 

setquad
Functionconverts a long double into a quad: C/C++ only!
Syntax C/C++#include <VecLib.h>
quad setquad( long double x );
DescriptionThis function, along with its counterparts, quadtod and _quadtold, provides the necessary interface for the use of the data type quad with Borland C++ (where OptiVec still maintains compatibility with earlier versions that had no complete built-in support for 64-bit integers).
If, e.g., quad parameters are required by a function, they have to be passed either as existing variables of this data type, or else as in the following example:
VQI_addC( QI2, QI1,size, setquad( 53563369.L ));
Error handlingnone
Return valuethe value of x is returned as a quad.

 

E N D

Copyright for OptiVec software and documentation
© 1996-2024 OptiCode - Dr. Martin Sander Software Dev.
All rights reserved!