summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjofret2010-06-21 13:17:15 +0000
committerjofret2010-06-21 13:17:15 +0000
commit2f2fd35793c9c84711c709d6e8f18eda7c485844 (patch)
treedff996c52e0384510ec2b84eb226cce8da06f54e /src
parent95acfb6c3844b2b42cd051bd3ee97d750f2accfa (diff)
downloadscilab2c-2f2fd35793c9c84711c709d6e8f18eda7c485844.tar.gz
scilab2c-2f2fd35793c9c84711c709d6e8f18eda7c485844.tar.bz2
scilab2c-2f2fd35793c9c84711c709d6e8f18eda7c485844.zip
Manage Hypermatrix extraction
Diffstat (limited to 'src')
-rw-r--r--src/c/operations/interfaces/int_OpExt.h37
-rw-r--r--src/c/operations/interfaces/int_OpIns.h4
2 files changed, 23 insertions, 18 deletions
diff --git a/src/c/operations/interfaces/int_OpExt.h b/src/c/operations/interfaces/int_OpExt.h
index 8d796f73..7f11ede2 100644
--- a/src/c/operations/interfaces/int_OpExt.h
+++ b/src/c/operations/interfaces/int_OpExt.h
@@ -1,6 +1,7 @@
/*
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2008-2008 - INRIA - Bruno JOFRET
+ * Copyright (C) 2009-2010 - DIGITEO - Bruno JOFRET
*
* This file must be used under the terms of the CeCILL.
* This source file is licensed as described in the file COPYING, which
@@ -20,6 +21,8 @@
#define c2s0OpExtc0(in1,size,in2) in1[((int)in2)-1];
#define z2d0OpExtz0(in1,size,in2) in1[((int)in2)-1];
+#define s3s0OpExts0(in1,size,in2) in1[((int)in2)-1];
+#define d3d0OpExtd0(in1,size,in2) in1[((int)in2)-1];
#define s2s0s0OpExts0(in1,size,row,col) in1[(((int) col)-1)*size[0]+((int) row)-1];
#define d2d0d0OpExtd0(in1,size,row,col) in1[(((int) col)-1)*size[0]+((int) row)-1];
@@ -30,15 +33,15 @@
#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]; \
}
@@ -47,58 +50,60 @@
#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],((int) 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],((int) 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],((int) 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],((int) 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,((int) 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,((int) 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,((int) 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,((int) 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]; \
- }
+ }
+
+#define d3d0d0d0OpExtd0(in, size, row, col, level) in[(int) ((row - 1)+ (col -1) * size[0] + (level - 1) * size[0] * size[1])];
#endif /* !__INT_OPEXT_H__ */
diff --git a/src/c/operations/interfaces/int_OpIns.h b/src/c/operations/interfaces/int_OpIns.h
index 5d3798da..d15876ba 100644
--- a/src/c/operations/interfaces/int_OpIns.h
+++ b/src/c/operations/interfaces/int_OpIns.h
@@ -357,8 +357,8 @@
/* a(x,y,z) = b */
#define s3s0s0s0s0OpIns(in, size1, row, col, level, newVal) \
- in[(row - 1) + (col - 1) * size1[0] + (level - 1) * size1[0] * size1[1]] = newVal;
+ in[(int) ((row - 1) + (col - 1) * size1[0] + (level - 1) * size1[0] * size1[1])] = newVal;
#define d3d0d0d0d0OpIns(in, size1, row, col, level, newVal) \
- in[(row - 1) + (col - 1) * size1[0] + (level - 1) * size1[0] * size1[1]] = newVal;
+ in[(int) ((row - 1) + (col - 1) * size1[0] + (level - 1) * size1[0] * size1[1])] = newVal;
#endif /* !__OPINS_H__ */