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
        ...inclrange0C        ...exclrange0C
        ...inclrangeCC        ...exclrangeCC
VCF_cnt_...VCD_cnt_...VCE_cnt_...
VPF_cnt_...VPD_cnt_...VPE_cnt_...
        ...eq0        ...ne0        ...eqC        ...neC        ...eqV        ...neV
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_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 );

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

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

For complex numbers, only the test for equality ("eq") or inequality ("ne") makes sense and is available.
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_...

VectorLib Table of Contents  OptiVec home