summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrijeshcr2017-08-08 18:55:55 +0530
committerBrijeshcr2017-08-08 18:55:55 +0530
commit14fc3be8d95da244daa1fa12d519ceee8fb97eae (patch)
treecfe22ca03c32d443779d950cdd5b8ccdba78716b
parentad787796e65e1debe25871a98f9713f23d655ae4 (diff)
downloadScilab2C_fossee_old-14fc3be8d95da244daa1fa12d519ceee8fb97eae.tar.gz
Scilab2C_fossee_old-14fc3be8d95da244daa1fa12d519ceee8fb97eae.tar.bz2
Scilab2C_fossee_old-14fc3be8d95da244daa1fa12d519ceee8fb97eae.zip
Added Sind and Tand
-rw-r--r--demos/Brijesh_Demos/test_sind.sci10
-rw-r--r--demos/Brijesh_Demos/test_tand.sci10
-rw-r--r--includes/sci2clib.h9
-rw-r--r--jar/scilab_en_US_help.jarbin11210 -> 11210 bytes
-rw-r--r--macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci12
-rw-r--r--macros/findDeps/getAllHeaders.sci2
-rw-r--r--macros/findDeps/getAllInterfaces.sci2
-rw-r--r--macros/findDeps/getAllSources.sci8
-rw-r--r--src/c/elementaryFunctions/includes/sind.h37
-rw-r--r--src/c/elementaryFunctions/includes/tand (copy).h37
-rw-r--r--src/c/elementaryFunctions/includes/tand.h37
-rw-r--r--src/c/elementaryFunctions/interfaces/int_sind.h23
-rw-r--r--src/c/elementaryFunctions/interfaces/int_tand.h23
-rw-r--r--src/c/elementaryFunctions/sind/dsinda.c20
-rw-r--r--src/c/elementaryFunctions/sind/dsinds.c18
-rw-r--r--src/c/elementaryFunctions/sind/ssinda.c19
-rw-r--r--src/c/elementaryFunctions/sind/ssinds.c19
-rw-r--r--src/c/elementaryFunctions/tand/dtanda.c19
-rw-r--r--src/c/elementaryFunctions/tand/dtands.c18
-rw-r--r--src/c/elementaryFunctions/tand/standa.c19
-rw-r--r--src/c/elementaryFunctions/tand/stands.c19
-rw-r--r--src/c/statisticsFunctions/moment/dmoments.c2
-rw-r--r--src/c/statisticsFunctions/moment/smoments.c2
-rw-r--r--src/c/statisticsFunctions/moment/zmoments.c2
24 files changed, 361 insertions, 6 deletions
diff --git a/demos/Brijesh_Demos/test_sind.sci b/demos/Brijesh_Demos/test_sind.sci
new file mode 100644
index 0000000..7f39166
--- /dev/null
+++ b/demos/Brijesh_Demos/test_sind.sci
@@ -0,0 +1,10 @@
+function test_sind
+ disp('Datatype: Double');
+ i1 = [0 30 45; 60 80 120] ;
+ o1 = sind(i1);
+ disp(o1);
+ disp('Datatype: float');
+ i2 = float([0 30 45; 60 80 120]);
+ o2 = sind(i2);
+ disp(o2);
+endfunction
diff --git a/demos/Brijesh_Demos/test_tand.sci b/demos/Brijesh_Demos/test_tand.sci
new file mode 100644
index 0000000..3143a88
--- /dev/null
+++ b/demos/Brijesh_Demos/test_tand.sci
@@ -0,0 +1,10 @@
+function test_tand
+ disp('Datatype: Double');
+ i1 = [0 30 45; 60 80 120] ;
+ o1 = tand(i1);
+ disp(o1);
+ disp('Datatype: float');
+ i2 = float([0 30 45; 60 80 120]);
+ o2 = tand(i2);
+ disp(o2);
+endfunction
diff --git a/includes/sci2clib.h b/includes/sci2clib.h
index 9a252ee..a67130e 100644
--- a/includes/sci2clib.h
+++ b/includes/sci2clib.h
@@ -168,6 +168,9 @@ extern "C" {
/* interfacing atanh */
#include "atanh.h"
#include "int_atanh.h"
+/* interfacing tand */
+#include "tand.h"
+#include "int_tand.h"
/* interfacing cos */
#include "cos.h"
#include "int_cos.h"
@@ -253,6 +256,9 @@ extern "C" {
/* interfacing sinh */
#include "sinh.h"
#include "int_sinh.h"
+/* interfacing sind */
+#include "sind.h"
+#include "int_sind.h"
/* interfacing sqrt */
#include "sqrt.h"
#include "int_sqrt.h"
@@ -520,12 +526,9 @@ extern "C" {
/*interfacing norm*/
#include "int_norm.h"
#include "norm.h"
-
/*interface Toeplitz */
#include "toeplitz.h"
#include "int_toeplitz.h"
-
-
/*interface Cross */
#include "cross.h"
#include "int_cross.h"
diff --git a/jar/scilab_en_US_help.jar b/jar/scilab_en_US_help.jar
index 45d24f1..0df9ece 100644
--- a/jar/scilab_en_US_help.jar
+++ b/jar/scilab_en_US_help.jar
Binary files differ
diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
index 617f689..768b80e 100644
--- a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
+++ b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
@@ -530,6 +530,7 @@ PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
// --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('s0'+ArgSeparator+'s0',ClassFileName,'file','y');
+PrintStringInfo('s0'+ArgSeparator+'d0',ClassFileName,'file','y');
PrintStringInfo('d0'+ArgSeparator+'d0',ClassFileName,'file','y');
PrintStringInfo('c0'+ArgSeparator+'c0',ClassFileName,'file','y');
PrintStringInfo('z0'+ArgSeparator+'z0',ClassFileName,'file','y');
@@ -539,6 +540,7 @@ PrintStringInfo('u160'+ArgSeparator+'s0',ClassFileName,'file','y');
PrintStringInfo('i160'+ArgSeparator+'s0',ClassFileName,'file','y');
PrintStringInfo('s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'d2',ClassFileName,'file','y');
PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
PrintStringInfo('c2'+ArgSeparator+'c2',ClassFileName,'file','y');
PrintStringInfo('z2'+ArgSeparator+'z2',ClassFileName,'file','y');
@@ -558,6 +560,11 @@ PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file',
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+FunctionName = 'sind'; //BJ : Done AS : Float_Done
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
FunctionName = 'asinh'; //BJ : Done AS : Float_Done
PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
@@ -578,6 +585,11 @@ PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file',
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+FunctionName = 'tand'; //BJ : Done AS : Float_Done
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
FunctionName = 'tanh'; //BJ : Done AS : Float_Done
PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
diff --git a/macros/findDeps/getAllHeaders.sci b/macros/findDeps/getAllHeaders.sci
index d33bf16..3c18621 100644
--- a/macros/findDeps/getAllHeaders.sci
+++ b/macros/findDeps/getAllHeaders.sci
@@ -100,6 +100,7 @@ function allHeaders = getAllHeaders(SharedInfo)
"src/c/elementaryFunctions/includes/dynlib_elementaryfunctions.h"
"src/c/elementaryFunctions/includes/acosh.h"
"src/c/elementaryFunctions/includes/sinh.h"
+ "src/c/elementaryFunctions/includes/sind.h"
"src/c/elementaryFunctions/includes/lnp1m1.h"
"src/c/elementaryFunctions/includes/tanh.h"
"src/c/elementaryFunctions/includes/sqrt.h"
@@ -114,6 +115,7 @@ function allHeaders = getAllHeaders(SharedInfo)
"src/c/elementaryFunctions/includes/asinh.h"
"src/c/elementaryFunctions/includes/atan2.h"
"src/c/elementaryFunctions/includes/atanh.h"
+ "src/c/elementaryFunctions/includes/tand.h"
"src/c/elementaryFunctions/includes/uint8.h"
"src/c/elementaryFunctions/includes/int8.h"
"src/c/elementaryFunctions/includes/uint16.h"
diff --git a/macros/findDeps/getAllInterfaces.sci b/macros/findDeps/getAllInterfaces.sci
index 967051d..6a189f3 100644
--- a/macros/findDeps/getAllInterfaces.sci
+++ b/macros/findDeps/getAllInterfaces.sci
@@ -88,7 +88,9 @@ function allInterfaces = getAllInterfaces(SharedInfo)
"src/c/elementaryFunctions/interfaces/int_log.h"
"src/c/elementaryFunctions/interfaces/int_pow.h"
"src/c/elementaryFunctions/interfaces/int_sin.h"
+ "src/c/elementaryFunctions/interfaces/int_sind.h"
"src/c/elementaryFunctions/interfaces/int_tan.h"
+ "src/c/elementaryFunctions/interfaces/int_tand.h"
"src/c/elementaryFunctions/interfaces/int_acosh.h"
"src/c/elementaryFunctions/interfaces/int_acos.h"
"src/c/elementaryFunctions/interfaces/int_asin.h"
diff --git a/macros/findDeps/getAllSources.sci b/macros/findDeps/getAllSources.sci
index 34f9dd3..bdb3bcc 100644
--- a/macros/findDeps/getAllSources.sci
+++ b/macros/findDeps/getAllSources.sci
@@ -468,6 +468,14 @@ function allSources = getAllSources(SharedInfo,BuildTool)
"src/c/elementaryFunctions/acos/dacoss.c"
"src/c/elementaryFunctions/acos/sacosa.c"
"src/c/elementaryFunctions/acos/sacoss.c"
+ "src/c/elementaryFunctions/tand/dtands.c"
+ "src/c/elementaryFunctions/tand/stands.c"
+ "src/c/elementaryFunctions/tand/dtanda.c"
+ "src/c/elementaryFunctions/tand/standa.c"
+ "src/c/elementaryFunctions/sind/dsinds.c"
+ "src/c/elementaryFunctions/sind/ssinds.c"
+ "src/c/elementaryFunctions/sind/dsinda.c"
+ "src/c/elementaryFunctions/sind/ssinda.c"
"src/c/elementaryFunctions/asin/dasina.c"
"src/c/elementaryFunctions/asin/dasins.c"
"src/c/elementaryFunctions/asin/sasina.c"
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));
}