diff options
author | jofret | 2010-06-21 07:18:15 +0000 |
---|---|---|
committer | jofret | 2010-06-21 07:18:15 +0000 |
commit | 832ffea9290f086be45951c2a5bce9d4027634f4 (patch) | |
tree | 46ba1d041b1757f4808bcf22d11d21b2df0fb405 | |
parent | af0366230e14cc75d9e9a183375ee9cb69fb46b6 (diff) | |
download | scilab2c-832ffea9290f086be45951c2a5bce9d4027634f4.tar.gz scilab2c-832ffea9290f086be45951c2a5bce9d4027634f4.tar.bz2 scilab2c-832ffea9290f086be45951c2a5bce9d4027634f4.zip |
Hypermatrix management : disp && zeros
-rw-r--r-- | scilab2c/src/c/matrixOperations/includes/zeros.h | 6 | ||||
-rw-r--r-- | scilab2c/src/c/matrixOperations/interfaces/int_zeros.h | 3 | ||||
-rw-r--r-- | scilab2c/src/c/matrixOperations/zeros/dzerosh.c | 26 | ||||
-rw-r--r-- | scilab2c/src/c/string/disp/ddisph.c | 32 | ||||
-rw-r--r-- | scilab2c/src/c/string/includes/disp.h | 2 | ||||
-rw-r--r-- | scilab2c/src/c/string/interfaces/int_disp.h | 2 |
6 files changed, 70 insertions, 1 deletions
diff --git a/scilab2c/src/c/matrixOperations/includes/zeros.h b/scilab2c/src/c/matrixOperations/includes/zeros.h index e2f3f002..06b2e5a5 100644 --- a/scilab2c/src/c/matrixOperations/includes/zeros.h +++ b/scilab2c/src/c/matrixOperations/includes/zeros.h @@ -61,6 +61,12 @@ EXTERN_MATOPS void dzerosa ( double* in , int rows ,int cols ); */ EXTERN_MATOPS void zzerosa ( doubleComplex* in , int rows ,int cols ); +/* +** \brief create a double complex matrix full of one +*/ +EXTERN_MATOPS void dzerosh ( double* in , int rows ,int cols , int levels); + + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/scilab2c/src/c/matrixOperations/interfaces/int_zeros.h b/scilab2c/src/c/matrixOperations/interfaces/int_zeros.h index 3b738608..4bc32138 100644 --- a/scilab2c/src/c/matrixOperations/interfaces/int_zeros.h +++ b/scilab2c/src/c/matrixOperations/interfaces/int_zeros.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) 2010-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 @@ -49,5 +50,5 @@ #define z2zerosz2(in,size,out) zzerosa(out, size[0], size[1]) - +#define d0d0d0zerosd3(in1, in2, in3, out) dzerosh(out, in1, in2, in3); #endif /* !__INT_ZEROS_H__ */ diff --git a/scilab2c/src/c/matrixOperations/zeros/dzerosh.c b/scilab2c/src/c/matrixOperations/zeros/dzerosh.c new file mode 100644 index 00000000..87e7e93c --- /dev/null +++ b/scilab2c/src/c/matrixOperations/zeros/dzerosh.c @@ -0,0 +1,26 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 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 + * 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 + * + */ + +#include "zeros.h" + +void dzerosh ( double* in , int rows ,int cols, int levels) +{ + int i = 0 ; + + for ( i = 0 ; i < rows*cols*levels ; i++) + { + in[i] = 0 ; + + } + +} + diff --git a/scilab2c/src/c/string/disp/ddisph.c b/scilab2c/src/c/string/disp/ddisph.c new file mode 100644 index 00000000..71cda9f4 --- /dev/null +++ b/scilab2c/src/c/string/disp/ddisph.c @@ -0,0 +1,32 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010-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 + * 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 + * + */ + +#include "disp.h" + +double ddisph (double* in, int rows, int columns, int levels){ + int i = 0,j = 0,k = 0; + + for (k = 0; k < levels; ++k) + { + printf("(:, :, %d)\n", k + 1); + for (i = 0; i < rows; ++i) + { + for (j=0;j<columns;j++) + { + printf (" %1.20f ", in[i+j*rows+k*columns*rows]); + } + printf("\n"); + } + printf("\n"); + } + return 0; +} diff --git a/scilab2c/src/c/string/includes/disp.h b/scilab2c/src/c/string/includes/disp.h index bf224b7e..96ccb248 100644 --- a/scilab2c/src/c/string/includes/disp.h +++ b/scilab2c/src/c/string/includes/disp.h @@ -71,6 +71,8 @@ EXTERN_STRING double cdispa (floatComplex* in, int rows, int columns); */ EXTERN_STRING double zdispa (doubleComplex* in, int rows, int columns); + +EXTERN_STRING double ddisph (double *in, int rows, int cols, int levels); EXTERN_STRING double g2dispd0(char *array,int* tmparraysize); diff --git a/scilab2c/src/c/string/interfaces/int_disp.h b/scilab2c/src/c/string/interfaces/int_disp.h index 60e9856b..57f7bd45 100644 --- a/scilab2c/src/c/string/interfaces/int_disp.h +++ b/scilab2c/src/c/string/interfaces/int_disp.h @@ -33,6 +33,8 @@ #define z2dispd0(in,size) zdispa(in,size[0],size[1]) +#define d3dispd0(in,size) ddisph(in,size[0],size[1],size[2]) + #define g2dispd0(in, size) printf("%s\n",in) #endif /* __INT_DISP_H__ */ |