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

VectorLib Table of Contents  OptiVec home