diff options
Diffstat (limited to '2.3-1/src/c/operations/interfaces/int_OpLogAnd.h')
-rw-r--r-- | 2.3-1/src/c/operations/interfaces/int_OpLogAnd.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/2.3-1/src/c/operations/interfaces/int_OpLogAnd.h b/2.3-1/src/c/operations/interfaces/int_OpLogAnd.h index 460c81ca..50a31894 100644 --- a/2.3-1/src/c/operations/interfaces/int_OpLogAnd.h +++ b/2.3-1/src/c/operations/interfaces/int_OpLogAnd.h @@ -19,6 +19,14 @@ #define Bool2Double(in) ((in) ? 1.0 : 0.0) +#define Bool2Uint8(in) ((in) ? (uint8)1 : (uint8)0) + +#define Bool2Int8(in) ((in) ? (int8)1 : (int8)0) + +#define Bool2Uint16(in) ((in) ? (uint16)1 : (uint16)0) + +#define Bool2Int16(in) ((in) ? (int16)1 : (int16)0) + /*scalar and scalar*/ #define s0s0OpLogAnds0(in1, in2) Bool2Float(in1 != 0.0 && in2 != 0.0) @@ -38,6 +46,15 @@ #define z0d0OpLogAndd0(in1, in2) Bool2Double((zreals(in1) != 0.0 || zimags(in1) != 0.0) && in2 != 0.0) +#define u80u80OpLogAndu80(in1, in2) Bool2Uint8(in1 != 0 && in2 != 0) + +#define i80i80OpLogAndi80(in1, in2) Bool2Int8(in1 != 0 && in2 != 0) + +#define u160u160OpLogAndu160(in1, in2) Bool2Uint16(in1 != 0 && in2 != 0) + +#define i160i160OpLogAndi160(in1, in2) Bool2Int16(in1 != 0 && in2 != 0) + + /*matrix and scalar*/ #define s2s0OpLogAnds2(in1, size1, in2, out) {int i = 0 ;\ @@ -65,6 +82,21 @@ #define z2d0OpLogAndd2(in1, size1, in2, out) {int i = 0 ;\ for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Double((zreals(in1[i]) != 0.0 || zimags(in1[i]) != 0.0) && in2 != 0.0);} +#define u82u80OpLogAndu82(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Uint8(in1[i] != 0 && in2 != 0);} + +#define i82i80OpLogAndi82(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Int8(in1[i] != 0 && in2 != 0);} + +#define u82u80OpLogAndu82(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Uint8(in1[i] != 0 && in2 != 0);} + +#define u162u160OpLogAndu162(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Uint16(in1[i] != 0 && in2 != 0);} + +#define i162i160OpLogAndi162(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Int16(in1[i] != 0 && in2 != 0);} + /*scalar and matrix*/ #define s0s2OpLogAnds2(in1, in2, size2, out) {int i = 0 ;\ @@ -92,6 +124,18 @@ #define z0d2OpLogAndd2(in1, in2, size2, out) {int i = 0 ;\ for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double((zreals(in1) != 0.0 || zimags(in1) != 0.0) && in2[i] != 0.0);} +#define u80u82OpLogAndu82(in1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Uint8(in1 != 0 && in2[i] != 0);} + +#define i80i82OpLogAndi82(in1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Int8(in1 != 0 && in2[i] != 0);} + +#define u160u162OpLogAndu162(in1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Uint16(in1 != 0 && in2[i] != 0);} + +#define i160i162OpLogAndi162(in1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Int16(in1 != 0 && in2[i] != 0);} + /*TODO matrix and matrix*/ #define s2s2OpLogAnds2(in1, size1, in2, size2, out) {int i = 0 ;\ @@ -119,4 +163,17 @@ #define z2d2OpLogAndd2(in1, size1, in2, size2, out) {int i = 0 ;\ for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double((zreals(in1[i]) != 0.0 || zimags(in1[i]) != 0.0) && in2[i] != 0.0;)} + +#define u82u82OpLogAndu82(in1, size1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Uint8(in1[i] != 0 && in2[i] != 0);} + +#define i82i82OpLogAndi82(in1, size1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Int8(in1[i] != 0 && in2[i] != 0);} + +#define u162u162OpLogAndu162(in1, size1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Uint16(in1[i] != 0 && in2[i] != 0);} + +#define i162i162OpLogAndi162(in1, size1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Int16(in1[i] != 0 && in2[i] != 0);} + #endif /* !__INT_OPLOGAND_H__ */ |