From 832ffea9290f086be45951c2a5bce9d4027634f4 Mon Sep 17 00:00:00 2001 From: jofret Date: Mon, 21 Jun 2010 07:18:15 +0000 Subject: Hypermatrix management : disp && zeros --- scilab2c/src/c/matrixOperations/includes/zeros.h | 6 ++++ .../src/c/matrixOperations/interfaces/int_zeros.h | 3 +- scilab2c/src/c/matrixOperations/zeros/dzerosh.c | 26 ++++++++++++++++++ scilab2c/src/c/string/disp/ddisph.c | 32 ++++++++++++++++++++++ scilab2c/src/c/string/includes/disp.h | 2 ++ scilab2c/src/c/string/interfaces/int_disp.h | 2 ++ 6 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 scilab2c/src/c/matrixOperations/zeros/dzerosh.c create mode 100644 scilab2c/src/c/string/disp/ddisph.c 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