summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]RUN_TESTS/run_tests.bat0
-rw-r--r--includes/sci2clib.h10
-rw-r--r--macros/FunctionAnnotation/FA_SZ_AMELL.sci9
-rw-r--r--macros/FunctionAnnotation/FA_SZ_ROW_COLUMN_CAT.sci2
-rw-r--r--macros/FunctionAnnotation/libbin2564 -> 2304 bytes
-rw-r--r--macros/FunctionAnnotation/names1
-rw-r--r--macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci58
-rw-r--r--macros/ToolInitialization/libbin980 -> 744 bytes
-rw-r--r--macros/findDeps/getAllHeaders.sci2
-rw-r--r--macros/findDeps/getAllInterfaces.sci2
-rw-r--r--macros/findDeps/getAllSources.sci4
-rw-r--r--macros/findDeps/libbin772 -> 536 bytes
-rw-r--r--src/c/elementaryFunctions/Trigonometry/sinc/zsinca.c10
-rw-r--r--src/c/signalProcessing/%sn/zmodsna.c143
-rw-r--r--src/c/signalProcessing/amell/amell.h27
-rw-r--r--src/c/signalProcessing/amell/damella.c23
-rw-r--r--src/c/signalProcessing/amell/damells.c57
-rw-r--r--src/c/signalProcessing/amell/int_amell.h18
-rw-r--r--src/c/signalProcessing/ell1mag/dell1maga.c40
-rw-r--r--src/c/signalProcessing/ell1mag/ell1mag.h28
-rw-r--r--src/c/signalProcessing/ell1mag/int_ell1mag.h18
-rw-r--r--src/c/signalProcessing/ell1mag/zell1maga.c40
-rw-r--r--src/c/signalProcessing/filt_sinc/dfilt_sincs.c11
-rw-r--r--src/c/signalProcessing/includes/amell.h28
-rw-r--r--src/c/signalProcessing/includes/ell1mag.h29
-rw-r--r--src/c/signalProcessing/interfaces/int_amell.h19
-rw-r--r--src/c/signalProcessing/interfaces/int_ell1mag.h19
-rw-r--r--src/c/signalProcessing/interfaces/int_modsn.h2
-rw-r--r--src/c/string/ascii/gasciia.c4
-rw-r--r--src/c/string/strcspn/gstrcspna.c6
30 files changed, 588 insertions, 22 deletions
diff --git a/RUN_TESTS/run_tests.bat b/RUN_TESTS/run_tests.bat
index bf3e639..bf3e639 100644..100755
--- a/RUN_TESTS/run_tests.bat
+++ b/RUN_TESTS/run_tests.bat
diff --git a/includes/sci2clib.h b/includes/sci2clib.h
index 5f02311..dc26798 100644
--- a/includes/sci2clib.h
+++ b/includes/sci2clib.h
@@ -520,10 +520,18 @@ extern "C" {
#include "ffilt.h"
#include "int_ffilt.h"
-/*interfacing modsn */
+/*interfacing %sn */
#include "modsn.h"
#include "int_modsn.h"
+/*interfacing ell1mag */
+#include "ell1mag.h"
+#include "int_ell1mag.h"
+
+/* interfacing amell */
+#include "amell.h"
+#include "int_amell.h"
+
/* STATISTICS FUNCTIONS */
/* interfacing max */
diff --git a/macros/FunctionAnnotation/FA_SZ_AMELL.sci b/macros/FunctionAnnotation/FA_SZ_AMELL.sci
new file mode 100644
index 0000000..6cf27b0
--- /dev/null
+++ b/macros/FunctionAnnotation/FA_SZ_AMELL.sci
@@ -0,0 +1,9 @@
+function outp=FA_SZ_AMELL(in1sz)
+ in1sz=string(in1sz);
+ insz=eval(in1sz);
+ if(insz>1) then
+ outp=string(insz);
+ else
+ outp="1";
+ end
+endfunction
diff --git a/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN_CAT.sci b/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN_CAT.sci
index 50b897e..527217a 100644
--- a/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN_CAT.sci
+++ b/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN_CAT.sci
@@ -27,7 +27,7 @@ function outsize = FA_SZ_ROW_COLUMN_CAT(inval,in1size,in2size)
// ------------------------------
// --- Check input arguments. ---
// ------------------------------
-SCI2CNInArgCheck(argn(1),3,3);
+SCI2CNInArgCheck(argn(2),3,3);
in1size = string(in1size);
diff --git a/macros/FunctionAnnotation/lib b/macros/FunctionAnnotation/lib
index 0def85b..62d9138 100644
--- a/macros/FunctionAnnotation/lib
+++ b/macros/FunctionAnnotation/lib
Binary files differ
diff --git a/macros/FunctionAnnotation/names b/macros/FunctionAnnotation/names
index a558e8d..423c825 100644
--- a/macros/FunctionAnnotation/names
+++ b/macros/FunctionAnnotation/names
@@ -16,6 +16,7 @@ FA_SCHUR_TP
FA_SUB
FA_SZ_1
FA_SZ_2
+FA_SZ_AMELL
FA_SZ_COLUMN_DIAG
FA_SZ_COL_DIAG_IN_EX
FA_SZ_DEC2BASE
diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
index 78c48ec..5bc8043 100644
--- a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
+++ b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
@@ -9546,6 +9546,64 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,E
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class ELL1MAG --------------------
+//------------------------------------
+ClassName = 'ell1mag';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 3',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(3).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(3).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(3).SZ(2)',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0z2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('d0d0d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'ell1mag';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class AMELL --------------------
+//------------------------------------
+ClassName = 'amell';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= FA_SZ_AMELL(IN(1).SZ(2))',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('d2d0'+ArgSeparator+'d2',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'amell';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+
+
+
// ////////////////////////////////////////////
// /////PARTE INTRODOTTA DA ALBERTO MOREA
// /////////////////////////////////////////////
diff --git a/macros/ToolInitialization/lib b/macros/ToolInitialization/lib
index 6240d3d..dd481d1 100644
--- a/macros/ToolInitialization/lib
+++ b/macros/ToolInitialization/lib
Binary files differ
diff --git a/macros/findDeps/getAllHeaders.sci b/macros/findDeps/getAllHeaders.sci
index 762c9a3..00a1204 100644
--- a/macros/findDeps/getAllHeaders.sci
+++ b/macros/findDeps/getAllHeaders.sci
@@ -175,6 +175,8 @@ function allHeaders = getAllHeaders(SharedInfo)
"src/c/signalProcessing/includes/filt_sinc.h"
"src/c/signalProcessing/includes/ffilt.h"
"src/c/signalProcessing/includes/modsn.h"
+ "src/c/signalProcessing/includes/ell1mag.h"
+ "src/c/signalProcessing/includes/amell.h"
"src/c/implicitList/dynlib_implicitlist.h"
"src/c/implicitList/implicitList.h"
"src/c/differential_calculus/includes/ode.h"
diff --git a/macros/findDeps/getAllInterfaces.sci b/macros/findDeps/getAllInterfaces.sci
index ecc102f..beb6115 100644
--- a/macros/findDeps/getAllInterfaces.sci
+++ b/macros/findDeps/getAllInterfaces.sci
@@ -173,6 +173,8 @@ function allInterfaces = getAllInterfaces(SharedInfo)
"src/c/signalProcessing/interfaces/int_filt_sinc.h"
"src/c/signalProcessing/interfaces/int_ffilt.h"
"src/c/signalProcessing/interfaces/int_modsn.h"
+ "src/c/signalProcessing/interfaces/int_ell1mag.h"
+ "src/c/signalProcessing/interfaces/int_amell.h"
"src/c/implicitList/int_OpColon.h"
"src/c/differential_calculus/interfaces/int_ode.h"
"src/c/differential_calculus/interfaces/int_diffc.h"
diff --git a/macros/findDeps/getAllSources.sci b/macros/findDeps/getAllSources.sci
index 8b513ea..92242cd 100644
--- a/macros/findDeps/getAllSources.sci
+++ b/macros/findDeps/getAllSources.sci
@@ -1089,6 +1089,10 @@ function allSources = getAllSources(SharedInfo)
"src/c/signalProcessing/%sn/zmodsns.c"
"src/c/signalProcessing/%sn/dmodsna.c"
"src/c/signalProcessing/%sn/zmodsna.c"
+ "src/c/signalProcessing/ell1mag/zell1maga.c"
+ "src/c/signalProcessing/ell1mag/dell1maga.c"
+ "src/c/signalProcessing/amell/damells.c"
+ "src/c/signalProcessing/amell/damella.c"
"src/c/implicitList/zimplicitLists.c"
"src/c/implicitList/dimplicitLists.c"
"src/c/implicitList/cimplicitLists.c"
diff --git a/macros/findDeps/lib b/macros/findDeps/lib
index c1deaa6..12d7368 100644
--- a/macros/findDeps/lib
+++ b/macros/findDeps/lib
Binary files differ
diff --git a/src/c/elementaryFunctions/Trigonometry/sinc/zsinca.c b/src/c/elementaryFunctions/Trigonometry/sinc/zsinca.c
index ad7d095..1f6cf9b 100644
--- a/src/c/elementaryFunctions/Trigonometry/sinc/zsinca.c
+++ b/src/c/elementaryFunctions/Trigonometry/sinc/zsinca.c
@@ -14,18 +14,22 @@
#include "sinc.h"
#include "sin.h"
#include "doubleComplex.h"
+#include "division.h"
void zsinca(doubleComplex* sample,int size,doubleComplex* oup)
{
int j;
+ double r,i;
for(j=0;j<size;j++)
{
- if(sample[j]==0)
+ r=zreals(sample[j]);
+ i=zimags(sample[j]);
+ if(r==0 && i==0)
{
- oup[j]==DoubleComplex(1,0);
+ oup[j]=DoubleComplex(1,0);
}
else
{
- oup[j]=zsins(sample[j])/sample[j];
+ oup[j]=zrdivs(zsins(sample[j]),sample[j]);
}
}
}
diff --git a/src/c/signalProcessing/%sn/zmodsna.c b/src/c/signalProcessing/%sn/zmodsna.c
index 33052a3..85bc0c1 100644
--- a/src/c/signalProcessing/%sn/zmodsna.c
+++ b/src/c/signalProcessing/%sn/zmodsna.c
@@ -13,12 +13,153 @@
#include<math.h>
#include "modsn.h"
#include "doubleComplex.h"
+#define CA 0.0003
+
+
+doubleComplex zmodsnsproto(doubleComplex uu,double emmc,doubleComplex* sni)
+{
+ doubleComplex ans;
+ double uur,uui;
+ uur=zreals(uu);
+ uui=zimags(uu);
+ double sr,cr,dr;
+ //Performing Elliptic Function operation for the real values
+ double a1,b1,c1,d1,emc1,u1;
+ double em1[14],en1[14];
+ int i1,ii1,l1,bo1;
+ emc1=1-emmc;
+ u1=uur;
+ if(emc1)
+ {
+ bo1=(emc1<0.0);
+ if(bo1)
+ {
+ d1=1.0-emc1;
+ emc1/=-1.0/d1;
+ u1*=(d1=sqrt(d1));
+ }
+ a1=1.0;
+ dr=1.0;
+ for(i1=1;i1<=13;i1++)
+ {
+ l1=i1;
+ em1[i1]=a1;
+ en1[i1]=(emc1=sqrt(emc1));
+ c1=0.5*(a1+emc1);
+ if(fabs(a1-emc1)<=CA*a1)break;
+ emc1*=a1;
+ a1=c1;
+ }
+ u1*=c1;
+ sr=sin(u1);
+ cr=cos(u1);
+ if(sr)
+ {
+ a1=cr/sr;
+ c1*=a1;
+ for(ii1=l1;ii1>=1;ii1--)
+ {
+ b1=em1[ii1];
+ a1*=c1;
+ c1*=dr;
+ dr=(en1[ii1]+a1)/(b1+a1);
+ a1=c1/b1;
+ }
+ a1=1.0/sqrt(c1*c1+1.0);
+ sr=(sr>=0.0?a1:-a1);
+ cr=c1*(sr);
+ }
+ if(bo1)
+ {
+ a1=dr;
+ dr=cr;
+ cr=a1;
+ sr/=d1;
+ }
+ }
+ else
+ {
+ cr=1.0/cosh(u1);
+ dr=cr;
+ sr=tanh(u1);
+ }
+ ////////////////////////////////////////////////////////////////
+ double si,ci,di;
+ //Performing Elleptic Function operation for the imaginary values
+ double a,b,c,d,emc,u;
+ double em[14],en[14];
+ int i,ii,l,bo;
+ //double s1,c1,d1;
+ emc=emmc;
+ u=uui;
+ if(emc)
+ {
+ bo=(emc<0.0);
+ if(bo)
+ {
+ d=1.0-emc;
+ emc/=-1.0/d;
+ u*=(d=sqrt(d));
+ }
+ a=1.0;
+ di=1.0;
+ for(i=1;i<=13;i++)
+ {
+ l=i;
+ em[i]=a;
+ en[i]=(emc=sqrt(emc));
+ c=0.5*(a+emc);
+ if(fabs(a-emc)<=CA*a)break;
+ emc*=a;
+ a=c;
+ }
+ u*=c;
+ si=sin(u);
+ ci=cos(u);
+ if(si)
+ {
+ a=ci/si;
+ c*=a;
+ for(ii=l;ii>=1;ii--)
+ {
+ b=em[ii];
+ a*=c;
+ c*=di;
+ di=(en[ii]+a)/(b+a);
+ a=c/b;
+ }
+ a=1.0/sqrt(c*c+1.0);
+ si=(si>=0.0?a:-a);
+ ci=c*(si);
+ }
+ if(bo)
+ {
+ a=di;
+ di=ci;
+ ci=a;
+ si/=d;
+ }
+ }
+ else
+ {
+ ci=1.0/cosh(u);
+ di=ci;
+ si=tanh(u);
+ }
+ /////////////////////////////////////////////////////////
+ double delta;
+ delta=ci*ci + emmc*sr*sr*si*si;
+ double snir,snii;
+ snir=(sr*di)/delta;
+ snii=(cr*dr*si*ci)/delta;
+ *sni=DoubleComplex(snir,snii);
+}
void zmodsna(doubleComplex* uu,int size,double emmc,doubleComplex* sn)
{
int i;
for(i=0;i<size;i++)
{
- sn[i]=zmodsns(uu[i],emmc);
+ zmodsnsproto(uu[i],emmc,&sn[i]);
}
}
diff --git a/src/c/signalProcessing/amell/amell.h b/src/c/signalProcessing/amell/amell.h
new file mode 100644
index 0000000..30bd6c8
--- /dev/null
+++ b/src/c/signalProcessing/amell/amell.h
@@ -0,0 +1,27 @@
+/* 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: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __AMELL_H__
+#define __AMELL_H__
+#include "types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+double damells(double u,double x);
+
+#ifdef __cplusplus
+} /* extern "c" */
+#endif
+
+#endif /*__AMELL_H__*/
diff --git a/src/c/signalProcessing/amell/damella.c b/src/c/signalProcessing/amell/damella.c
new file mode 100644
index 0000000..5c37e2a
--- /dev/null
+++ b/src/c/signalProcessing/amell/damella.c
@@ -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: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+#include<stdio.h>
+#include<math.h>
+#include "amell.h"
+
+void damella(double* u,int size,double x,double* oup)
+{
+ int i;
+ for(i=0;i<size;i++)
+ {
+ oup[i]=damells(u[i],x);
+ }
+}
diff --git a/src/c/signalProcessing/amell/damells.c b/src/c/signalProcessing/amell/damells.c
new file mode 100644
index 0000000..90c2053
--- /dev/null
+++ b/src/c/signalProcessing/amell/damells.c
@@ -0,0 +1,57 @@
+/* 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: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#include<stdio.h>
+#include<math.h>
+#include "amell.h"
+#define N 30
+#define DBL_EPSILON 2.2204460492503131E-16
+
+
+double damells(double u,double x)
+{
+ double a[N+1];
+ double g[N+1];
+ double c[N+1];
+ double two_n;
+ double phi;
+ double k;
+ int n;
+ k=(long double)fabs(x);
+ if(k==1.0)
+ return 0;
+ if(k>1.0)
+ printf("Wrong type of input argument type #2");
+
+ a[0]=1.0;
+ g[0]=sqrt(1.0-k*k);
+ c[0]=k;
+ two_n=1.0;
+ for(n=0;n<N;n++)
+ {
+ if(fabs(a[n]-g[n])<(a[n]*DBL_EPSILON))
+ {
+ break;
+ }
+ two_n+=two_n;
+ a[n+1]=0.5*(a[n]+g[n]);
+ g[n+1]=sqrt(a[n]*g[n]);
+ c[n+1]=0.5*(a[n]-g[n]);
+ }
+ phi=two_n*a[n]*u;
+ for(;n>0;n--)
+ {
+ phi=0.5*(phi+asin(c[n]*sin(phi)/a[n]));
+ }
+ return (double)phi;
+}
+
diff --git a/src/c/signalProcessing/amell/int_amell.h b/src/c/signalProcessing/amell/int_amell.h
new file mode 100644
index 0000000..5d0c86f
--- /dev/null
+++ b/src/c/signalProcessing/amell/int_amell.h
@@ -0,0 +1,18 @@
+/* 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: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_AMELL_H__
+#define __INT_AMELL_H__
+
+#define d0d0amelld0(u,x) damells(u,x)
+
+#endif /* !__INT_AMELL_H__! */
diff --git a/src/c/signalProcessing/ell1mag/dell1maga.c b/src/c/signalProcessing/ell1mag/dell1maga.c
new file mode 100644
index 0000000..9af0c8e
--- /dev/null
+++ b/src/c/signalProcessing/ell1mag/dell1maga.c
@@ -0,0 +1,40 @@
+/* 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: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#include<stdio.h>
+#include "modsn.h"
+#include "ell1mag.h"
+#include "doubleComplex.h"
+
+void dell1maga(double eps,double m1,double* z,int size,double* oup )
+{
+ double s[size];
+ int i;
+ for(i=0;i<size;i++)
+ {
+ s[i]=zmodsns(z[i],m1);
+ }
+ double un[size];
+ int j;
+ for(j=0;j<size;j++)
+ {
+ un[j]=1;
+ }
+ double v;
+ int k;
+ for(k=0;k<size;k++)
+ {
+ v=un[k]/(un[k]+(eps*eps*s[k]*s[k]));
+ oup[k]=v;
+ }
+}
+
diff --git a/src/c/signalProcessing/ell1mag/ell1mag.h b/src/c/signalProcessing/ell1mag/ell1mag.h
new file mode 100644
index 0000000..8fffc0c
--- /dev/null
+++ b/src/c/signalProcessing/ell1mag/ell1mag.h
@@ -0,0 +1,28 @@
+/* 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: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __ELL1MAG_H__
+#define __ELL1MAG_H__
+#include "types.h"
+#include "doubleComplex.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void dell1mags(double eps,double m1,doubleComplex* z,int size,double* oup);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*__ELL1MAG_H__*/
diff --git a/src/c/signalProcessing/ell1mag/int_ell1mag.h b/src/c/signalProcessing/ell1mag/int_ell1mag.h
new file mode 100644
index 0000000..590a0ab
--- /dev/null
+++ b/src/c/signalProcessing/ell1mag/int_ell1mag.h
@@ -0,0 +1,18 @@
+/* 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: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_ELL1MAG_H__
+#define __INT_ELL1MAG_H__
+
+#define d0d0z2ell1magd2(eps,m1,z,size,oup) dell1mags(eps,m1,z,size,oup)
+
+#endif /* !__INT_ELL1MAG_H__! */
diff --git a/src/c/signalProcessing/ell1mag/zell1maga.c b/src/c/signalProcessing/ell1mag/zell1maga.c
new file mode 100644
index 0000000..6e7a6f9
--- /dev/null
+++ b/src/c/signalProcessing/ell1mag/zell1maga.c
@@ -0,0 +1,40 @@
+/* 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: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#include<stdio.h>
+#include "modsn.h"
+#include "ell1mag.h"
+#include "doubleComplex.h"
+
+void zell1maga(double eps,double m1,doubleComplex* z,int size,double* oup )
+{
+ doubleComplex s[size];
+ int i;
+ for(i=0;i<size;i++)
+ {
+ s[i]=zmodsns(z[i],m1);
+ }
+ double un[size];
+ int j;
+ for(j=0;j<size;j++)
+ {
+ un[j]=1;
+ }
+ doubleComplex v;
+ int k;
+ for(k=0;k<size;k++)
+ {
+ v=un[k]/(un[k]+(eps*eps*s[k]*s[k]));
+ oup[k]=zreals(v);
+ }
+}
+
diff --git a/src/c/signalProcessing/filt_sinc/dfilt_sincs.c b/src/c/signalProcessing/filt_sinc/dfilt_sincs.c
index 65aaaa6..1b7d1b1 100644
--- a/src/c/signalProcessing/filt_sinc/dfilt_sincs.c
+++ b/src/c/signalProcessing/filt_sinc/dfilt_sincs.c
@@ -46,13 +46,4 @@ void dfilt_sincs(double N,double fc,double* oup)
oup[k]=xn[k]/xd[k];
}
}
-/*
-int main()
-{
- int n;
- double fl;
- n=5;
- fl=0.2;
- filt_sinc(n,fl);
-}
-*/
+
diff --git a/src/c/signalProcessing/includes/amell.h b/src/c/signalProcessing/includes/amell.h
new file mode 100644
index 0000000..2336d3c
--- /dev/null
+++ b/src/c/signalProcessing/includes/amell.h
@@ -0,0 +1,28 @@
+/* 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: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __AMELL_H__
+#define __AMELL_H__
+#include "types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+double damells(double u,double x);
+void damella(double* u,int size,double x,double* oup);
+
+#ifdef __cplusplus
+} /* extern "c" */
+#endif
+
+#endif /*__AMELL_H__*/
diff --git a/src/c/signalProcessing/includes/ell1mag.h b/src/c/signalProcessing/includes/ell1mag.h
new file mode 100644
index 0000000..e881cca
--- /dev/null
+++ b/src/c/signalProcessing/includes/ell1mag.h
@@ -0,0 +1,29 @@
+/* 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: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __ELL1MAG_H__
+#define __ELL1MAG_H__
+#include "types.h"
+#include "doubleComplex.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void zell1maga(double eps,double m1,doubleComplex* z,int size,double* oup);
+void dell1maga(double eps,double m1,double* z,int size,double* oup);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*__ELL1MAG_H__*/
diff --git a/src/c/signalProcessing/interfaces/int_amell.h b/src/c/signalProcessing/interfaces/int_amell.h
new file mode 100644
index 0000000..10719ac
--- /dev/null
+++ b/src/c/signalProcessing/interfaces/int_amell.h
@@ -0,0 +1,19 @@
+/* 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: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_AMELL_H__
+#define __INT_AMELL_H__
+
+#define d0d0amelld0(u,x) damells(u,x)
+#define d2d0amelld2(u,size,x,oup) damella(u,size[1],x,oup)
+
+#endif /* !__INT_AMELL_H__! */
diff --git a/src/c/signalProcessing/interfaces/int_ell1mag.h b/src/c/signalProcessing/interfaces/int_ell1mag.h
new file mode 100644
index 0000000..c30ffef
--- /dev/null
+++ b/src/c/signalProcessing/interfaces/int_ell1mag.h
@@ -0,0 +1,19 @@
+/* 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: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_ELL1MAG_H__
+#define __INT_ELL1MAG_H__
+
+#define d0d0z2ell1magd2(eps,m1,z,size,oup) zell1maga(eps,m1,z,size[1],oup)
+#define d0d0d2ell1magd2(eps,m1,z,size,oup) dell1maga(eps,m1,z,size[1],oup)
+
+#endif /* !__INT_ELL1MAG_H__! */
diff --git a/src/c/signalProcessing/interfaces/int_modsn.h b/src/c/signalProcessing/interfaces/int_modsn.h
index 0d32eb0..56c8f8c 100644
--- a/src/c/signalProcessing/interfaces/int_modsn.h
+++ b/src/c/signalProcessing/interfaces/int_modsn.h
@@ -18,4 +18,4 @@
#define d2d0modsnd2(uu,size,emmc,sn) dmodsna(uu,size[1],emmc,sn)
#define z2d0modsnz2(uu,size,emmc,sn) zmodsna(uu,size[1],emmc,sn)
-#endif /* !INT_MODSN_H__! */
+#endif /* !__INT_MODSN_H__! */
diff --git a/src/c/string/ascii/gasciia.c b/src/c/string/ascii/gasciia.c
index 2cd80bf..ec11d6e 100644
--- a/src/c/string/ascii/gasciia.c
+++ b/src/c/string/ascii/gasciia.c
@@ -16,8 +16,8 @@
#include "ascii.h"
void gasciia(char *str,int size,int* oup)
{
-
- for(int i=0;i<size;i++)
+ int i;
+ for(i=0;i<size;i++)
{
*(oup+i)=(int)str[i];
}
diff --git a/src/c/string/strcspn/gstrcspna.c b/src/c/string/strcspn/gstrcspna.c
index 0d8de11..5617e17 100644
--- a/src/c/string/strcspn/gstrcspna.c
+++ b/src/c/string/strcspn/gstrcspna.c
@@ -14,10 +14,10 @@
#include "strcspn.h"
uint8 gstrcspna(char *str1,int size1,char *str2,int size2)
{
- int ind;
- for(int i=0;i<=size1;i++)
+ int ind,i,j;;
+ for(i=0;i<=size1;i++)
{
- for(int j=0;j<=size2;j++)
+ for(j=0;j<=size2;j++)
{
if(str2[j]==str1[i])
{