summaryrefslogtreecommitdiff
path: root/macros/CFiles/sci2cincludes/OpExt.h
diff options
context:
space:
mode:
authorSiddhesh Wani2015-05-25 14:46:31 +0530
committerSiddhesh Wani2015-05-25 14:46:31 +0530
commitdb464f35f5a10b58d9ed1085e0b462689adee583 (patch)
treede5cdbc71a54765d9fec33414630ae2c8904c9b8 /macros/CFiles/sci2cincludes/OpExt.h
downloadScilab2C_fossee_old-db464f35f5a10b58d9ed1085e0b462689adee583.tar.gz
Scilab2C_fossee_old-db464f35f5a10b58d9ed1085e0b462689adee583.tar.bz2
Scilab2C_fossee_old-db464f35f5a10b58d9ed1085e0b462689adee583.zip
Original Version
Diffstat (limited to 'macros/CFiles/sci2cincludes/OpExt.h')
-rw-r--r--macros/CFiles/sci2cincludes/OpExt.h108
1 files changed, 108 insertions, 0 deletions
diff --git a/macros/CFiles/sci2cincludes/OpExt.h b/macros/CFiles/sci2cincludes/OpExt.h
new file mode 100644
index 0000000..7d8a77f
--- /dev/null
+++ b/macros/CFiles/sci2cincludes/OpExt.h
@@ -0,0 +1,108 @@
+/*
+** -*- C -*-
+**
+**
+** Made by Raffaele.Nutricato@tiscali.it
+**
+** Copyright Raffaele Nutricato
+*/
+
+/*
+ Modify by Arnaud Torset : 20/02/09
+*/
+
+#ifndef __OPEXT_H__
+#define __OPEXT_H__
+
+#define s2s0OpExts0(in1,size,in2) in1[in2-1];
+#define d2d0OpExtd0(in1,size,in2) in1[in2-1];
+#define c2s0OpExtc0(in1,size,in2) in1[in2-1];
+#define z2d0OpExtz0(in1,size,in2) in1[in2-1];
+
+
+#define s2s0s0OpExts0(in1,size,row,col) in1[(col-1)*size[0]+row-1];
+#define d2d0d0OpExtd0(in1,size,row,col) in1[(col-1)*size[0]+row-1];
+#define c2s0s0OpExtc0(in1,size,row,col) in1[(col-1)*size[0]+row-1];
+#define z2d0d0OpExtz0(in1,size,row,col) in1[(col-1)*size[0]+row-1];
+
+
+#define s2s2OpExts2(in1,size1,in2,size2,out) {int i;\
+ for (i=0;i<size2[0]*size2[1];i++) out[i]=in1[(int)in2[i]-1];\
+ }
+
+#define d2d2OpExtd2(in1,size1,in2,size2,out) {int i;\
+ for (i=0;i<size2[0]*size2[1];i++) out[i]=in1[(int)in2[i]-1];\
+ }
+
+#define c2s2OpExtc2(in1,size1,in2,size2,out) {int i;\
+ for (i=0;i<size2[0]*size2[1;i++]) out[i]=in1[(int)in2[i]-1];\
+ }
+
+#define z2d2OpExtz2(in1,size1,in2,size2,out) {int i;\
+ for (i=0;i<size2[0]*size2[1];i++) out[i]=in1[(int)in2[i]-1];\
+ }
+
+
+
+#define s2s2s0OpExts2(in1,size1,rows,size2,col,out) {int i;\
+ for (i=0;i<size2[0]*size2[1];i++) out[i]=s2s0s0OpExts0(in1,size1,(int)rows[i],col);\
+ }
+
+#define d2d2d0OpExtd2(in1,size1,rows,size2,col,out) {int i;\
+ for (i=0;i<size2[0]*size2[1];i++) out[i]=d2d0d0OpExtd0(in1,size1,(int)rows[i],col);\
+ }
+
+#define c2s2s0OpExtc2(in1,size1,rows,size2,col,out) {int i;\
+ for (i=0;i<size2[0]*size2[1];i++) out[i]=c2s0s0OpExtc0(in1,size1,(int)rows[i],col);\
+ }
+
+#define z2d2d0OpExtz2(in1,size1,rows,size2,col,out) {int i;\
+ for (i=0;i<size2[0]*size2[1];i++) out[i]=z2d0d0OpExtz0(in1,size1,(int)rows[i],col);\
+ }
+
+#define s2s0s2OpExts2(in1,size1,row,cols,size2,out) {int i;\
+ for (i=0;i<size2[0]*size2[1];i++) out[i]=s2s0s0OpExts0(in1,size1,row,(int)cols[i]);\
+ }
+
+#define d2d0d2OpExtd2(in1,size1,row,cols,size2,out) {int i;\
+ for (i=0;i<size2[0]*size2[1];i++) out[i]=d2d0d0OpExtd0(in1,size1,row,(int)cols[i]);\
+ }
+
+#define c2s0s2OpExtc2(in1,size1,row,cols,size2,out) {int i;\
+ for (i=0;i<size2[0]*size2[1];i++) out[i]=c2s0s0OpExtc0(in1,size1,row,(int)cols[i]);\
+ }
+
+#define z2d0d2OpExtz2(in1,size1,row,cols,size2,out) {int i;\
+ for (i=0;i<size2[0]*size2[1];i++) out[i]=z2d0d0OpExtz0(in1,size1,row,(int)cols[i]);\
+ }
+
+
+#define s2s2s2OpExts2(in1,size1,rows,size2,cols,size3,out) {int i,j;\
+ for (i=0;i<size2[0]*size2[1];i++) \
+ for (j=0;j<size3[0]*size3[1];j++) \
+ out[i+j*size2[0]*size2[1]] = in1[((int)(cols[j])-1)*size1[0]+(int)(rows[i])-1];\
+ }
+
+#define d2d2d2OpExtd2(in1,size1,rows,size2,cols,size3,out) {int i,j;\
+ for (i=0;i<size2[0]*size2[1];i++) \
+ for (j=0;j<size3[0]*size3[1];j++) \
+ out[i+j*size2[0]*size2[1]] = in1[((int)(cols[j])-1)*size1[0]+(int)(rows[i])-1];\
+ }
+
+#define c2s2s2OpExtc2(in1,size1,rows,size2,cols,size3,out) {int i,j;\
+ for (i=0;i<size2[0]*size2[1];i++) \
+ for (j=0;j<size3[0]*size3[1];j++) \
+ out[i+j*size2[0]*size2[1]] = in1[((int)(cols[j])-1)*size1[0]+(int)(rows[i])-1];\
+ }
+
+#define z2d2d2OpExtz2(in1,size1,rows,size2,cols,size3,out) {int i,j;\
+ for (i=0;i<size2[0]*size2[1];i++) \
+ for (j=0;j<size3[0]*size3[1];j++) \
+ out[i+j*size2[0]*size2[1]] = in1[((int)(cols[j])-1)*size1[0]+(int)(rows[i])-1];\
+ }
+
+
+
+
+
+#endif /* !__OPEXT_H__ */