diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/c/elementaryFunctions/includes/sind.h | 37 | ||||
-rw-r--r-- | src/c/elementaryFunctions/includes/tand (copy).h | 37 | ||||
-rw-r--r-- | src/c/elementaryFunctions/includes/tand.h | 37 | ||||
-rw-r--r-- | src/c/elementaryFunctions/interfaces/int_sind.h | 23 | ||||
-rw-r--r-- | src/c/elementaryFunctions/interfaces/int_tand.h | 23 | ||||
-rw-r--r-- | src/c/elementaryFunctions/sind/dsinda.c | 20 | ||||
-rw-r--r-- | src/c/elementaryFunctions/sind/dsinds.c | 18 | ||||
-rw-r--r-- | src/c/elementaryFunctions/sind/ssinda.c | 19 | ||||
-rw-r--r-- | src/c/elementaryFunctions/sind/ssinds.c | 19 | ||||
-rw-r--r-- | src/c/elementaryFunctions/tand/dtanda.c | 19 | ||||
-rw-r--r-- | src/c/elementaryFunctions/tand/dtands.c | 18 | ||||
-rw-r--r-- | src/c/elementaryFunctions/tand/standa.c | 19 | ||||
-rw-r--r-- | src/c/elementaryFunctions/tand/stands.c | 19 | ||||
-rw-r--r-- | src/c/statisticsFunctions/moment/dmoments.c | 2 | ||||
-rw-r--r-- | src/c/statisticsFunctions/moment/smoments.c | 2 | ||||
-rw-r--r-- | src/c/statisticsFunctions/moment/zmoments.c | 2 |
16 files changed, 311 insertions, 3 deletions
diff --git a/src/c/elementaryFunctions/includes/sind.h b/src/c/elementaryFunctions/includes/sind.h new file mode 100644 index 0000000..d98bd68 --- /dev/null +++ b/src/c/elementaryFunctions/includes/sind.h @@ -0,0 +1,37 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + 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 + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __SIND_H__ +#define __SIND_H__ + +#include "dynlib_elementaryfunctions.h" +#include "floatComplex.h" +#include "doubleComplex.h" +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double dsinds(double x); +float ssinds(float x); +void dsinda(double* x, int size, double* y); +void ssinda(float* x, int size, double* y); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +#endif /* !__SIND_H__ */ + diff --git a/src/c/elementaryFunctions/includes/tand (copy).h b/src/c/elementaryFunctions/includes/tand (copy).h new file mode 100644 index 0000000..918d43a --- /dev/null +++ b/src/c/elementaryFunctions/includes/tand (copy).h @@ -0,0 +1,37 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + 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 + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __TAND_H__ +#define __TAND_H__ + +#include "dynlib_elementaryfunctions.h" +#include "floatComplex.h" +#include "doubleComplex.h" +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +double dtands(double x); +float stands(float x); +void dtanda(double* x, int size, double* y); +void standa(float* x, int size, double* y); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +#endif /* !__TAND_H__ */ + diff --git a/src/c/elementaryFunctions/includes/tand.h b/src/c/elementaryFunctions/includes/tand.h new file mode 100644 index 0000000..918d43a --- /dev/null +++ b/src/c/elementaryFunctions/includes/tand.h @@ -0,0 +1,37 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + 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 + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __TAND_H__ +#define __TAND_H__ + +#include "dynlib_elementaryfunctions.h" +#include "floatComplex.h" +#include "doubleComplex.h" +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +double dtands(double x); +float stands(float x); +void dtanda(double* x, int size, double* y); +void standa(float* x, int size, double* y); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +#endif /* !__TAND_H__ */ + diff --git a/src/c/elementaryFunctions/interfaces/int_sind.h b/src/c/elementaryFunctions/interfaces/int_sind.h new file mode 100644 index 0000000..780a696 --- /dev/null +++ b/src/c/elementaryFunctions/interfaces/int_sind.h @@ -0,0 +1,23 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + 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 + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __INT_SIND_H__ +#define __INT_SIND_H__ + +#define d0sindd0(in) dsinds(in) +#define s0sinds0(in) ssinds(in) +#define s0sindd0(in) ssinds(in) +#define d2sindd2(in, size1, out) dsinda(in, size1[0]*size1[1], out) +#define s2sinds2(in, size1, out) ssinda(in, size1[0]*size1[1], out) +#define s2sindd2(in, size1, out) ssinda(in, size1[0]*size1[1], out) + +#endif /* !__INT_SIND_H__ */ diff --git a/src/c/elementaryFunctions/interfaces/int_tand.h b/src/c/elementaryFunctions/interfaces/int_tand.h new file mode 100644 index 0000000..d2fb30e --- /dev/null +++ b/src/c/elementaryFunctions/interfaces/int_tand.h @@ -0,0 +1,23 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + 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 + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __INT_TAND_H__ +#define __INT_TAND_H__ + +#define d0tandd0(in) dtands(in) +#define s0tands0(in) stands(in) +#define s0tandd0(in) stands(in) +#define d2tandd2(in, size1, out) dtanda(in, size1[0]*size1[1], out) +#define s2tands2(in, size1, out) standa(in, size1[0]*size1[1], out) +#define s2tandd2(in, size1, out) standa(in, size1[0]*size1[1], out) + +#endif /* !__INT_TAND_H__ */ diff --git a/src/c/elementaryFunctions/sind/dsinda.c b/src/c/elementaryFunctions/sind/dsinda.c new file mode 100644 index 0000000..c13fa0c --- /dev/null +++ b/src/c/elementaryFunctions/sind/dsinda.c @@ -0,0 +1,20 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + 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 + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include "sind.h" + +void dsinda(double* x, int size, double* y) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = dsinds(x[i]); + } +} diff --git a/src/c/elementaryFunctions/sind/dsinds.c b/src/c/elementaryFunctions/sind/dsinds.c new file mode 100644 index 0000000..f7dc54f --- /dev/null +++ b/src/c/elementaryFunctions/sind/dsinds.c @@ -0,0 +1,18 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + 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 + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ +#include <math.h> +#include "sind.h" +#define PI 3.1415927 + +double dsinds(double x) { + return sin(x*PI/180); +} diff --git a/src/c/elementaryFunctions/sind/ssinda.c b/src/c/elementaryFunctions/sind/ssinda.c new file mode 100644 index 0000000..baefd68 --- /dev/null +++ b/src/c/elementaryFunctions/sind/ssinda.c @@ -0,0 +1,19 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + 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 + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ +#include "sind.h" + +void ssinda(float* x, int size, double* y) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = ssinds(x[i]); + } +} diff --git a/src/c/elementaryFunctions/sind/ssinds.c b/src/c/elementaryFunctions/sind/ssinds.c new file mode 100644 index 0000000..9d5bf0e --- /dev/null +++ b/src/c/elementaryFunctions/sind/ssinds.c @@ -0,0 +1,19 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + 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 + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ +#include <math.h> +#include "sind.h" +#include "sin.h" +#define PI 3.1415927 + +float ssinds(float x) { + return ssins(x*PI/180); +} diff --git a/src/c/elementaryFunctions/tand/dtanda.c b/src/c/elementaryFunctions/tand/dtanda.c new file mode 100644 index 0000000..e5d56a8 --- /dev/null +++ b/src/c/elementaryFunctions/tand/dtanda.c @@ -0,0 +1,19 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + 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 + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ +#include "tand.h" + +void dtanda(double* x, int size, double* y) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = dtands(x[i]); + } +} diff --git a/src/c/elementaryFunctions/tand/dtands.c b/src/c/elementaryFunctions/tand/dtands.c new file mode 100644 index 0000000..6fda5b7 --- /dev/null +++ b/src/c/elementaryFunctions/tand/dtands.c @@ -0,0 +1,18 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + 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 + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ +#include <math.h> +#include "tand.h" +#define PI 3.1415927 + +double dtands(double x) { + return tan(x*PI/180); +} diff --git a/src/c/elementaryFunctions/tand/standa.c b/src/c/elementaryFunctions/tand/standa.c new file mode 100644 index 0000000..e37f5a0 --- /dev/null +++ b/src/c/elementaryFunctions/tand/standa.c @@ -0,0 +1,19 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + 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 + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ +#include "tand.h" + +void standa(float* x, int size, double* y) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = stands(x[i]); + } +} diff --git a/src/c/elementaryFunctions/tand/stands.c b/src/c/elementaryFunctions/tand/stands.c new file mode 100644 index 0000000..4d66701 --- /dev/null +++ b/src/c/elementaryFunctions/tand/stands.c @@ -0,0 +1,19 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + 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 + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ +#include <math.h> +#include "tand.h" +#include "tan.h" +#define PI 3.1415927 + +float stands(float x) { + return stans(x*PI/180); +} diff --git a/src/c/statisticsFunctions/moment/dmoments.c b/src/c/statisticsFunctions/moment/dmoments.c index b9d8564..779ffa0 100644 --- a/src/c/statisticsFunctions/moment/dmoments.c +++ b/src/c/statisticsFunctions/moment/dmoments.c @@ -8,7 +8,7 @@ double dmoments (double* inp, int size, double ord) { double sum = 0; - for(int i = 0; i < size; i++) + for(int i = 0; i < size; i++) // Elements are raised to the order and then their mean is calculated to give moment { sum = sum + pow(inp[i], ord); } diff --git a/src/c/statisticsFunctions/moment/smoments.c b/src/c/statisticsFunctions/moment/smoments.c index aee9dc9..c900d81 100644 --- a/src/c/statisticsFunctions/moment/smoments.c +++ b/src/c/statisticsFunctions/moment/smoments.c @@ -8,7 +8,7 @@ float smoments (float* inp, int size, double ord) { float sum = 0; - for(int i = 0; i < size; i++) + for(int i = 0; i < size; i++) // Elements are raised to the order and then their mean is calculated to give moment { sum = sum + pow(inp[i], ord); } diff --git a/src/c/statisticsFunctions/moment/zmoments.c b/src/c/statisticsFunctions/moment/zmoments.c index 1b84737..b70df70 100644 --- a/src/c/statisticsFunctions/moment/zmoments.c +++ b/src/c/statisticsFunctions/moment/zmoments.c @@ -13,7 +13,7 @@ doubleComplex zmoments (doubleComplex* inp, int size, double ord) { doubleComplex sum = DoubleComplex(0,0); - for(int i = 0; i < size; i++) + for(int i = 0; i < size; i++) // Elements are raised to the order and then their mean is calculated to give moment { sum = zadds(sum,zpows(inp[i], ord)); } |