diff options
author | torset | 2009-02-25 13:39:47 +0000 |
---|---|---|
committer | torset | 2009-02-25 13:39:47 +0000 |
commit | c083d44c466bb3caf2a80d8a7278a57b43e6d627 (patch) | |
tree | 35a9916a28d0e8e4a65ec41fad7ce35abd1fe69c | |
parent | d90147469af33a3a97a139e99bedeb50a5287f2e (diff) | |
download | scilab2c-c083d44c466bb3caf2a80d8a7278a57b43e6d627.tar.gz scilab2c-c083d44c466bb3caf2a80d8a7278a57b43e6d627.tar.bz2 scilab2c-c083d44c466bb3caf2a80d8a7278a57b43e6d627.zip |
Add some headers
-rw-r--r-- | scilab2c/src/elementaryFunctions/Makefile.am | 7 | ||||
-rw-r--r-- | scilab2c/src/elementaryFunctions/Makefile.in | 7 | ||||
-rw-r--r-- | scilab2c/src/elementaryFunctions/includes/ceil.h | 40 | ||||
-rw-r--r-- | scilab2c/src/elementaryFunctions/includes/fix.h | 43 | ||||
-rw-r--r-- | scilab2c/src/elementaryFunctions/includes/floor.h | 40 | ||||
-rw-r--r-- | scilab2c/src/elementaryFunctions/includes/int.h | 40 | ||||
-rw-r--r-- | scilab2c/src/elementaryFunctions/includes/round.h | 40 |
7 files changed, 215 insertions, 2 deletions
diff --git a/scilab2c/src/elementaryFunctions/Makefile.am b/scilab2c/src/elementaryFunctions/Makefile.am index bac3ebdd..66caa2d4 100644 --- a/scilab2c/src/elementaryFunctions/Makefile.am +++ b/scilab2c/src/elementaryFunctions/Makefile.am @@ -32,4 +32,9 @@ SUBDIRS= cos \ asin \ lnp1m1 \ pow \ - atan2 + atan2\ + ceil\ + floor\ + fix\ + int\ + round diff --git a/scilab2c/src/elementaryFunctions/Makefile.in b/scilab2c/src/elementaryFunctions/Makefile.in index e284f84c..646e8908 100644 --- a/scilab2c/src/elementaryFunctions/Makefile.in +++ b/scilab2c/src/elementaryFunctions/Makefile.in @@ -186,7 +186,12 @@ SUBDIRS = cos \ asin \ lnp1m1 \ pow \ - atan2 + atan2\ + ceil\ + floor\ + fix\ + int\ + round all: all-recursive diff --git a/scilab2c/src/elementaryFunctions/includes/ceil.h b/scilab2c/src/elementaryFunctions/includes/ceil.h new file mode 100644 index 00000000..4e64f26e --- /dev/null +++ b/scilab2c/src/elementaryFunctions/includes/ceil.h @@ -0,0 +1,40 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Arnaud Torset + * + * 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 + * + */ + +#ifndef __CEIL_H__ +#define __CEIL_H__ + +#include "floatComplex.h" +#include "doubleComplex.h" + +/* + ceil(x) returns an integer matrix made of rounded up elements +*/ + +float sceils(float in); + +double dceils(double in); + +floatComplex cceils(floatComplex in); + +doubleComplex zceils(doubleComplex in); + +void sceila(float* in, int size, float* out); + +void dceila(double* in, int size, double* out); + +void cceila(floatComplex* in, int size, floatComplex* out); + +void zceila(doubleComplex* in, int size, doubleComplex* out); + +#endif /* !__CEIL_H__ */ + diff --git a/scilab2c/src/elementaryFunctions/includes/fix.h b/scilab2c/src/elementaryFunctions/includes/fix.h new file mode 100644 index 00000000..db4c8ca6 --- /dev/null +++ b/scilab2c/src/elementaryFunctions/includes/fix.h @@ -0,0 +1,43 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Arnaud Torset + * + * 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 + * + */ + +#ifndef __FIX_H__ +#define __FIX_H__ + +#include "floatComplex.h" +#include "doubleComplex.h" + +/* + fix(x) returns an integer matrix made of nearest rounded integers toward zero,i.e, y=sign(x).*floor(abs(x)). Same as int. + In these functions, I take the formula : + if x>=0 y=floor(x) + else y=ceil(x) +*/ + +float sfixs(float in); + +double dfixs(double in); + +floatComplex cfixs(floatComplex in); + +doubleComplex zfixs(doubleComplex in); + +void sfixa(float* in, int size, float* out); + +void dfixa(double* in, int size, double* out); + +void cfixa(floatComplex* in, int size, floatComplex* out); + +void zfixa(doubleComplex* in, int size, doubleComplex* out); + +#endif /* !__FIX_H__ */ + diff --git a/scilab2c/src/elementaryFunctions/includes/floor.h b/scilab2c/src/elementaryFunctions/includes/floor.h new file mode 100644 index 00000000..d33d2370 --- /dev/null +++ b/scilab2c/src/elementaryFunctions/includes/floor.h @@ -0,0 +1,40 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Arnaud Torset + * + * 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 + * + */ + +#ifndef __FLOOR_H__ +#define __FLOOR_H__ + +#include "floatComplex.h" +#include "doubleComplex.h" + +/* + floor(x) returns an integer matrix made of nearest rounded down integers. +*/ + +float sfloors(float in); + +double dfloors(double in); + +floatComplex cfloors(floatComplex in); + +doubleComplex zfloors(doubleComplex in); + +void sfloora(float* in, int size, float* out); + +void dfloora(double* in, int size, double* out); + +void cfloora(floatComplex* in, int size, floatComplex* out); + +void zfloora(doubleComplex* in, int size, doubleComplex* out); + +#endif /* !__FLOOR_H__ */ + diff --git a/scilab2c/src/elementaryFunctions/includes/int.h b/scilab2c/src/elementaryFunctions/includes/int.h new file mode 100644 index 00000000..9ac461a7 --- /dev/null +++ b/scilab2c/src/elementaryFunctions/includes/int.h @@ -0,0 +1,40 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Arnaud Torset + * + * 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 + * + */ + +#ifndef __INT_H__ +#define __INT_H__ + +#include "floatComplex.h" +#include "doubleComplex.h" + +/* + int(X) returns the integer part of the real matrix X. Same as fix. +*/ + +float sints(float in); + +double dints(double in); + +floatComplex cints(floatComplex in); + +doubleComplex zints(doubleComplex in); + +void sinta(float* in, int size, float* out); + +void dinta(double* in, int size, double* out); + +void cinta(floatComplex* in, int size, floatComplex* out); + +void zinta(doubleComplex* in, int size, doubleComplex* out); + +#endif /* !__INT_H__ */ + diff --git a/scilab2c/src/elementaryFunctions/includes/round.h b/scilab2c/src/elementaryFunctions/includes/round.h new file mode 100644 index 00000000..fd98c546 --- /dev/null +++ b/scilab2c/src/elementaryFunctions/includes/round.h @@ -0,0 +1,40 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Arnaud Torset + * + * 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 + * + */ + +#ifndef __ROUND_H__ +#define __ROUND_H__ + +#include "floatComplex.h" +#include "doubleComplex.h" + +/* + round(x) rounds the elements of x to the nearest integers. +*/ + +float srounds(float in); + +double drounds(double in); + +floatComplex crounds(floatComplex in); + +doubleComplex zrounds(doubleComplex in); + +void srounda(float* in, int size, float* out); + +void drounda(double* in, int size, double* out); + +void crounda(floatComplex* in, int size, floatComplex* out); + +void zrounda(doubleComplex* in, int size, doubleComplex* out); + +#endif /* !__ROUND_H__ */ + |