diff options
author | torset | 2009-01-16 16:22:45 +0000 |
---|---|---|
committer | torset | 2009-01-16 16:22:45 +0000 |
commit | 6336fd8c8f24e474913ce7e85fbb2d0fad6283df (patch) | |
tree | 3be1f64f9f9f4c194ad85452a8629a0ba73aae41 | |
parent | 206ead570d3a93760a23e1a9f426ad09e793dac5 (diff) | |
download | scilab2c-6336fd8c8f24e474913ce7e85fbb2d0fad6283df.tar.gz scilab2c-6336fd8c8f24e474913ce7e85fbb2d0fad6283df.tar.bz2 scilab2c-6336fd8c8f24e474913ce7e85fbb2d0fad6283df.zip |
Update with Scilab2C modifs (maybe some errors)
-rw-r--r-- | src/matrixOperations/cat/dcata.c | 3 | ||||
-rw-r--r-- | src/matrixOperations/cat/testDoubleMatrixConcatenation.c | 18 | ||||
-rw-r--r-- | src/matrixOperations/interfaces/int_OpCc.h | 97 | ||||
-rw-r--r-- | src/matrixOperations/interfaces/int_OpRc.h | 107 | ||||
-rw-r--r-- | src/matrixOperations/interfaces/int_cat.h | 124 |
5 files changed, 224 insertions, 125 deletions
diff --git a/src/matrixOperations/cat/dcata.c b/src/matrixOperations/cat/dcata.c index 79469c30..e594bf0f 100644 --- a/src/matrixOperations/cat/dcata.c +++ b/src/matrixOperations/cat/dcata.c @@ -15,13 +15,14 @@ ** Emulate Scilab (from help cat) : ** then the concatenation is done according to the rows ** -** A1=[1 2 3 ; 4 5 6]; A2=[7 8 9 ; 10 11 12]; y=cat(1,A1,A2) => y=[1 2 3 ; 4 5 61 ;7 8 9; 10 11 12] +** A1=[1 2 3 ; 4 5 6]; A2=[7 8 9 ; 10 11 12]; y=cat(1,A1,A2) => y=[1 2 3 ; 4 5 6 ;7 8 9; 10 11 12] ** */ void drowcata(double *in1, int lines1, int columns1, double *in2, int lines2, int columns2, double* out) { int i = 0; int j = 0; + for (i = 0 ; i < columns1 && i < columns2 ; ++i) { for (j = 0 ; j < lines1 ; ++j) diff --git a/src/matrixOperations/cat/testDoubleMatrixConcatenation.c b/src/matrixOperations/cat/testDoubleMatrixConcatenation.c index 129e7518..29ab3c65 100644 --- a/src/matrixOperations/cat/testDoubleMatrixConcatenation.c +++ b/src/matrixOperations/cat/testDoubleMatrixConcatenation.c @@ -140,6 +140,24 @@ static void drowcataTest() { assert(out_6_2[9] == 8.0); assert(out_6_2[10] == 11.0); assert(out_6_2[11] == 12.0); + + drowcata(in1, 1, 6, in2, 1, 6, out_6_2); + for (i = 0 ; i < 12 ; ++i) { + printf("out_6_2[%d] = %e\n", i, out_6_2[i]); + } + assert(out_6_2[0] == 1.0); + assert(out_6_2[1] == 3.0); + assert(out_6_2[2] == 2.0); + assert(out_6_2[3] == 4.0); + assert(out_6_2[4] == 5.0); + assert(out_6_2[5] == 7.0); + assert(out_6_2[6] == 6.0); + assert(out_6_2[7] == 8.0); + assert(out_6_2[8] == 9.0); + assert(out_6_2[9] == 11.0); + assert(out_6_2[10] == 10.0); + assert(out_6_2[11] == 12.0); + } static void zrowcatsTest(void) { diff --git a/src/matrixOperations/interfaces/int_OpCc.h b/src/matrixOperations/interfaces/int_OpCc.h new file mode 100644 index 00000000..bba340e8 --- /dev/null +++ b/src/matrixOperations/interfaces/int_OpCc.h @@ -0,0 +1,97 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - 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 + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ + +#ifndef __INT_OPCC_H__ +#define __INT_OPCC_H__ + +/* Column Cat */ + +/* Same input elements */ + +#define s0s0OpCcs2(in1,in2,out) scolumncats(in1,in2,out) + +#define d0d0OpCcd2(in1,in2,out) dcolumncats(in1,in2,out) + +#define c0c0OpCcc2(in1,in2,out) ccolumncats(in1,in2,out) + +#define z0z0OpCcz2(in1,in2,out) zcolumncats(in1,in2,out) + +#define s2s2OpCcs2(in1,size1,in2,size2,out) scolumncata(in1, size1[0], size2[1], in2, size1[0], size2[1], out) + +#define d2d2OpCcd2(in1,size1,in2,size2,out) dcolumncata(in1, size1[0], size2[1], in2, size1[0], size2[1], out) + +#define c2c2OpCcc2(in1,size1,in2,size2,out) ccolumncata(in1, size1[0], size2[1], in2, size1[0], size2[1], out) + +#define z2z2OpCcz2(in1,size1,in2,size2,out) zcolumncata(in1, size1[0], size2[1], in2, size1[0], size2[1], out) + +/* Differents input elements */ +#define s0c0OpCcc2(in1,in2,out) crowcats(FloatComplex(in1,0),in2,out) + +#define d0z0OpCcz2(in1,in2,out) zrowcats(DoubleComplex(in1,0),in2,out) + +#define c0s0OpCcc2(in1,in2,out) crowcats(in1,FloatComplex(in2,0),out) + +#define z0d0OpCcz2(in1,in2,out) zrowcats(in1,DoubleComplex(in2,0),out) + +#define s2c2OpCcc2(in1,size1,in2,size2,out) crowcata(FloatComplexMatrix(in1,0,size1[0]*size1[1]), size1[0], size2[1], in2, size1[0], size2[1], out) + +#define d2z2OpCcz2(in1,size1,in2,size2,out) zrowcata(DoubleComplexMatrix(in1,0,size1[0]*size1[1]), size1[0], size2[1], in2, size1[0], size2[1], out) + +#define c2s2OpCcc2(in1,size1,in2,size2,out) crowcata(in1, size1[0], size2[1], FloatComplexMatrix(in2,0,size2[0]*size2[1]), size1[0], size2[1], out) + +#define z2d2OpCcz2(in1,size1,in2,size2,out) zrowcata(in1, size1[0], size2[1], DoubleComplexMatrix(in2,0,size2[0]*size2[1]), size1[0], size2[1], out) + +/* Matrix-Scalar */ + +/* Same type */ + +#define s2s0OpCcs2(in1,size,in2,out) srowcats(in2,0,(float *)out_tmp);srowcata(in1, size[0], size[1], out_tmp, 1, 1, out); + +#define d2d0OpCcd2(in1,size,in2,out) drowcats(in2,0,(double *)out_tmp);drowcata(in1, size[0], size[1], out_tmp, 1, 1, out); + +#define c2c0OpCcc2(in1,size,in2,out) crowcats(in2,0,(floatComplex *)out_tmp);crowcata(in1, size[0], size[1], out_tmp, 1, 1, out); + +#define z2z0OpCcz2(in1,size,in2,out) zrowcats(in2,0,(doubleComplex *)out_tmp);zcrowcata(in1, size[0], size[1], out_tmp, 1, 1, out); + + +/* Different type */ +#define s2c0OpCcc2(in1,size,in2,out) scolumncata(FloatComplexMatrix(in1,0,size[0]*size[1]), size[0], size[1], in2, 1, 1, out); + +#define d2z0OpCcz2(in1,size,in2,out) sdcolumncata(DoubleComplexMatrix(in1,0,size[0]*size[1]), size[0], size[1], in2, 1, 1, out); + +#define c2s0OpCcc2(in1,size,in2,out) ccolumncata(in1, size[0], size[1], FloatComplex(in2,0), 1, 1, out); + +#define z2d0OpCcz2(in1,size,in2,out) zrowcats(DoubleComplex(in2,0),DoubleComplex(0,0),(doubleComplex *)out_tmp);zrowcata(in1, size[0], size[1], out_tmp, 1, 1, out); + +/* Scalar-Matrix */ + +/* Same type */ +#define s0s2OpCcs2(in1,in2,size,out) scolumncata(in1, 1, 1, in2, size[0], size[1], out); + +#define d0d2OpCcd2(in1,in2,size,out) dcolumncata(in1, 1, 1, in2, size[0], size[1], out); + +#define c0c2OpCcc2(in1,in2,size,out) ccolumncata(in1, 1, 1, in2, size[0], size[1], out); + +#define z0z2OpCcz2(in1,in2,size,out) zcolumncata(in1, 1, 1, in2, size[0], size[1], out); + +/* Different type */ +#define s0c2OpCcc2(in1,in2,size,out) scolumncata(FloatComplex(in2,0), 1, 1, in2, size[0], size[1], out); + +#define d0z2OpCcz2(in1,in2,size,out) dcolumncata(DoubleComplex(in2,0), 1, 1, in2, size[0], size[1], out); + +#define c0s2OpCcc2(in1,in2,size,out) ccolumncata(in1, 1, 1, FloatComplexMatrix(in1,0,size[0]*size[1]), size[0], size[1], out); + +#define z0d2OpCcz2(in1,in2,size,out) zcolumncata(in1, 1, 1, DoubleComplexMatrix(in1,0,size[0]*size[1]), size[0], size[1], out); + +#endif /* !__INT_OPCC_H__ */ diff --git a/src/matrixOperations/interfaces/int_OpRc.h b/src/matrixOperations/interfaces/int_OpRc.h new file mode 100644 index 00000000..ae9803d1 --- /dev/null +++ b/src/matrixOperations/interfaces/int_OpRc.h @@ -0,0 +1,107 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - 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 + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ + +#ifndef __INT_OPRC_H__ +#define __INT_OPRC_H__ + + + +/* Row Cat */ + +/* Scalar-Scalar */ + +/* Same input elements */ + +#define s0s0OpRcs2(in1,in2,out) srowcats(in1,in2,out) + +#define d0d0OpRcd2(in1,in2,out) drowcats(in1,in2,out) + +#define c0c0OpRcc2(in1,in2,out) crowcats(in1,in2,out) + +#define z0z0OpRcz2(in1,in2,out) zrowcats(in1,in2,out) + +#define s2s2OpRcs2(in1,size1,in2,size2,out) srowcata(in1, size1[0], size2[1], in2, size1[0], size2[1], out) + +#define d2d2OpRcd2(in1,size1,in2,size2,out) drowcata(in1, size1[0], size2[1], in2, size1[0], size2[1], out) + +#define c2c2OpRcc2(in1,size1,in2,size2,out) crowcata(in1, size1[0], size2[1], in2, size1[0], size2[1], out) + +#define z2z2OpRcz2(in1,size1,in2,size2,out) zrowcata(in1, size1[0], size2[1], in2, size1[0], size2[1], out) + +/* Differents input elements */ + +#define s0c0OpRcc2(in1,in2,out) crowcats(FloatComplex(in1,0),in2,out) + +#define d0z0OpRcz2(in1,in2,out) zrowcats(DoubleComplex(in1,0),in2,out) + +#define c0s0OpRcc2(in1,in2,out) crowcats(in1,FloatComplex(in2,0),out) + +#define z0d0OpRcz2(in1,in2,out) zrowcats(in1,DoubleComplex(in2,0),out) + +#define s2c2OpRcc2(in1,size1,in2,size2,out) crowcata(FloatComplexMatrix(in1,0,size1[0]*size1[1]), size1[0], size2[1], in2, size1[0], size2[1], out) + +#define d2z2OpRcz2(in1,size1,in2,size2,out) zrowcata(DoubleComplexMatrix(in1,0,size1[0]*size1[1]), size1[0], size2[1], in2, size1[0], size2[1], out) + +#define c2s2OpRcc2(in1,size1,in2,size2,out) crowcata(in1, size1[0], size2[1], FloatComplexMatrix(in2,0,size2[0]*size2[1]), size1[0], size2[1], out) + +#define z2d2OpRcz2(in1,size1,in2,size2,out) zrowcata(in1, size1[0], size2[1], DoubleComplexMatrix(in2,0,size2[0]*size2[1]), size1[0], size2[1], out) + +/* Matrix-Scalar */ + +/* Same type */ +double out_tmp[2]; +#define s2s0OpRcs2(in1,size,in2,out) srowcata(in1, size[0], size[1], in2, 1, 1, out); + +#define d2d0OpRcd2(in1,size,in2,out) dcolumncats(in2,0,out_tmp); dcolumncata(in1, size[0], size[1], out_tmp, 1, 1, out); + +#define c2c0OpRcc2(in1,size,in2,out) crowcata(in1, size[0], size[1], in2, 1, 1, out); + +#define z2z0OpRcz2(in1,size,in2,out) zrowcata(in1, size[0], size[1], in2, 1, 1, out); + + +/* Different type */ +#define s2c0OpRcc2(in1,size,in2,out) crowcata(FloatComplexMatrix(in1,0,size[0]*size[1]), size[0], size[1], in2, 1, 1, out); + +#define d2z0OpRcz2(in1,size,in2,out) zrowcata(DoubleComplexMatrix(in1,0,size[0]*size[1]), size[0], size[1], in2, 1, 1, out); + +#define c2s0OpRcc2(in1,size,in2,out) crowcata(in1, size[0], size[1], FloatComplex(in2,0), 1, 1, out); + +#define z2d0OpRcz2(in1,size,in2,out) zrowcata(in1, size[0], size[1], DoubleComplex(in2,0), 1, 1, out); + + + + + +/* Scalar-Matrix */ + +/* Same type */ +#define s0s2OpRcs2(in1,in2,size,out) srowcata(in1, 1, 1, in2, size[0], size[1], out); + +#define d0d2OpRcd2(in1,in2,size,out) drowcata(in1, 1, 1, in2, size[0], size[1], out); + +#define c0c2OpRcc2(in1,in2,size,out) crowcata(in1, 1, 1, in2, size[0], size[1], out); + +#define z0z2OpRcz2(in1,in2,size,out) zrowcata(in1, 1, 1, in2, size[0], size[1], out); + +/* Different type */ +#define s0c2OpRcc2(in1,in2,size,out) crowcata(FloatComplex(in1,0), 1, 1, in2, size[0], size[1], out); + +#define d0z2OpRcz2(in1,in2,size,out) zrowcata(DoubleComplex(in1,0), 1, 1, in2, size[0], size[1], out); + +#define c0s2OpRcc2(in1,in2,size,out) crowcata(in1, 1, 1, FloatComplexMatrix(in2,0,size[0]*size[1]), size[0], size[1], out); + +#define z0d2OpRcz2(in1,in2,size,out) zrowcata(in1, 1, 1, DoubleComplexMatrix(in2,0,size[0]*size[1]), size[0], size[1], out); + + +#endif /* !__INT_OPRC_H__ */ diff --git a/src/matrixOperations/interfaces/int_cat.h b/src/matrixOperations/interfaces/int_cat.h deleted file mode 100644 index a4d8b132..00000000 --- a/src/matrixOperations/interfaces/int_cat.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008-2008 - INRIA - 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 - * you should have received as part of this distribution. The terms - * are also available at - * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - * - */ - -/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ - -#ifndef __INT_CAT_H__ -#define __INT_CAT_H__ - -/* Column Cat */ - -/* Same input elements */ - -#define s0s0OpCcs2(in1,in2,out) scolumncats(in1,in2,out) - -#define d0d0OpCcd2(in1,in2,out) dcolumncats(in1,in2,out) - -#define c0c0OpCcc2(in1,in2,out) ccolumncats(in1,in2,out) - -#define z0z0OpCcz2(in1,in2,out) zcolumncats(in1,in2,out) - -#define s2s2OpCcs2(in1,size1,in2,size2,out) scolumncata(in1, size1[0], size2[1], in2, size1[0], size2[1], out) - -#define d2d2OpCcd2(in1,size1,in2,size2,out) dcolumncata(in1, size1[0], size2[1], in2, size1[0], size2[1], out) - -#define c2c2OpCcc2(in1,size1,in2,size2,out) ccolumncata(in1, size1[0], size2[1], in2, size1[0], size2[1], out) - -#define z2z2OpCcz2(in1,size1,in2,size2,out) zcolumncata(in1, size1[0], size2[1], in2, size1[0], size2[1], out) - -/* Differents input elements */ - -/* Matrix-Scalar */ - -/* Same type */ -#define s2s0OpCcs2(in1,size,in2,out) scolumncata(in1, size[0], size[1], in2, 1, 1, out); - -#define d2d0OpCcd2(in1,size,in2,out) dcolumncata(in1, size[0], size[1], in2, 1, 1, out); - -#define c2c0OpCcc2(in1,size,in2,out) ccolumncata(in1, size[0], size[1], in2, 1, 1, out); - -#define z2z0OpCcz2(in1,size,in2,out) zcolumncata(in1, size[0], size[1], in2, 1, 1, out); - - -/* Different type */ - -/* Scalar-Matrix */ - -/* Same type */ -#define s0s2OpCcs2(in1,in2,size,out) scolumncata(in1, 1, 1, in2, size[0], size[1], out); - -#define d0d2OpCcd2(in1,in2,size,out) dcolumncata(in1, 1, 1, in2, size[0], size[1], out); - -#define c0c2OpCcc2(in1,in2,size,out) ccolumncata(in1, 1, 1, in2, size[0], size[1], out); - -#define z0z2OpCcz2(in1,in2,size,out) zcolumncata(in1, 1, 1, in2, size[0], size[1], out); - -/* Different type */ - - - - - - -/* Row Cat */ - -/* Same input elements */ - -#define s0s0OpRcs2(in1,in2,out) srowcats(in1,in2,out) - -#define d0d0OpRcd2(in1,in2,out) drowcats(in1,in2,out) - -#define c0c0OpRcc2(in1,in2,out) crowcats(in1,in2,out) - -#define z0z0OpRcz2(in1,in2,out) zrowcats(in1,in2,out) - -#define s2s2OpRcs2(in1,size1,in2,size2,out) srowcata(in1, size1[0], size2[1], in2, size1[0], size2[1], out) - -#define d2d2OpRcd2(in1,size1,in2,size2,out) drowcata(in1, size1[0], size2[1], in2, size1[0], size2[1], out) - -#define c2c2OpRcc2(in1,size1,in2,size2,out) crowcata(in1, size1[0], size2[1], in2, size1[0], size2[1], out) - -#define z2z2OpRcz2(in1,size1,in2,size2,out) zrowcata(in1, size1[0], size2[1], in2, size1[0], size2[1], out) - -/* Differents input elements */ - -/* Matrix-Scalar */ - -/* Same type */ -#define s2s0OpRcs2(in1,size,in2,out) srowcata(in1, size[0], size[1], in2, 1, 1, out); - -#define d2d0OpRcd2(in1,size,in2,out) drowcata(in1, size[0], size[1], in2, 1, 1, out); - -#define c2c0OpRcc2(in1,size,in2,out) crowcata(in1, size[0], size[1], in2, 1, 1, out); - -#define z2z0OpRcz2(in1,size,in2,out) zrowcata(in1, size[0], size[1], in2, 1, 1, out); - - -/* Different type */ - -/* Scalar-Matrix */ - -/* Same type */ -#define s0s2OpRcs2(in1,in2,size,out) srowcata(in1, 1, 1, in2, size[0], size[1], out); - -#define d0d2OpRcd2(in1,in2,size,out) drowcata(in1, 1, 1, in2, size[0], size[1], out); - -#define c0c2OpRcc2(in1,in2,size,out) crowcata(in1, 1, 1, in2, size[0], size[1], out); - -#define z0z2OpRcz2(in1,in2,size,out) zrowcata(in1, 1, 1, in2, size[0], size[1], out); - -/* Different type */ - - - - -#endif /* !__INT_CAT_H__ */ |