diff options
30 files changed, 588 insertions, 22 deletions
diff --git a/2.3-1/RUN_TESTS/run_tests.bat b/2.3-1/RUN_TESTS/run_tests.bat index bf3e639b..bf3e639b 100644..100755 --- a/2.3-1/RUN_TESTS/run_tests.bat +++ b/2.3-1/RUN_TESTS/run_tests.bat diff --git a/2.3-1/includes/sci2clib.h b/2.3-1/includes/sci2clib.h index 2a4ffad2..5bbd8ba8 100644 --- a/2.3-1/includes/sci2clib.h +++ b/2.3-1/includes/sci2clib.h @@ -488,10 +488,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/2.3-1/macros/FunctionAnnotation/FA_SZ_AMELL.sci b/2.3-1/macros/FunctionAnnotation/FA_SZ_AMELL.sci new file mode 100644 index 00000000..6cf27b0d --- /dev/null +++ b/2.3-1/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/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN_CAT.sci b/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN_CAT.sci index 50b897e0..527217a5 100644 --- a/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN_CAT.sci +++ b/2.3-1/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/2.3-1/macros/FunctionAnnotation/lib b/2.3-1/macros/FunctionAnnotation/lib Binary files differindex fe171a59..62d9138a 100644 --- a/2.3-1/macros/FunctionAnnotation/lib +++ b/2.3-1/macros/FunctionAnnotation/lib diff --git a/2.3-1/macros/FunctionAnnotation/names b/2.3-1/macros/FunctionAnnotation/names index 1d83afa1..097ba5cc 100644 --- a/2.3-1/macros/FunctionAnnotation/names +++ b/2.3-1/macros/FunctionAnnotation/names @@ -15,6 +15,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/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index 52bc10c2..c874416e 100644 --- a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -8200,6 +8200,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/2.3-1/macros/ToolInitialization/lib b/2.3-1/macros/ToolInitialization/lib Binary files differindex 8fc6062d..dd481d10 100644 --- a/2.3-1/macros/ToolInitialization/lib +++ b/2.3-1/macros/ToolInitialization/lib diff --git a/2.3-1/macros/findDeps/getAllHeaders.sci b/2.3-1/macros/findDeps/getAllHeaders.sci index 872e24cd..d144f896 100644 --- a/2.3-1/macros/findDeps/getAllHeaders.sci +++ b/2.3-1/macros/findDeps/getAllHeaders.sci @@ -166,6 +166,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/2.3-1/macros/findDeps/getAllInterfaces.sci b/2.3-1/macros/findDeps/getAllInterfaces.sci index 3befda80..86f1bf56 100644 --- a/2.3-1/macros/findDeps/getAllInterfaces.sci +++ b/2.3-1/macros/findDeps/getAllInterfaces.sci @@ -164,6 +164,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/2.3-1/macros/findDeps/getAllSources.sci b/2.3-1/macros/findDeps/getAllSources.sci index 90dc0143..c8fa7ae6 100644 --- a/2.3-1/macros/findDeps/getAllSources.sci +++ b/2.3-1/macros/findDeps/getAllSources.sci @@ -1047,6 +1047,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/2.3-1/macros/findDeps/lib b/2.3-1/macros/findDeps/lib Binary files differindex 4f7fa99b..12d73687 100644 --- a/2.3-1/macros/findDeps/lib +++ b/2.3-1/macros/findDeps/lib diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/sinc/zsinca.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/sinc/zsinca.c index ad7d095b..1f6cf9ba 100644 --- a/2.3-1/src/c/elementaryFunctions/Trigonometry/sinc/zsinca.c +++ b/2.3-1/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/2.3-1/src/c/signalProcessing/%sn/zmodsna.c b/2.3-1/src/c/signalProcessing/%sn/zmodsna.c index 33052a32..85bc0c16 100644 --- a/2.3-1/src/c/signalProcessing/%sn/zmodsna.c +++ b/2.3-1/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/2.3-1/src/c/signalProcessing/amell/amell.h b/2.3-1/src/c/signalProcessing/amell/amell.h new file mode 100644 index 00000000..30bd6c82 --- /dev/null +++ b/2.3-1/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/2.3-1/src/c/signalProcessing/amell/damella.c b/2.3-1/src/c/signalProcessing/amell/damella.c new file mode 100644 index 00000000..5c37e2a5 --- /dev/null +++ b/2.3-1/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/2.3-1/src/c/signalProcessing/amell/damells.c b/2.3-1/src/c/signalProcessing/amell/damells.c new file mode 100644 index 00000000..90c20530 --- /dev/null +++ b/2.3-1/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/2.3-1/src/c/signalProcessing/amell/int_amell.h b/2.3-1/src/c/signalProcessing/amell/int_amell.h new file mode 100644 index 00000000..5d0c86f6 --- /dev/null +++ b/2.3-1/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/2.3-1/src/c/signalProcessing/ell1mag/dell1maga.c b/2.3-1/src/c/signalProcessing/ell1mag/dell1maga.c new file mode 100644 index 00000000..9af0c8e8 --- /dev/null +++ b/2.3-1/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/2.3-1/src/c/signalProcessing/ell1mag/ell1mag.h b/2.3-1/src/c/signalProcessing/ell1mag/ell1mag.h new file mode 100644 index 00000000..8fffc0c6 --- /dev/null +++ b/2.3-1/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/2.3-1/src/c/signalProcessing/ell1mag/int_ell1mag.h b/2.3-1/src/c/signalProcessing/ell1mag/int_ell1mag.h new file mode 100644 index 00000000..590a0abd --- /dev/null +++ b/2.3-1/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/2.3-1/src/c/signalProcessing/ell1mag/zell1maga.c b/2.3-1/src/c/signalProcessing/ell1mag/zell1maga.c new file mode 100644 index 00000000..6e7a6f93 --- /dev/null +++ b/2.3-1/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/2.3-1/src/c/signalProcessing/filt_sinc/dfilt_sincs.c b/2.3-1/src/c/signalProcessing/filt_sinc/dfilt_sincs.c index 65aaaa65..1b7d1b18 100644 --- a/2.3-1/src/c/signalProcessing/filt_sinc/dfilt_sincs.c +++ b/2.3-1/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/2.3-1/src/c/signalProcessing/includes/amell.h b/2.3-1/src/c/signalProcessing/includes/amell.h new file mode 100644 index 00000000..2336d3cb --- /dev/null +++ b/2.3-1/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/2.3-1/src/c/signalProcessing/includes/ell1mag.h b/2.3-1/src/c/signalProcessing/includes/ell1mag.h new file mode 100644 index 00000000..e881cca9 --- /dev/null +++ b/2.3-1/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/2.3-1/src/c/signalProcessing/interfaces/int_amell.h b/2.3-1/src/c/signalProcessing/interfaces/int_amell.h new file mode 100644 index 00000000..10719ac5 --- /dev/null +++ b/2.3-1/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/2.3-1/src/c/signalProcessing/interfaces/int_ell1mag.h b/2.3-1/src/c/signalProcessing/interfaces/int_ell1mag.h new file mode 100644 index 00000000..c30ffef6 --- /dev/null +++ b/2.3-1/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/2.3-1/src/c/signalProcessing/interfaces/int_modsn.h b/2.3-1/src/c/signalProcessing/interfaces/int_modsn.h index 0d32eb06..56c8f8cb 100644 --- a/2.3-1/src/c/signalProcessing/interfaces/int_modsn.h +++ b/2.3-1/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/2.3-1/src/c/string/ascii/gasciia.c b/2.3-1/src/c/string/ascii/gasciia.c index 2cd80bfb..ec11d6e2 100644 --- a/2.3-1/src/c/string/ascii/gasciia.c +++ b/2.3-1/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/2.3-1/src/c/string/strcspn/gstrcspna.c b/2.3-1/src/c/string/strcspn/gstrcspna.c index 0d8de11b..5617e17e 100644 --- a/2.3-1/src/c/string/strcspn/gstrcspna.c +++ b/2.3-1/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]) { |