diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/c/auxiliaryFunctions/includes/size.h | 72 | ||||
-rw-r--r-- | src/c/auxiliaryFunctions/interfaces/int_size.h | 5 | ||||
-rw-r--r-- | src/c/auxiliaryFunctions/size/dallsizea.c | 34 |
3 files changed, 38 insertions, 73 deletions
diff --git a/src/c/auxiliaryFunctions/includes/size.h b/src/c/auxiliaryFunctions/includes/size.h index 3a642e3a..ebc07a05 100644 --- a/src/c/auxiliaryFunctions/includes/size.h +++ b/src/c/auxiliaryFunctions/includes/size.h @@ -14,82 +14,12 @@ #define __SIZE_H__ /** - ** WARNING : - ** We assume size of arrays are known, so we - ** use #define to avoid compilation warnings - ** such as "unused parameter" - **/ - -/** - ** \brief Float Size Scalar function - ** Determine the size of an array. - ** \param in : the float array we must determine size. - ** \param size : the number of elements. - ** \return the size of in. - **/ -#define ssizes(in) 1.0f - -/** - ** \brief Float Size Scalar function - ** Determine the size of an array. - ** \param in : the float array we must determine size. - ** \param size : the number of elements. - ** \return the size of in. - **/ -#define dsizes(in) 1.0 - -/** - ** \brief Complex Float Size Scalar function - ** Determine the size of an array. - ** \param in : the float array we must determine size. - ** \param size : the number of elements. - ** \return the size of in. - **/ -#define csizes(in) 1.0f - -/** - ** \brief Complex Double Size Array function - ** Determine the size of an array. - ** \param in : the float array we must determine size. - ** \param size : the number of elements. - ** \return the size of in. - **/ -#define zsizes(in) 1.0 - -/** - ** \brief Float Size Array function - ** Determine the size of an array. - ** \param in : the float array we must determine size. - ** \param size : the number of elements. - ** \return the size of in. - **/ -#define ssizea(in, size) size - -/** ** \brief Double Size Array function ** Determine the size of an array. ** \param in : the float array we must determine size. ** \param size : the number of elements. ** \return the size of in. **/ -#define dsizea(in, size) size - -/** - ** \brief Complex Float Size Array function - ** Determine the size of an array. - ** \param in : the float array we must determine size. - ** \param size : the number of elements. - ** \return the size of in. - **/ -#define csizea(in, size) size - -/** - ** \brief Complex Double Size Array function - ** Determine the size of an array. - ** \param in : the float array we must determine size. - ** \param size : the number of elements. - ** \return the size of in. - **/ -#define zsizea(in, size) size +double dallsizea(int *size, char *select); #endif /* !__SIZE_H__ */ diff --git a/src/c/auxiliaryFunctions/interfaces/int_size.h b/src/c/auxiliaryFunctions/interfaces/int_size.h index 2608bc81..c529a97d 100644 --- a/src/c/auxiliaryFunctions/interfaces/int_size.h +++ b/src/c/auxiliaryFunctions/interfaces/int_size.h @@ -14,6 +14,7 @@ IMPLEMENTED YET, SEE DRANDS.C */ + #ifndef __INT_SIZE_H__ #define __INT_SIZE_H__ @@ -23,7 +24,7 @@ #define c0sizes2(in,out) out[0]=1.0f;out[1]=1.0f; -#define z0sized2(in,out) out[0]=1.0;out[1]=1.0; +#define z0sized2(in,out) out[0]=1.0;out[1]=1.0; #define s2sizes2(in,size,out) out[0]=size[0];out[1]=size[1]; @@ -65,7 +66,7 @@ #define z2d0sized0(in1,size,in2) (in2==1) ? size[0] : size[1] - +#define d2g2sized0(in1,size1,in2,size2) dallsizea(size1, in2) #endif /* !__INT_SIZE_H__ */ diff --git a/src/c/auxiliaryFunctions/size/dallsizea.c b/src/c/auxiliaryFunctions/size/dallsizea.c new file mode 100644 index 00000000..c757fc3d --- /dev/null +++ b/src/c/auxiliaryFunctions/size/dallsizea.c @@ -0,0 +1,34 @@ +/* + * 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 <stdio.h> +#include <string.h> +#include "size.h" + +double dallsizea(int *size, char *select) +{ + printf("** DEBUG ** select = [%s]\n", select); + if (strcmp(select, "*")) + { + return size[0] * size[1]; + } + if (strcmp(select, "r")) + { + return size[0]; + } + if (strcmp(select, "c")) + { + return size[1]; + } + + return 0; +} |