diff options
author | Siddhesh Wani | 2015-08-04 14:36:45 +0530 |
---|---|---|
committer | Siddhesh Wani | 2015-08-04 14:36:45 +0530 |
commit | 6014a4bafdfade45be535c84273309642b731164 (patch) | |
tree | 63c7e18c1b1ddae9bb4c19ceefc835daaf350d98 /2.3-1/src/c/operations/interfaces | |
parent | dcc7a8331ba9ae3bdd00670a018631c77517c100 (diff) | |
download | Scilab2C-6014a4bafdfade45be535c84273309642b731164.tar.gz Scilab2C-6014a4bafdfade45be535c84273309642b731164.tar.bz2 Scilab2C-6014a4bafdfade45be535c84273309642b731164.zip |
Tested Addition and Subtraction for new data types
Diffstat (limited to '2.3-1/src/c/operations/interfaces')
-rw-r--r-- | 2.3-1/src/c/operations/interfaces/int_OpMinus.h | 69 | ||||
-rw-r--r-- | 2.3-1/src/c/operations/interfaces/int_OpPlus.h | 41 |
2 files changed, 110 insertions, 0 deletions
diff --git a/2.3-1/src/c/operations/interfaces/int_OpMinus.h b/2.3-1/src/c/operations/interfaces/int_OpMinus.h index ac27ddb6..b96328ed 100644 --- a/2.3-1/src/c/operations/interfaces/int_OpMinus.h +++ b/2.3-1/src/c/operations/interfaces/int_OpMinus.h @@ -25,6 +25,14 @@ #define z0OpMinusz0(in) DoubleComplex(-zreals(in), -zimags(in)) +#define u80OpMinusu80(in) -(int8)in + +#define i80OpMinusi80(in) -in + +#define u160OpMinusu160(in) -(int16)in + +#define i160OpMinusi160(in) -in + /* - Matrix */ #define s2OpMinuss2(in, size, out) {int i=0; \ @@ -43,6 +51,19 @@ for (i=0;i<size[0]*size[1];i++) out[i] = DoubleComplex(-zreals(in[i]), -zimags(in[i])); \ } +#define u82OpMinusu82(in, size, out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i] = -(int8)in[i]; \ + } + + +#define u82OpMinusu82(in, size, out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i] = -in[i]; \ + } + + +#define u162OpMinusu162(in, size, out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i] = -(int16)in[i]; \ + } /* Scalar - Scalar */ @@ -62,6 +83,14 @@ #define z0d0OpMinusz0(in1,in2) zdiffs(in1,DoubleComplex(in2,0)) +#define u80u80OpMinusu80(in1,in2) u8diffs(in1,in2) + +#define i80i80OpMinusi80(in1,in2) i8diffs(in1,in2) + +#define u160u160OpMinusu160(in1,in2) u16diffs(in1,in2) + +#define i160i160OpMinusi160(in1,in2) i16diffs(in1,in2) + /* Matrix - Scalar */ @@ -99,6 +128,25 @@ } +#define u82u80OpMinusu82(in1,size,in2,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]-in2; \ + } + + +#define i82i80OpMinusi82(in1,size,in2,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]-in2; \ + } + + +#define u162u160OpMinusu162(in1,size,in2,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]-in2; \ + } + + +#define i162i160OpMinusi162(in1,size,in2,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]-in2; \ + } + /* Scalar - Matrix */ @@ -136,6 +184,22 @@ } +#define u80u82OpMinusu82(in1,in2,size,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=in1-in2[i]; \ + } + + +#define i80i82OpMinusi82(in1,in2,size,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=in1-in2[i]; \ + } + +#define u160u162OpMinusu162(in1,in2,size,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=in1-in2[i]; \ + } + +#define i160i162OpMinusi162(in1,in2,size,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=in1-in2[i]; \ + } /* Matrix - Matrix */ @@ -167,7 +231,12 @@ for (i=0;i<size1[0]*size2[1];i++) out[i]=zdiffs(in1[i],DoubleComplex(in2[i],0)); \ } +#define u82u82OpMinusu82(in1,size1,in2,size2,out) u8diffa(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) + +#define i82i82OpMinusi82(in1,size1,in2,size2,out) i8diffa(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) +#define u162u162OpMinusu162(in1,size1,in2,size2,out) u16diffa(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) +#define i162i162OpMinusu162(in1,size1,in2,size2,out) i16diffa(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) #endif /* !__INT_OPMINUS_H__ */ diff --git a/2.3-1/src/c/operations/interfaces/int_OpPlus.h b/2.3-1/src/c/operations/interfaces/int_OpPlus.h index cb86d815..9684d250 100644 --- a/2.3-1/src/c/operations/interfaces/int_OpPlus.h +++ b/2.3-1/src/c/operations/interfaces/int_OpPlus.h @@ -34,7 +34,13 @@ #define z0d0OpPlusz0(in1,in2) zadds(in1,DoubleComplex(in2,0)) +#define u80u80OpPlusu80(in1,in2) u8adds(in1,in2) +#define i80i80OpPlusi80(in1,in2) i8adds(in1,in2) + +#define u160u160OpPlusu160(in1,in2) u16adds(in1,in2) + +#define i160i160OpPlusi160(in1,in2) i16adds(in1,in2) /* Matrix + Scalar */ @@ -68,6 +74,21 @@ for (i=0;i<size[0]*size[1];i++) out[i]=zadds(DoubleComplex(in1[i],0),in2);\ } +#define u82u80OpPlusu82(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]+in2;\ + } + +#define i82i80OpPlusi82(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]+in2;\ + } + +#define u162u160OpPlusu162(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]+in2;\ + } + +#define i162i160OpPlusi162(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]+in2;\ + } /* Scalar + Matrix */ @@ -101,7 +122,21 @@ for (i=0;i<size[0]*size[1];i++) out[i]=zadds(in1,DoubleComplex(in2[i],0));\ } +#define u80u82OpPlusu82(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1+in2[i];\ + } + +#define i80i82OpPlusi82(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1+in2[i];\ + } + +#define u160u162OpPlusu162(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1+in2[i];\ + } +#define i160i162OpPlusi162(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1+in2[i];\ + } /* Matrix + Matrix */ @@ -132,7 +167,13 @@ for (i=0;i<size1[0]*size2[1];i++) out[i]=zadds(in1[i],DoubleComplex(in2[i],0));\ } +#define u82u82OpPlusu82(in1,size1,in2,size2,out) u8adda(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) + +#define i82i82OpPlusi82(in1,size1,in2,size2,out) i8adda(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) + +#define u162u162OpPlusu162(in1,size1,in2,size2,out) u16adda(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) +#define i162i162OpPlusu162(in1,size1,in2,size2,out) i16adda(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) /* Strings */ /* RNU: size1[1]-1 -> "-1" because '\0' of the first string must be removed. */ #define g2g2OpPlusg2(in1,size1,in2,size2,out) {int i = 0, j = 0; \ |