VF_cmp_...VD_cmp_...VE_cmp_...
        ...eq0        ...ne0        ...gt0        ...ge0        ...le0        ...lt0
        ...eqC        ...neC        ...gtC        ...geC        ...leC        ...ltC
        ...eqV        ...neV        ...gtV        ...geV        ...leV        ...ltV
        ...eq0ind        ...ne0ind        ...gt0ind        ...ge0ind        ...le0ind        ...lt0ind
        ...eqCind        ...neCind        ...gtCind        ...geCind        ...leCind        ...ltCind
        ...eqVind        ...neVind        ...gtVind        ...geVind        ...leVind        ...ltVind
        ...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
        ...eq0ind        ...ne0ind        ...eqCind        ...neCind        ...eqVind        ...neVind
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_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)
    (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_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 );

    (similarly 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<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<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<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 );
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_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)
    (similarly VD_ and VE_ versions)

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_ and VE_ versions)

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_ and VE_ versions)

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_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;

    (similarly VCD_ and VCE_ versions)

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.)

For complex numbers, only the test for equality ("eq") or inequality ("ne") makes sense and is available.

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.

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 this VectorLib library must be non-zero!).

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

VectorLib Table of Contents  OptiVec home