summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/c/CACSD/lqe/dlqea.c5
-rw-r--r--src/c/CACSD/lqr/dlqra.c10
-rw-r--r--src/c/CACSD/obscont/dobsconta.c6
-rw-r--r--src/c/auxiliaryFunctions/isnan/cisnans.c11
-rw-r--r--src/c/auxiliaryFunctions/isnan/disnans.c8
-rw-r--r--src/c/auxiliaryFunctions/isnan/sisnans.c8
-rw-r--r--src/c/auxiliaryFunctions/isnan/zisnans.c7
-rw-r--r--src/c/elementaryFunctions/Trigonometry/cosd/dcosda.c16
-rw-r--r--src/c/elementaryFunctions/Trigonometry/cosd/dcosds.c16
-rw-r--r--src/c/elementaryFunctions/Trigonometry/cosd/scosda.c15
-rw-r--r--src/c/elementaryFunctions/Trigonometry/cosd/scosds.c16
-rw-r--r--src/c/elementaryFunctions/Trigonometry/cotd/dcotda.c19
-rw-r--r--src/c/elementaryFunctions/Trigonometry/cotd/dcotds.c18
-rw-r--r--src/c/elementaryFunctions/Trigonometry/cotd/scotda.c13
-rw-r--r--src/c/elementaryFunctions/Trigonometry/cotd/scotds.c16
-rw-r--r--src/c/elementaryFunctions/Trigonometry/coth/ccotha.c14
-rw-r--r--src/c/elementaryFunctions/Trigonometry/coth/ccoths.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/coth/dcotha.c14
-rw-r--r--src/c/elementaryFunctions/Trigonometry/coth/dcoths.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/coth/scotha.c15
-rw-r--r--src/c/elementaryFunctions/Trigonometry/coth/scoths.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/coth/zcotha.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/coth/zcoths.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/csc/ccsca.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/csc/ccscs.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/csc/dcsca.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/csc/dcscs.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/csc/scsca.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/csc/scscs.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/csc/zcsca.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/csc/zcscs.c15
-rw-r--r--src/c/elementaryFunctions/Trigonometry/cscd/ccscda.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/cscd/ccscds.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/cscd/dcscda.c17
-rw-r--r--src/c/elementaryFunctions/Trigonometry/cscd/dcscds.c16
-rw-r--r--src/c/elementaryFunctions/Trigonometry/cscd/scscda.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/cscd/scscds.c17
-rw-r--r--src/c/elementaryFunctions/Trigonometry/cscd/zcscda.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/cscd/zcscds.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/csch/ccscha.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/csch/ccschs.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/csch/dcscha.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/csch/dcschs.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/csch/scscha.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/csch/scschs.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/csch/zcscha.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/csch/zcschs.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/sec/cseca.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/sec/csecs.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/sec/dseca.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/sec/dsecs.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/sec/sseca.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/sec/ssecs.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/sec/zseca.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/sec/zsecs.c63
-rw-r--r--src/c/elementaryFunctions/Trigonometry/secd/dsecda.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/secd/dsecds.c18
-rw-r--r--src/c/elementaryFunctions/Trigonometry/secd/ssecda.c13
-rw-r--r--src/c/elementaryFunctions/Trigonometry/secd/ssecds.c17
-rw-r--r--src/c/elementaryFunctions/Trigonometry/sech/csecha.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/sech/csechs.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/sech/dsecha.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/sech/dsechs.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/sech/ssecha.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/sech/ssechs.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/sech/zsecha.c12
-rw-r--r--src/c/elementaryFunctions/Trigonometry/sech/zsechs.c12
-rw-r--r--src/c/elementaryFunctions/acoth/dacoths.c1
-rw-r--r--src/c/elementaryFunctions/acoth/sacoths.c1
-rw-r--r--src/c/elementaryFunctions/cos/i16coss.c2
-rw-r--r--src/c/elementaryFunctions/cos/i8coss.c2
-rw-r--r--src/c/elementaryFunctions/cos/u16coss.c2
-rw-r--r--src/c/elementaryFunctions/cos/u8coss.c2
-rw-r--r--src/c/elementaryFunctions/discrete_mathematics/factor/dfactors.c9
-rw-r--r--src/c/elementaryFunctions/discrete_mathematics/factor/sfactors.c13
-rw-r--r--src/c/elementaryFunctions/includes/bin2dec.h4
-rw-r--r--src/c/elementaryFunctions/includes/get_float.h2
-rw-r--r--src/c/elementaryFunctions/includes/sec.h4
-rw-r--r--src/c/elementaryFunctions/linspace/dlinspacea.c6
-rw-r--r--src/c/elementaryFunctions/logspace/dlogspacea.c8
-rw-r--r--src/c/elementaryFunctions/radix_conversions/base2dec/gbase2decs.c7
-rw-r--r--src/c/elementaryFunctions/radix_conversions/hex2dec/ghex2decs.c7
-rw-r--r--src/c/elementaryFunctions/sin/i16sins.c2
-rw-r--r--src/c/elementaryFunctions/sin/i8sins.c2
-rw-r--r--src/c/elementaryFunctions/sin/u16sins.c2
-rw-r--r--src/c/elementaryFunctions/sin/u8sins.c2
-rw-r--r--src/c/elementaryFunctions/sinh/i16sinhs.c2
-rw-r--r--src/c/elementaryFunctions/sinh/i8sinhs.c2
-rw-r--r--src/c/elementaryFunctions/sinh/u16sinhs.c2
-rw-r--r--src/c/elementaryFunctions/sinh/u8sinhs.c2
-rw-r--r--src/c/linearAlgebra/balanc/dbalanca.c2
-rw-r--r--src/c/linearAlgebra/rcond/drconda.c8
-rw-r--r--src/c/string/convstr/gconvstrs.c2
93 files changed, 840 insertions, 153 deletions
diff --git a/src/c/CACSD/lqe/dlqea.c b/src/c/CACSD/lqe/dlqea.c
index bc729fb..63f8d62 100644
--- a/src/c/CACSD/lqe/dlqea.c
+++ b/src/c/CACSD/lqe/dlqea.c
@@ -12,6 +12,7 @@
/*Function for calculating lqe gain. Refer 'lqe.sci' in scilab source.*/
+#include <stdlib.h>
#include "lqr.h"
#include "matrixTranspose.h"
@@ -24,8 +25,8 @@ void dlqea(double* sys, int sys_rows, int sys_cols, double* X, double* K)
int sys_lqr_cols = sys_rows + 2;
int no_of_ip, no_of_st;
- no_of_ip = sys[sys_rows*(sys_cols-1)+1];
- no_of_st = sys[sys_rows*(sys_cols-1)];
+ no_of_ip = (int)sys[sys_rows*(sys_cols-1)+1];
+ no_of_st = (int)sys[sys_rows*(sys_cols-1)];
/*Transpose given system and calculate LQR with new system. Transpose result
got from LQR*/
diff --git a/src/c/CACSD/lqr/dlqra.c b/src/c/CACSD/lqr/dlqra.c
index 26a5e6c..02ac150 100644
--- a/src/c/CACSD/lqr/dlqra.c
+++ b/src/c/CACSD/lqr/dlqra.c
@@ -26,8 +26,8 @@ void dlqra(double* sys, int sys_rows, int sys_cols, double* X, double* K)
{
int no_of_states, no_of_inputs, no_of_outputs, dom = 1;
int row,col;
- no_of_states = sys[sys_rows*(sys_cols-1)];
- no_of_inputs = sys[sys_rows*(sys_cols-1) + 1];
+ no_of_states = (int)sys[sys_rows*(sys_cols-1)];
+ no_of_inputs = (int)sys[sys_rows*(sys_cols-1) + 1];
no_of_outputs = sys_rows - no_of_states;
double *A, *B, *C, *D;
@@ -88,7 +88,7 @@ void dlqra(double* sys, int sys_rows, int sys_cols, double* X, double* K)
}
}
- dom = sys[(sys_rows*(sys_cols-2)) + no_of_states];
+ dom = (int)sys[(sys_rows*(sys_cols-2)) + no_of_states];
Q = (double*) malloc (no_of_states*no_of_states*sizeof(double));
R = (double*) malloc (no_of_inputs*no_of_inputs*sizeof(double));
@@ -186,7 +186,7 @@ void dlqra(double* sys, int sys_rows, int sys_cols, double* X, double* K)
/*Find schur decomposition of LA*/
wsmall = (double*) malloc(4*no_of_states*no_of_states*sizeof(double));
- ks = dschura(LA,2*no_of_states,1,2,wsmall,NULL);
+ ks = (int)dschura(LA,2*no_of_states,1,2,wsmall,NULL);
X12 = (double*) malloc(no_of_states*no_of_states*sizeof(double));
phi12 = (double*) malloc(no_of_states*no_of_states*sizeof(double));
@@ -285,7 +285,7 @@ void dlqra(double* sys, int sys_rows, int sys_cols, double* X, double* K)
/*Find schur decomposition of LA*/
wsmall = (double*) malloc(4*no_of_states*no_of_states*sizeof(double));
- ks = dgschura(LA,2*no_of_states,LE,2,2,wsmall,NULL,NULL,NULL);
+ ks = (int)dgschura(LA,2*no_of_states,LE,2,2,wsmall,NULL,NULL,NULL);
X12 = (double*) malloc(no_of_states*no_of_states*sizeof(double));
phi12 = (double*) malloc(no_of_states*no_of_states*sizeof(double));
diff --git a/src/c/CACSD/obscont/dobsconta.c b/src/c/CACSD/obscont/dobsconta.c
index 7e29752..c67b70e 100644
--- a/src/c/CACSD/obscont/dobsconta.c
+++ b/src/c/CACSD/obscont/dobsconta.c
@@ -22,8 +22,8 @@ void dobsconta(double* sys, int sys_rows, int sys_cols, double* Kc, double* Kf,
{
int no_of_states, no_of_inputs, no_of_outputs, dom = 1;
int row,col;
- no_of_states = sys[sys_rows*(sys_cols-1)];
- no_of_inputs = sys[sys_rows*(sys_cols-1) + 1];
+ no_of_states = (int)sys[sys_rows*(sys_cols-1)];
+ no_of_inputs = (int)sys[sys_rows*(sys_cols-1) + 1];
no_of_outputs = sys_rows - no_of_states;
int no_of_cols;
@@ -85,7 +85,7 @@ void dobsconta(double* sys, int sys_rows, int sys_cols, double* Kc, double* Kf,
}
}
- dom = sys[(sys_rows*(sys_cols-2)) + no_of_states];
+ dom = (int)sys[(sys_rows*(sys_cols-2)) + no_of_states];
dmulma(B,no_of_states,no_of_inputs,Kc,no_of_inputs,no_of_states,BKc);
dmulma(Kf,no_of_states,no_of_outputs,C,no_of_outputs,no_of_states,KfC);
diff --git a/src/c/auxiliaryFunctions/isnan/cisnans.c b/src/c/auxiliaryFunctions/isnan/cisnans.c
index 7fc0759..623cea0 100644
--- a/src/c/auxiliaryFunctions/isnan/cisnans.c
+++ b/src/c/auxiliaryFunctions/isnan/cisnans.c
@@ -10,14 +10,11 @@
*
*/
+#ifdef _WIN32
+#include <math.h>
+#endif
-
-#ifdef _MSC_VER
-#include <float.h>
-#define isnan(x) _isnan((double)x)
-#endif
-
-#include "isnan.h"
+#include "isnan.h"
float cisnans(floatComplex in) {
diff --git a/src/c/auxiliaryFunctions/isnan/disnans.c b/src/c/auxiliaryFunctions/isnan/disnans.c
index 0d0a569..99b5b66 100644
--- a/src/c/auxiliaryFunctions/isnan/disnans.c
+++ b/src/c/auxiliaryFunctions/isnan/disnans.c
@@ -10,10 +10,10 @@
*
*/
-#ifdef _MSC_VER
-#include <float.h>
-#define isnan(x) _isnan((double)x)
-#endif
+
+#ifdef _WIN32
+#include <math.h>
+#endif
#include "isnan.h"
diff --git a/src/c/auxiliaryFunctions/isnan/sisnans.c b/src/c/auxiliaryFunctions/isnan/sisnans.c
index 201fd31..905890b 100644
--- a/src/c/auxiliaryFunctions/isnan/sisnans.c
+++ b/src/c/auxiliaryFunctions/isnan/sisnans.c
@@ -10,10 +10,10 @@
*
*/
-#ifdef _MSC_VER
-#include <float.h>
-#define isnan(x) _isnan((double)x)
-#endif
+
+#ifdef _WIN32
+#include <math.h>
+#endif
#include "isnan.h"
diff --git a/src/c/auxiliaryFunctions/isnan/zisnans.c b/src/c/auxiliaryFunctions/isnan/zisnans.c
index b7ebc1b..95cfd97 100644
--- a/src/c/auxiliaryFunctions/isnan/zisnans.c
+++ b/src/c/auxiliaryFunctions/isnan/zisnans.c
@@ -10,10 +10,9 @@
*
*/
-#ifdef _MSC_VER
-#include <float.h>
-#define isnan(x) _isnan((double)x)
-#endif
+#ifdef _WIN32
+#include <math.h>
+#endif
#include "isnan.h"
diff --git a/src/c/elementaryFunctions/Trigonometry/cosd/dcosda.c b/src/c/elementaryFunctions/Trigonometry/cosd/dcosda.c
index b48876e..65a6f4a 100644
--- a/src/c/elementaryFunctions/Trigonometry/cosd/dcosda.c
+++ b/src/c/elementaryFunctions/Trigonometry/cosd/dcosda.c
@@ -1,14 +1,24 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "cosd.h"
#include <math.h>
void dcosda(double* in,int size,double* out)
{
- double val=0.0;
- val =3.14159265/180.0;
int i=0;
for (i=0;i<size;i++)
{
- out[i] = cos(in[i]*val);
+ out[i] = dcosds(in[i]);
}
}
diff --git a/src/c/elementaryFunctions/Trigonometry/cosd/dcosds.c b/src/c/elementaryFunctions/Trigonometry/cosd/dcosds.c
index 4550757..8bc6d4a 100644
--- a/src/c/elementaryFunctions/Trigonometry/cosd/dcosds.c
+++ b/src/c/elementaryFunctions/Trigonometry/cosd/dcosds.c
@@ -1,3 +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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#ifdef _WIN32
+ #define _USE_MATH_DEFINES
+#endif
+
#include <math.h>
#include "cos.h"
#include "cosd.h"
diff --git a/src/c/elementaryFunctions/Trigonometry/cosd/scosda.c b/src/c/elementaryFunctions/Trigonometry/cosd/scosda.c
index 5224899..7e0714d 100644
--- a/src/c/elementaryFunctions/Trigonometry/cosd/scosda.c
+++ b/src/c/elementaryFunctions/Trigonometry/cosd/scosda.c
@@ -1,7 +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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "cos.h"
#include "cosd.h"
-void scosda(float* in, int size, float* out) {
+void scosda(float* in, int size, float* out)
+{
int i = 0;
for (i = 0; i < size; ++i) {
out[i] = scosds(in[i]);
diff --git a/src/c/elementaryFunctions/Trigonometry/cosd/scosds.c b/src/c/elementaryFunctions/Trigonometry/cosd/scosds.c
index e99a195..45c788f 100644
--- a/src/c/elementaryFunctions/Trigonometry/cosd/scosds.c
+++ b/src/c/elementaryFunctions/Trigonometry/cosd/scosds.c
@@ -1,3 +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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#ifdef _WIN32
+ #define _USE_MATH_DEFINES
+#endif
+
#include <math.h>
#include "cosd.h"
#include "cos.h"
diff --git a/src/c/elementaryFunctions/Trigonometry/cotd/dcotda.c b/src/c/elementaryFunctions/Trigonometry/cotd/dcotda.c
index 3cf032a..3a4b23c 100644
--- a/src/c/elementaryFunctions/Trigonometry/cotd/dcotda.c
+++ b/src/c/elementaryFunctions/Trigonometry/cotd/dcotda.c
@@ -1,16 +1,23 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "cotd.h"
-#include <math.h>
-#define PI 3.14159265
void dcotda(double* in,int size,double* out)
{
- double val;
int i=0;
- val = PI / 180.0;
for(i=0;i<size;i++)
{
- out[i]=1/tan(in[i]*val);
- /*printf("The cotangent of %lf degrees is %lf \n", in[i], out[i]);*/
+ out[i]=dcotds(in[i]);
}
}
diff --git a/src/c/elementaryFunctions/Trigonometry/cotd/dcotds.c b/src/c/elementaryFunctions/Trigonometry/cotd/dcotds.c
index 4ba95b8..34befb6 100644
--- a/src/c/elementaryFunctions/Trigonometry/cotd/dcotds.c
+++ b/src/c/elementaryFunctions/Trigonometry/cotd/dcotds.c
@@ -1,9 +1,23 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#ifdef _WIN32
+ #define _USE_MATH_DEFINES
+#endif
+
#include <math.h>
#include "cotd.h"
double dcotds(double in)
{
-if(in==0)
-printf("Inf\n");
return (1/tan((M_PI/180.0)*in));
}
diff --git a/src/c/elementaryFunctions/Trigonometry/cotd/scotda.c b/src/c/elementaryFunctions/Trigonometry/cotd/scotda.c
index fd5a1e1..fbdf0f5 100644
--- a/src/c/elementaryFunctions/Trigonometry/cotd/scotda.c
+++ b/src/c/elementaryFunctions/Trigonometry/cotd/scotda.c
@@ -1,9 +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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
#include "cotd.h"
void scotda(float* in, int size, float* out) {
int i = 0;
for (i = 0; i < size; ++i) {
- out[i] = scosds(in[i]);
+ out[i] = scotds(in[i]);
}
}
diff --git a/src/c/elementaryFunctions/Trigonometry/cotd/scotds.c b/src/c/elementaryFunctions/Trigonometry/cotd/scotds.c
index d635dbc..e7e02b9 100644
--- a/src/c/elementaryFunctions/Trigonometry/cotd/scotds.c
+++ b/src/c/elementaryFunctions/Trigonometry/cotd/scotds.c
@@ -1,3 +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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#ifdef _WIN32
+ #define _USE_MATH_DEFINES
+#endif
+
#include <math.h>
#include "cotd.h"
diff --git a/src/c/elementaryFunctions/Trigonometry/coth/ccotha.c b/src/c/elementaryFunctions/Trigonometry/coth/ccotha.c
index 4e79451..44a366e 100644
--- a/src/c/elementaryFunctions/Trigonometry/coth/ccotha.c
+++ b/src/c/elementaryFunctions/Trigonometry/coth/ccotha.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "coth.h"
#include <math.h>
@@ -8,5 +20,5 @@ void ccotha(floatComplex* in, int size,floatComplex* out)
{
out[i] = ccoths(in[i]);
}
- return out;
+
}
diff --git a/src/c/elementaryFunctions/Trigonometry/coth/ccoths.c b/src/c/elementaryFunctions/Trigonometry/coth/ccoths.c
index 564b8e6..b7f9026 100644
--- a/src/c/elementaryFunctions/Trigonometry/coth/ccoths.c
+++ b/src/c/elementaryFunctions/Trigonometry/coth/ccoths.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include <math.h>
#include "coth.h"
#include <math.h>
diff --git a/src/c/elementaryFunctions/Trigonometry/coth/dcotha.c b/src/c/elementaryFunctions/Trigonometry/coth/dcotha.c
index f6304f5..bb54b20 100644
--- a/src/c/elementaryFunctions/Trigonometry/coth/dcotha.c
+++ b/src/c/elementaryFunctions/Trigonometry/coth/dcotha.c
@@ -1,14 +1,24 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "coth.h"
#include <math.h>
void dcotha(double* in,int size,double* out)
{
- double val;
int i=0;
for(i=0;i<size;i++)
{
out[i]=cosh(in[i])/sinh(in[i]);
- /*printf("The cotangent of %lf is %lf\n", in[i], out[i]);*/
}
}
diff --git a/src/c/elementaryFunctions/Trigonometry/coth/dcoths.c b/src/c/elementaryFunctions/Trigonometry/coth/dcoths.c
index bf6bb78..55c9a5b 100644
--- a/src/c/elementaryFunctions/Trigonometry/coth/dcoths.c
+++ b/src/c/elementaryFunctions/Trigonometry/coth/dcoths.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include <math.h>
#include "coth.h"
#include "cosh.h"
diff --git a/src/c/elementaryFunctions/Trigonometry/coth/scotha.c b/src/c/elementaryFunctions/Trigonometry/coth/scotha.c
index 3fdf37f..5335162 100644
--- a/src/c/elementaryFunctions/Trigonometry/coth/scotha.c
+++ b/src/c/elementaryFunctions/Trigonometry/coth/scotha.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "coth.h"
#include <math.h>
@@ -8,7 +20,6 @@ void scotha(float* in,int size,float* out)
for(i=0;i<size;i++)
{
out[i]=cosh(in[i])/sinh(in[i]);
- /*printf("The cotangent of %lf is %lf\n", in[i], out[i]);*/
- }
+ }
}
diff --git a/src/c/elementaryFunctions/Trigonometry/coth/scoths.c b/src/c/elementaryFunctions/Trigonometry/coth/scoths.c
index 107945e..2865f56 100644
--- a/src/c/elementaryFunctions/Trigonometry/coth/scoths.c
+++ b/src/c/elementaryFunctions/Trigonometry/coth/scoths.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include <math.h>
#include "coth.h"
#include "cosh.h"
diff --git a/src/c/elementaryFunctions/Trigonometry/coth/zcotha.c b/src/c/elementaryFunctions/Trigonometry/coth/zcotha.c
index dcbb284..206cc43 100644
--- a/src/c/elementaryFunctions/Trigonometry/coth/zcotha.c
+++ b/src/c/elementaryFunctions/Trigonometry/coth/zcotha.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "coth.h"
#include <math.h>
diff --git a/src/c/elementaryFunctions/Trigonometry/coth/zcoths.c b/src/c/elementaryFunctions/Trigonometry/coth/zcoths.c
index 2eed86b..8b3b19f 100644
--- a/src/c/elementaryFunctions/Trigonometry/coth/zcoths.c
+++ b/src/c/elementaryFunctions/Trigonometry/coth/zcoths.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "coth.h"
#include "tanh.h"
#include "tan.h"
diff --git a/src/c/elementaryFunctions/Trigonometry/csc/ccsca.c b/src/c/elementaryFunctions/Trigonometry/csc/ccsca.c
index 5f5504a..7ec9a6b 100644
--- a/src/c/elementaryFunctions/Trigonometry/csc/ccsca.c
+++ b/src/c/elementaryFunctions/Trigonometry/csc/ccsca.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "csc.h"
#include <math.h>
diff --git a/src/c/elementaryFunctions/Trigonometry/csc/ccscs.c b/src/c/elementaryFunctions/Trigonometry/csc/ccscs.c
index af8b3eb..f16aa1b 100644
--- a/src/c/elementaryFunctions/Trigonometry/csc/ccscs.c
+++ b/src/c/elementaryFunctions/Trigonometry/csc/ccscs.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include <math.h>
#include "sin.h"
#include "cos.h"
diff --git a/src/c/elementaryFunctions/Trigonometry/csc/dcsca.c b/src/c/elementaryFunctions/Trigonometry/csc/dcsca.c
index eeedea5..b1a3cf3 100644
--- a/src/c/elementaryFunctions/Trigonometry/csc/dcsca.c
+++ b/src/c/elementaryFunctions/Trigonometry/csc/dcsca.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "csc.h"
void dcsca(double* in,int size,double* out)
diff --git a/src/c/elementaryFunctions/Trigonometry/csc/dcscs.c b/src/c/elementaryFunctions/Trigonometry/csc/dcscs.c
index 31a6944..f9e128c 100644
--- a/src/c/elementaryFunctions/Trigonometry/csc/dcscs.c
+++ b/src/c/elementaryFunctions/Trigonometry/csc/dcscs.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "csc.h"
#include <math.h>
diff --git a/src/c/elementaryFunctions/Trigonometry/csc/scsca.c b/src/c/elementaryFunctions/Trigonometry/csc/scsca.c
index 3e6963a..cea8338 100644
--- a/src/c/elementaryFunctions/Trigonometry/csc/scsca.c
+++ b/src/c/elementaryFunctions/Trigonometry/csc/scsca.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "csc.h"
void scsca(float* in,int size,float* out)
diff --git a/src/c/elementaryFunctions/Trigonometry/csc/scscs.c b/src/c/elementaryFunctions/Trigonometry/csc/scscs.c
index 6d1b1b7..f0ad15e 100644
--- a/src/c/elementaryFunctions/Trigonometry/csc/scscs.c
+++ b/src/c/elementaryFunctions/Trigonometry/csc/scscs.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "csc.h"
#include <math.h>
diff --git a/src/c/elementaryFunctions/Trigonometry/csc/zcsca.c b/src/c/elementaryFunctions/Trigonometry/csc/zcsca.c
index 4b8cdad..5943092 100644
--- a/src/c/elementaryFunctions/Trigonometry/csc/zcsca.c
+++ b/src/c/elementaryFunctions/Trigonometry/csc/zcsca.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "csc.h"
#include <math.h>
diff --git a/src/c/elementaryFunctions/Trigonometry/csc/zcscs.c b/src/c/elementaryFunctions/Trigonometry/csc/zcscs.c
index bbb1526..64fce57 100644
--- a/src/c/elementaryFunctions/Trigonometry/csc/zcscs.c
+++ b/src/c/elementaryFunctions/Trigonometry/csc/zcscs.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include <math.h>
#include "sin.h"
#include "cos.h"
@@ -9,10 +21,7 @@
doubleComplex zcscs(doubleComplex z)
{
- doubleComplex out;
- //out = zrdivs(DoubleComplex(1,0),zsins(z));
double real = zreals(z);
double imag = zimags(z);
return zrdivs(DoubleComplex(1,0),(DoubleComplex(dsins(real) * dcoshs(imag), dcoss(real) * dsinhs(imag))));
- //return out;
}
diff --git a/src/c/elementaryFunctions/Trigonometry/cscd/ccscda.c b/src/c/elementaryFunctions/Trigonometry/cscd/ccscda.c
index d18d3c7..ed13f9e 100644
--- a/src/c/elementaryFunctions/Trigonometry/cscd/ccscda.c
+++ b/src/c/elementaryFunctions/Trigonometry/cscd/ccscda.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "csc.h"
#include "cscd.h"
#include <math.h>
diff --git a/src/c/elementaryFunctions/Trigonometry/cscd/ccscds.c b/src/c/elementaryFunctions/Trigonometry/cscd/ccscds.c
index 8f1f9f7..39b2576 100644
--- a/src/c/elementaryFunctions/Trigonometry/cscd/ccscds.c
+++ b/src/c/elementaryFunctions/Trigonometry/cscd/ccscds.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include <math.h>
#include "sin.h"
#include "cos.h"
diff --git a/src/c/elementaryFunctions/Trigonometry/cscd/dcscda.c b/src/c/elementaryFunctions/Trigonometry/cscd/dcscda.c
index 43e0043..8ca3df9 100644
--- a/src/c/elementaryFunctions/Trigonometry/cscd/dcscda.c
+++ b/src/c/elementaryFunctions/Trigonometry/cscd/dcscda.c
@@ -1,15 +1,24 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "cscd.h"
#include <math.h>
-#define PI 3.14159265
void dcscda(double* in,int size,double* out)
{
- double val;
int i=0;
- val = PI / 180.0;
for(i=0;i<size;i++)
{
- out[i]=1/sin(in[i]*val);
+ out[i]=dcscds(in[i]);
}
}
diff --git a/src/c/elementaryFunctions/Trigonometry/cscd/dcscds.c b/src/c/elementaryFunctions/Trigonometry/cscd/dcscds.c
index d9a0df9..af4dc30 100644
--- a/src/c/elementaryFunctions/Trigonometry/cscd/dcscds.c
+++ b/src/c/elementaryFunctions/Trigonometry/cscd/dcscds.c
@@ -1,3 +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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#ifdef _WIN32
+ #define _USE_MATH_DEFINES
+#endif
+
#include "cscd.h"
#include <math.h>
diff --git a/src/c/elementaryFunctions/Trigonometry/cscd/scscda.c b/src/c/elementaryFunctions/Trigonometry/cscd/scscda.c
index 761d941..1793662 100644
--- a/src/c/elementaryFunctions/Trigonometry/cscd/scscda.c
+++ b/src/c/elementaryFunctions/Trigonometry/cscd/scscda.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "cscd.h"
void scscda(float* in,int size,float* out)
diff --git a/src/c/elementaryFunctions/Trigonometry/cscd/scscds.c b/src/c/elementaryFunctions/Trigonometry/cscd/scscds.c
index d434854..ebf36d2 100644
--- a/src/c/elementaryFunctions/Trigonometry/cscd/scscds.c
+++ b/src/c/elementaryFunctions/Trigonometry/cscd/scscds.c
@@ -1,3 +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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#ifdef _WIN32
+ #define _USE_MATH_DEFINES
+#endif
+
+
#include "cscd.h"
#include <math.h>
diff --git a/src/c/elementaryFunctions/Trigonometry/cscd/zcscda.c b/src/c/elementaryFunctions/Trigonometry/cscd/zcscda.c
index 02f9e3b..a8a617c 100644
--- a/src/c/elementaryFunctions/Trigonometry/cscd/zcscda.c
+++ b/src/c/elementaryFunctions/Trigonometry/cscd/zcscda.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "csc.h"
#include "cscd.h"
#include <math.h>
diff --git a/src/c/elementaryFunctions/Trigonometry/cscd/zcscds.c b/src/c/elementaryFunctions/Trigonometry/cscd/zcscds.c
index 351c8ff..47d5dfc 100644
--- a/src/c/elementaryFunctions/Trigonometry/cscd/zcscds.c
+++ b/src/c/elementaryFunctions/Trigonometry/cscd/zcscds.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include <math.h>
#include "sin.h"
#include "cos.h"
diff --git a/src/c/elementaryFunctions/Trigonometry/csch/ccscha.c b/src/c/elementaryFunctions/Trigonometry/csch/ccscha.c
index 02a9ec1..a95da20 100644
--- a/src/c/elementaryFunctions/Trigonometry/csch/ccscha.c
+++ b/src/c/elementaryFunctions/Trigonometry/csch/ccscha.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "csch.h"
#include <math.h>
diff --git a/src/c/elementaryFunctions/Trigonometry/csch/ccschs.c b/src/c/elementaryFunctions/Trigonometry/csch/ccschs.c
index 177a9fa..ddcc733 100644
--- a/src/c/elementaryFunctions/Trigonometry/csch/ccschs.c
+++ b/src/c/elementaryFunctions/Trigonometry/csch/ccschs.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "csch.h"
#include "sinh.h"
#include "sin.h"
diff --git a/src/c/elementaryFunctions/Trigonometry/csch/dcscha.c b/src/c/elementaryFunctions/Trigonometry/csch/dcscha.c
index ce87b6f..3248905 100644
--- a/src/c/elementaryFunctions/Trigonometry/csch/dcscha.c
+++ b/src/c/elementaryFunctions/Trigonometry/csch/dcscha.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "csch.h"
void dcscha(double* in, int size, double* out) {
diff --git a/src/c/elementaryFunctions/Trigonometry/csch/dcschs.c b/src/c/elementaryFunctions/Trigonometry/csch/dcschs.c
index 3b22544..7b1f15a 100644
--- a/src/c/elementaryFunctions/Trigonometry/csch/dcschs.c
+++ b/src/c/elementaryFunctions/Trigonometry/csch/dcschs.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "csch.h"
#include <math.h>
diff --git a/src/c/elementaryFunctions/Trigonometry/csch/scscha.c b/src/c/elementaryFunctions/Trigonometry/csch/scscha.c
index 880ffaa..18d5ea7 100644
--- a/src/c/elementaryFunctions/Trigonometry/csch/scscha.c
+++ b/src/c/elementaryFunctions/Trigonometry/csch/scscha.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "csch.h"
void scscha(float* in, int size, float* out) {
diff --git a/src/c/elementaryFunctions/Trigonometry/csch/scschs.c b/src/c/elementaryFunctions/Trigonometry/csch/scschs.c
index 8cd4e62..ec55085 100644
--- a/src/c/elementaryFunctions/Trigonometry/csch/scschs.c
+++ b/src/c/elementaryFunctions/Trigonometry/csch/scschs.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "csch.h"
#include <math.h>
diff --git a/src/c/elementaryFunctions/Trigonometry/csch/zcscha.c b/src/c/elementaryFunctions/Trigonometry/csch/zcscha.c
index ae659de..fab5cc4 100644
--- a/src/c/elementaryFunctions/Trigonometry/csch/zcscha.c
+++ b/src/c/elementaryFunctions/Trigonometry/csch/zcscha.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "csch.h"
#include <math.h>
diff --git a/src/c/elementaryFunctions/Trigonometry/csch/zcschs.c b/src/c/elementaryFunctions/Trigonometry/csch/zcschs.c
index f3a9b22..33a4fcc 100644
--- a/src/c/elementaryFunctions/Trigonometry/csch/zcschs.c
+++ b/src/c/elementaryFunctions/Trigonometry/csch/zcschs.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "csch.h"
#include "sinh.h"
#include "sin.h"
diff --git a/src/c/elementaryFunctions/Trigonometry/sec/cseca.c b/src/c/elementaryFunctions/Trigonometry/sec/cseca.c
index 139360a..fcb9b81 100644
--- a/src/c/elementaryFunctions/Trigonometry/sec/cseca.c
+++ b/src/c/elementaryFunctions/Trigonometry/sec/cseca.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "sec.h"
#include <math.h>
diff --git a/src/c/elementaryFunctions/Trigonometry/sec/csecs.c b/src/c/elementaryFunctions/Trigonometry/sec/csecs.c
index 51ea224..c2d9b9e 100644
--- a/src/c/elementaryFunctions/Trigonometry/sec/csecs.c
+++ b/src/c/elementaryFunctions/Trigonometry/sec/csecs.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "sec.h"
#include "cos.h"
#include <math.h>
diff --git a/src/c/elementaryFunctions/Trigonometry/sec/dseca.c b/src/c/elementaryFunctions/Trigonometry/sec/dseca.c
index 986b52f..c39f7c6 100644
--- a/src/c/elementaryFunctions/Trigonometry/sec/dseca.c
+++ b/src/c/elementaryFunctions/Trigonometry/sec/dseca.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "sec.h"
#include <math.h>
diff --git a/src/c/elementaryFunctions/Trigonometry/sec/dsecs.c b/src/c/elementaryFunctions/Trigonometry/sec/dsecs.c
index 9135ad1..5278b37 100644
--- a/src/c/elementaryFunctions/Trigonometry/sec/dsecs.c
+++ b/src/c/elementaryFunctions/Trigonometry/sec/dsecs.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include <math.h>
#include "sec.h"
diff --git a/src/c/elementaryFunctions/Trigonometry/sec/sseca.c b/src/c/elementaryFunctions/Trigonometry/sec/sseca.c
index f5fd81b..0ac7cc6 100644
--- a/src/c/elementaryFunctions/Trigonometry/sec/sseca.c
+++ b/src/c/elementaryFunctions/Trigonometry/sec/sseca.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "sec.h"
void sseca(float* in, int size, float* out) {
diff --git a/src/c/elementaryFunctions/Trigonometry/sec/ssecs.c b/src/c/elementaryFunctions/Trigonometry/sec/ssecs.c
index 2c9e018..ad48000 100644
--- a/src/c/elementaryFunctions/Trigonometry/sec/ssecs.c
+++ b/src/c/elementaryFunctions/Trigonometry/sec/ssecs.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include <math.h>
#include "sec.h"
diff --git a/src/c/elementaryFunctions/Trigonometry/sec/zseca.c b/src/c/elementaryFunctions/Trigonometry/sec/zseca.c
index 7a80291..dec365d 100644
--- a/src/c/elementaryFunctions/Trigonometry/sec/zseca.c
+++ b/src/c/elementaryFunctions/Trigonometry/sec/zseca.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "sec.h"
#include <math.h>
diff --git a/src/c/elementaryFunctions/Trigonometry/sec/zsecs.c b/src/c/elementaryFunctions/Trigonometry/sec/zsecs.c
index b5468db..9629db7 100644
--- a/src/c/elementaryFunctions/Trigonometry/sec/zsecs.c
+++ b/src/c/elementaryFunctions/Trigonometry/sec/zsecs.c
@@ -1,57 +1,26 @@
-/*//#include "sec.h"
-//#include "cos.h"
-//#include <math.h>
-//#include "doubleComplex.h"
-//#include "division.h"
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
*/
-/*#include <math.h>
-#include "sin.h"
+
+#include "sec.h"
#include "cos.h"
-#include "sinh.h"
-#include "cosh.h"
-#include "csc.h"
+#include <math.h>
+#include "doubleComplex.h"
#include "division.h"
-*/
-#include <complex.h>
-#include <stdio.h>
-/*doubleComplex zsecs(doubleComplex z)
+doubleComplex zsecs(doubleComplex z)
{
doubleComplex out;
out = zrdivs(DoubleComplex(1,0),zcoss(z));
return out;
-}
-*/
-void zsecs(double complex z)
-{
-
- //double complex out;
- /*out = zrdivs(DoubleComplex(1,0),zcoss(z));
- return out;
-}*/
-
- double complex out = 1.0/(ccos(z));
- if(cimag(out)==0.0)
- {
- printf("%.7lf\n",creal(out));
- //out=creal(out);
- }
- else if(creal(out)==0.0)
- {
- printf("%.7lfi\n",cimag(out));
- //out=cimag(out);
- }
- else if(creal(out)!=0.0 && cimag(out)<0.0)
- {
- printf("%.7lf %.7lfi\n",creal(out),cimag(out));
- //out=x;
- }
- else
- {
- printf("%.7lf + %.7lfi\n", creal(out), cimag(out));
- //out=x;
- }
- //return out;
-}
+} \ No newline at end of file
diff --git a/src/c/elementaryFunctions/Trigonometry/secd/dsecda.c b/src/c/elementaryFunctions/Trigonometry/secd/dsecda.c
index 028595c..f9f70f0 100644
--- a/src/c/elementaryFunctions/Trigonometry/secd/dsecda.c
+++ b/src/c/elementaryFunctions/Trigonometry/secd/dsecda.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "secd.h"
#include <math.h>
diff --git a/src/c/elementaryFunctions/Trigonometry/secd/dsecds.c b/src/c/elementaryFunctions/Trigonometry/secd/dsecds.c
index 7b08a46..aa95f29 100644
--- a/src/c/elementaryFunctions/Trigonometry/secd/dsecds.c
+++ b/src/c/elementaryFunctions/Trigonometry/secd/dsecds.c
@@ -1,3 +1,21 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+#ifdef _WIN32
+ #define _USE_MATH_DEFINES
+#endif
+
+
#include <math.h>
#include "sec.h"
#include "secd.h"
diff --git a/src/c/elementaryFunctions/Trigonometry/secd/ssecda.c b/src/c/elementaryFunctions/Trigonometry/secd/ssecda.c
index 6267f94..c1fc5e5 100644
--- a/src/c/elementaryFunctions/Trigonometry/secd/ssecda.c
+++ b/src/c/elementaryFunctions/Trigonometry/secd/ssecda.c
@@ -1,3 +1,16 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
#include "sec.h"
#include "secd.h"
diff --git a/src/c/elementaryFunctions/Trigonometry/secd/ssecds.c b/src/c/elementaryFunctions/Trigonometry/secd/ssecds.c
index 3fabb22..eaf3a29 100644
--- a/src/c/elementaryFunctions/Trigonometry/secd/ssecds.c
+++ b/src/c/elementaryFunctions/Trigonometry/secd/ssecds.c
@@ -1,3 +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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+#ifdef _WIN32
+ #define _USE_MATH_DEFINES
+#endif
+
#include <math.h>
#include "secd.h"
#include "sec.h"
diff --git a/src/c/elementaryFunctions/Trigonometry/sech/csecha.c b/src/c/elementaryFunctions/Trigonometry/sech/csecha.c
index dcd76d5..c8d52d8 100644
--- a/src/c/elementaryFunctions/Trigonometry/sech/csecha.c
+++ b/src/c/elementaryFunctions/Trigonometry/sech/csecha.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "sech.h"
#include <math.h>
diff --git a/src/c/elementaryFunctions/Trigonometry/sech/csechs.c b/src/c/elementaryFunctions/Trigonometry/sech/csechs.c
index 37ba6d9..e707e8b 100644
--- a/src/c/elementaryFunctions/Trigonometry/sech/csechs.c
+++ b/src/c/elementaryFunctions/Trigonometry/sech/csechs.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "sech.h"
#include "sec.h"
#include <math.h>
diff --git a/src/c/elementaryFunctions/Trigonometry/sech/dsecha.c b/src/c/elementaryFunctions/Trigonometry/sech/dsecha.c
index cfab81f..4092c9e 100644
--- a/src/c/elementaryFunctions/Trigonometry/sech/dsecha.c
+++ b/src/c/elementaryFunctions/Trigonometry/sech/dsecha.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "sech.h"
#include <math.h>
void dsecha(double* in,int size,double* out)
diff --git a/src/c/elementaryFunctions/Trigonometry/sech/dsechs.c b/src/c/elementaryFunctions/Trigonometry/sech/dsechs.c
index 10ca392..fdcfd69 100644
--- a/src/c/elementaryFunctions/Trigonometry/sech/dsechs.c
+++ b/src/c/elementaryFunctions/Trigonometry/sech/dsechs.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include <math.h>
#include "sech.h"
#include "cosh.h"
diff --git a/src/c/elementaryFunctions/Trigonometry/sech/ssecha.c b/src/c/elementaryFunctions/Trigonometry/sech/ssecha.c
index 1d26563..d7e71b3 100644
--- a/src/c/elementaryFunctions/Trigonometry/sech/ssecha.c
+++ b/src/c/elementaryFunctions/Trigonometry/sech/ssecha.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "sech.h"
#include <math.h>
void ssecha(float* in,int size,float* out)
diff --git a/src/c/elementaryFunctions/Trigonometry/sech/ssechs.c b/src/c/elementaryFunctions/Trigonometry/sech/ssechs.c
index f582fd7..9fcd50b 100644
--- a/src/c/elementaryFunctions/Trigonometry/sech/ssechs.c
+++ b/src/c/elementaryFunctions/Trigonometry/sech/ssechs.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include <math.h>
#include "sech.h"
#include "cosh.h"
diff --git a/src/c/elementaryFunctions/Trigonometry/sech/zsecha.c b/src/c/elementaryFunctions/Trigonometry/sech/zsecha.c
index c48f8da..a3c3189 100644
--- a/src/c/elementaryFunctions/Trigonometry/sech/zsecha.c
+++ b/src/c/elementaryFunctions/Trigonometry/sech/zsecha.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "sech.h"
#include <math.h>
diff --git a/src/c/elementaryFunctions/Trigonometry/sech/zsechs.c b/src/c/elementaryFunctions/Trigonometry/sech/zsechs.c
index 93c95b3..d23d2ef 100644
--- a/src/c/elementaryFunctions/Trigonometry/sech/zsechs.c
+++ b/src/c/elementaryFunctions/Trigonometry/sech/zsechs.c
@@ -1,3 +1,15 @@
+/* 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: Shamik Guha
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
#include "sech.h"
#include "sec.h"
#include <math.h>
diff --git a/src/c/elementaryFunctions/acoth/dacoths.c b/src/c/elementaryFunctions/acoth/dacoths.c
index a2dd875..aa20a7b 100644
--- a/src/c/elementaryFunctions/acoth/dacoths.c
+++ b/src/c/elementaryFunctions/acoth/dacoths.c
@@ -9,6 +9,7 @@
// Author: Ashish Kamble
// Email: toolbox@scilab.in
+#include <math.h>
#include "acoth.h"
#include "log.h"
diff --git a/src/c/elementaryFunctions/acoth/sacoths.c b/src/c/elementaryFunctions/acoth/sacoths.c
index 12f5381..9a2137a 100644
--- a/src/c/elementaryFunctions/acoth/sacoths.c
+++ b/src/c/elementaryFunctions/acoth/sacoths.c
@@ -9,6 +9,7 @@
// Author: Ashish Kamble
// Email: toolbox@scilab.in
+#include <math.h>
#include "acoth.h"
#include "log.h"
diff --git a/src/c/elementaryFunctions/cos/i16coss.c b/src/c/elementaryFunctions/cos/i16coss.c
index ce345d7..787f713 100644
--- a/src/c/elementaryFunctions/cos/i16coss.c
+++ b/src/c/elementaryFunctions/cos/i16coss.c
@@ -14,5 +14,5 @@
#include "cos.h"
float i16coss(int16 x) {
- return (cos(x));
+ return (cos((double)x));
}
diff --git a/src/c/elementaryFunctions/cos/i8coss.c b/src/c/elementaryFunctions/cos/i8coss.c
index 02d8216..4b344e1 100644
--- a/src/c/elementaryFunctions/cos/i8coss.c
+++ b/src/c/elementaryFunctions/cos/i8coss.c
@@ -14,5 +14,5 @@
#include "cos.h"
float i8coss(int8 x) {
- return (cos(x));
+ return (cos((double)x));
}
diff --git a/src/c/elementaryFunctions/cos/u16coss.c b/src/c/elementaryFunctions/cos/u16coss.c
index c4c8616..fb25ac5 100644
--- a/src/c/elementaryFunctions/cos/u16coss.c
+++ b/src/c/elementaryFunctions/cos/u16coss.c
@@ -14,5 +14,5 @@
#include "cos.h"
float u16coss(uint16 x) {
- return (cos(x));
+ return (cos((double)x));
}
diff --git a/src/c/elementaryFunctions/cos/u8coss.c b/src/c/elementaryFunctions/cos/u8coss.c
index 30400c1..26e2eba 100644
--- a/src/c/elementaryFunctions/cos/u8coss.c
+++ b/src/c/elementaryFunctions/cos/u8coss.c
@@ -14,5 +14,5 @@
#include "cos.h"
float u8coss(uint8 x) {
- return (cos(x));
+ return (cos((double)x));
}
diff --git a/src/c/elementaryFunctions/discrete_mathematics/factor/dfactors.c b/src/c/elementaryFunctions/discrete_mathematics/factor/dfactors.c
index 9801943..9ac76b5 100644
--- a/src/c/elementaryFunctions/discrete_mathematics/factor/dfactors.c
+++ b/src/c/elementaryFunctions/discrete_mathematics/factor/dfactors.c
@@ -18,17 +18,15 @@ void dfactors(double in,double* out)
int n=(int)in;
while (n%2 == 0)
{
- //printf("%d ", 2);
- out[k++]=2;
+ out[k++]=2;
n = n/2;
}
- for (i = 3; i <= sqrt(n); i = i+2)
+ for (i = 3; i <= (int)sqrt((double)n); i = i+2)
{
while (n%i == 0)
{
- out[k++]=i;
- //printf("%d ", i);
+ out[k++]=i;
n = n/i;
}
}
@@ -36,7 +34,6 @@ void dfactors(double in,double* out)
if (n > 2)
{
out[k++]=n;
- //printf ("%d ", n);
}
}
diff --git a/src/c/elementaryFunctions/discrete_mathematics/factor/sfactors.c b/src/c/elementaryFunctions/discrete_mathematics/factor/sfactors.c
index 2e5ba47..a2eed09 100644
--- a/src/c/elementaryFunctions/discrete_mathematics/factor/sfactors.c
+++ b/src/c/elementaryFunctions/discrete_mathematics/factor/sfactors.c
@@ -18,25 +18,22 @@ void sfactors(float in,float* out)
int n=(int)in;
while (n%2 == 0)
{
- //printf("%d ", 2);
- out[k++]=2;
+ out[k++]=2;
n = n/2;
}
- for (i = 3; i <= sqrt(n); i = i+2)
+ for (i = 3; i <= (int)sqrt((double)n); i = i+2)
{
while (n%i == 0)
{
- out[k++]=i;
- //printf("%d ", i);
+ out[k++]=i;
n = n/i;
}
}
- if (n > 2)
+ if (n > 2)
{
out[k++]=n;
- //printf ("%d ", n);
- }
+ }
}
diff --git a/src/c/elementaryFunctions/includes/bin2dec.h b/src/c/elementaryFunctions/includes/bin2dec.h
index 792e368..ea1585f 100644
--- a/src/c/elementaryFunctions/includes/bin2dec.h
+++ b/src/c/elementaryFunctions/includes/bin2dec.h
@@ -19,13 +19,13 @@ extern "C" {
long double dbin2decs(long double in);
int8 i8bin2decs(int8 in);
-//int16 i16bin2decs(int16 in);
+int16 i16bin2decs(int16 in);
uint8 u8bin2decs(uint8 in);
uint16 u16bin2decs(uint16 in);
void dbin2deca(double* in,int size,double* out);
void i8bin2deca(int8* in,int size,int8* out);
-//void i16bin2deca(int16* in,int size,int16* out);
+void i16bin2deca(int16* in,int size,int16* out);
void u8bin2deca(uint8* in,int size,uint8* out);
void u16bin2deca(uint16* in,int size,uint16* out);
diff --git a/src/c/elementaryFunctions/includes/get_float.h b/src/c/elementaryFunctions/includes/get_float.h
index 1ada71c..285cb9c 100644
--- a/src/c/elementaryFunctions/includes/get_float.h
+++ b/src/c/elementaryFunctions/includes/get_float.h
@@ -31,6 +31,8 @@ EXTERN_ELEMFUNCT float dfloats(double in);
EXTERN_ELEMFUNCT float i8floats(int8 in);
+EXTERN_ELEMFUNCT float u8floats(uint8 in);
+
EXTERN_ELEMFUNCT float u16floats(uint16 in);
EXTERN_ELEMFUNCT float i16floats(int16 in);
diff --git a/src/c/elementaryFunctions/includes/sec.h b/src/c/elementaryFunctions/includes/sec.h
index 08120ed..9606158 100644
--- a/src/c/elementaryFunctions/includes/sec.h
+++ b/src/c/elementaryFunctions/includes/sec.h
@@ -13,7 +13,7 @@
#define __SEC_H__
#include "dynlib_elementaryfunctions.h"
#include "floatComplex.h"
-//#include "doubleComplex.h"
+#include "doubleComplex.h"
#include <complex.h>
#include "types.h"
@@ -26,7 +26,7 @@ double dsecs(double in);
void sseca(float* in,int size,float* out);
float ssecs(float in);
-void zsecs(double complex z);
+doubleComplex zsecs(doubleComplex z);
//void zseca(doubleComplex* in, int size,doubleComplex* out);
floatComplex csecs(floatComplex z);
void cseca(floatComplex* in, int size,floatComplex* out);
diff --git a/src/c/elementaryFunctions/linspace/dlinspacea.c b/src/c/elementaryFunctions/linspace/dlinspacea.c
index cb60f9e..e23db2f 100644
--- a/src/c/elementaryFunctions/linspace/dlinspacea.c
+++ b/src/c/elementaryFunctions/linspace/dlinspacea.c
@@ -9,13 +9,15 @@
Organization: FOSSEE, IIT Bombay
Email: toolbox@scilab.in
*/
-
+#include <stdlib.h>
#include "linspace.h"
+
void dlinspacea(double *low_limit,int _row,double *up_limit,double range_num,double *out)
{
int i,j,k;
double temp;
- float step_iterate[_row]; /* for each row the spacing between two values is different.*/
+ double *step_iterate; /* for each row the spacing between two values is different.*/
+ step_iterate = (double*) malloc((double)_row*sizeof(double));
for(i=0;i<_row;i++)
{
diff --git a/src/c/elementaryFunctions/logspace/dlogspacea.c b/src/c/elementaryFunctions/logspace/dlogspacea.c
index 3a9caf1..62802f7 100644
--- a/src/c/elementaryFunctions/logspace/dlogspacea.c
+++ b/src/c/elementaryFunctions/logspace/dlogspacea.c
@@ -9,14 +9,16 @@
Organization: FOSSEE, IIT Bombay
Email: toolbox@scilab.in
*/
-
+#include <math.h>
+#include <stdlib.h>
#include "logspace.h"
-#include<math.h>
+
void dlogspacea(double *low_limit,int _row,double *up_limit,double range_num,double *out)
{
int i,j,k;
double temp;
- double step_iterate[_row]; /* for each row the spacing between two values is different.*/
+ double *step_iterate; /* for each row the spacing between two values is different.*/
+ step_iterate = (double*) malloc((double)_row*sizeof(double));
for(i=0;i<_row;i++)
{
step_iterate[i] = pow(10,((up_limit[i]-low_limit[i])/(range_num-1)));
diff --git a/src/c/elementaryFunctions/radix_conversions/base2dec/gbase2decs.c b/src/c/elementaryFunctions/radix_conversions/base2dec/gbase2decs.c
index 43e3686..811a411 100644
--- a/src/c/elementaryFunctions/radix_conversions/base2dec/gbase2decs.c
+++ b/src/c/elementaryFunctions/radix_conversions/base2dec/gbase2decs.c
@@ -159,12 +159,7 @@ double gbase2decs(char* in,int size,int base)
val = 35;
break;
}
- o = o + (val * pow(base, size));
- //printf("%f\n",out[0]);
- //o=(int)out[0];
- //o=o/16;
- //printf("%d %d %d\n",o,val,(val * pow(16, size)));
- //j++;
+ o = o + (val * (int)pow((double)base, size));
size--;
}
return o;
diff --git a/src/c/elementaryFunctions/radix_conversions/hex2dec/ghex2decs.c b/src/c/elementaryFunctions/radix_conversions/hex2dec/ghex2decs.c
index 8722df1..eb42a7a 100644
--- a/src/c/elementaryFunctions/radix_conversions/hex2dec/ghex2decs.c
+++ b/src/c/elementaryFunctions/radix_conversions/hex2dec/ghex2decs.c
@@ -80,12 +80,7 @@ double ghex2decs(char* in,int size)
val = 15;
break;
}
- o = o + (val * pow(16, size));
- //printf("%f\n",out[0]);
- //o=(int)out[0];
- //o=o/16;
- //printf("%d %d %d\n",o,val,(val * pow(16, size)));
- //j++;
+ o = o + (val * (int)pow((double)16, size));
size--;
}
return o;
diff --git a/src/c/elementaryFunctions/sin/i16sins.c b/src/c/elementaryFunctions/sin/i16sins.c
index 3a8dc4d..6fcbd26 100644
--- a/src/c/elementaryFunctions/sin/i16sins.c
+++ b/src/c/elementaryFunctions/sin/i16sins.c
@@ -14,5 +14,5 @@
#include "sin.h"
float i16sins(int16 x) {
- return (sin(x));
+ return (sin((double)x));
}
diff --git a/src/c/elementaryFunctions/sin/i8sins.c b/src/c/elementaryFunctions/sin/i8sins.c
index 4e6deab..2382356 100644
--- a/src/c/elementaryFunctions/sin/i8sins.c
+++ b/src/c/elementaryFunctions/sin/i8sins.c
@@ -14,5 +14,5 @@
#include "sin.h"
float i8sins(int8 x) {
- return (sin(x));
+ return (sin((double)x));
}
diff --git a/src/c/elementaryFunctions/sin/u16sins.c b/src/c/elementaryFunctions/sin/u16sins.c
index 9610248..651b8e1 100644
--- a/src/c/elementaryFunctions/sin/u16sins.c
+++ b/src/c/elementaryFunctions/sin/u16sins.c
@@ -14,5 +14,5 @@
#include "sin.h"
float u16sins(uint16 x) {
- return (sin(x));
+ return (sin((double)x));
}
diff --git a/src/c/elementaryFunctions/sin/u8sins.c b/src/c/elementaryFunctions/sin/u8sins.c
index 50e8bfe..f7c982f 100644
--- a/src/c/elementaryFunctions/sin/u8sins.c
+++ b/src/c/elementaryFunctions/sin/u8sins.c
@@ -14,5 +14,5 @@
#include "sin.h"
float u8sins(uint8 x) {
- return (sin(x));
+ return (sin((double)x));
}
diff --git a/src/c/elementaryFunctions/sinh/i16sinhs.c b/src/c/elementaryFunctions/sinh/i16sinhs.c
index a13cf37..a7ab3d5 100644
--- a/src/c/elementaryFunctions/sinh/i16sinhs.c
+++ b/src/c/elementaryFunctions/sinh/i16sinhs.c
@@ -14,5 +14,5 @@
#include "sinh.h"
float i16sinhs(int16 x) {
- return (sinh(x));
+ return (sinh((double)x));
}
diff --git a/src/c/elementaryFunctions/sinh/i8sinhs.c b/src/c/elementaryFunctions/sinh/i8sinhs.c
index 8c34bf4..ddc052a 100644
--- a/src/c/elementaryFunctions/sinh/i8sinhs.c
+++ b/src/c/elementaryFunctions/sinh/i8sinhs.c
@@ -14,5 +14,5 @@
#include "sinh.h"
float i8sinhs(int8 x) {
- return (sinh(x));
+ return (sinh((double)x));
}
diff --git a/src/c/elementaryFunctions/sinh/u16sinhs.c b/src/c/elementaryFunctions/sinh/u16sinhs.c
index ca28d46..5f828cd 100644
--- a/src/c/elementaryFunctions/sinh/u16sinhs.c
+++ b/src/c/elementaryFunctions/sinh/u16sinhs.c
@@ -14,5 +14,5 @@
#include "sinh.h"
float u16sinhs(uint16 x) {
- return (sinh(x));
+ return (sinh((double)x));
}
diff --git a/src/c/elementaryFunctions/sinh/u8sinhs.c b/src/c/elementaryFunctions/sinh/u8sinhs.c
index 3b2f8e6..9f49d7b 100644
--- a/src/c/elementaryFunctions/sinh/u8sinhs.c
+++ b/src/c/elementaryFunctions/sinh/u8sinhs.c
@@ -14,5 +14,5 @@
#include "sinh.h"
float u8sinhs(uint8 x) {
- return (sinh(x));
+ return (sinh((double)x));
}
diff --git a/src/c/linearAlgebra/balanc/dbalanca.c b/src/c/linearAlgebra/balanc/dbalanca.c
index 558c614..a86a196 100644
--- a/src/c/linearAlgebra/balanc/dbalanca.c
+++ b/src/c/linearAlgebra/balanc/dbalanca.c
@@ -59,7 +59,7 @@ void dbalanca(double* in1, int rows, double* in2, double* out1, \
memcpy(buf2,in2,rows*rows*sizeof(double));
dggbal_(&JOB,&rows,buf1,&rows,buf2,&rows,&ILO,&IHI,LSCALE,RSCALE, \
- LWORK,INFO);
+ LWORK,&INFO);
deyea(out3,rows,rows);
deyea(out4,rows,rows);
diff --git a/src/c/linearAlgebra/rcond/drconda.c b/src/c/linearAlgebra/rcond/drconda.c
index 2082e9d..a203c1e 100644
--- a/src/c/linearAlgebra/rcond/drconda.c
+++ b/src/c/linearAlgebra/rcond/drconda.c
@@ -18,15 +18,15 @@
double drconda(double* in1, int rows)
{
- double *buf, *IPIV, *LDWORK, *LIWORK;
- int INFO;
+ double *buf, *LDWORK;
+ int INFO, *IPIV, *LIWORK;
char one = '1';
double ANORM;
double RCOND = 1;
buf = (double*) malloc((double) rows*rows*sizeof(double));
- IPIV = (double*) malloc((double) rows*sizeof(double));
- LIWORK = (double*) malloc((double) rows*sizeof(double));
+ IPIV = (int*) malloc((int) rows*sizeof(int));
+ LIWORK = (int*) malloc((int) rows*sizeof(int));
LDWORK = (double*) malloc((double) 4*rows*sizeof(double));
/*Copy input in temp buf, as lapack modifies input*/
diff --git a/src/c/string/convstr/gconvstrs.c b/src/c/string/convstr/gconvstrs.c
index d3374ff..7c6e7f1 100644
--- a/src/c/string/convstr/gconvstrs.c
+++ b/src/c/string/convstr/gconvstrs.c
@@ -11,8 +11,10 @@
*/
#include <string.h>
+#include <ctype.h>
#include "convstr.h"
+
void gconvstrs(char* in, int size,char* flag,int size2,char* out)
{
int i=0;//temp=0;