diff options
99 files changed, 3427 insertions, 6 deletions
diff --git a/2.3-1/demos/Brijesh_Demos/test_beta.sci b/2.3-1/demos/Brijesh_Demos/test_beta.sci new file mode 100644 index 00000000..a5465a77 --- /dev/null +++ b/2.3-1/demos/Brijesh_Demos/test_beta.sci @@ -0,0 +1,12 @@ +function test_beta + disp('Datatype: Double'); + i1 = [1 2 3; 4 5 6]; + i2 = [7 8 9; 10 11 12]; + o1 = beta(i1,i2); + disp(o1); + disp('Datatype: float'); + i3 = float([1 2 3; 4 5 6]); + i4 = float([7 8 9; 10 11 12]); + o2 = beta(i3,i4); + disp(o2); +endfunction diff --git a/2.3-1/demos/Brijesh_Demos/test_center.sci b/2.3-1/demos/Brijesh_Demos/test_center.sci new file mode 100644 index 00000000..92815800 --- /dev/null +++ b/2.3-1/demos/Brijesh_Demos/test_center.sci @@ -0,0 +1,14 @@ +function test_center + disp('Datatype: Double'); + i1 = [1 2 3; 4 5 6]; + o1 = center(i1); + disp(o1); + disp('Datatype: float'); + i2 = float([1 2 3; 4 5 6]); + o2 = center(i2); + disp(o2); + disp('Datatype: Double Complex'); + i3 = [0 %i 3+%i; 4 5*%i 0]; + o3 = center(i3); + disp(o3); +endfunction diff --git a/2.3-1/demos/Brijesh_Demos/test_correl.sci b/2.3-1/demos/Brijesh_Demos/test_correl.sci new file mode 100644 index 00000000..80a09a0e --- /dev/null +++ b/2.3-1/demos/Brijesh_Demos/test_correl.sci @@ -0,0 +1,32 @@ +function test_correl + disp('Datatype: Double'); + i1 = [1 2 3 4 5 6]; + i2 = [1 2 3 3 5 6]; + o1 = correl(i1,i2); + disp(o1); + i3 = [1 2 3 4 5 6]; + i4 = [1 2]; + fre = [1 2 ;3 4; 5 6; 7 8; 9 1; 2 3]; + o2 = correl(i3,i4,fre); + disp(o2); + disp('Datatype: float'); + i5 = float([1 2 3 4 5 6]); + i6 = float([1 2 3 3 5 6]); + o3 = correl(i5,i6); + disp(o3); + i7 = float([1 2 3 4 5 6]); + i8 = float([1 2]); + ffre = float([1 2 ;3 4; 5 6; 7 8; 9 1; 2 3]); + o4 = correl(i7,i8,ffre); + disp(o4); + disp('Datatype: DoubleComplex'); + i9 = [1 2 %i 4 6+6*%i 5]; + i10 = [0 %i 1 4 8*%i 2]; + o5 = correl(i9,i10); + disp(o5); + i11 = [1 2 %i 4 6+6*%i 5]; + i12 = [1 %i]; + zfre = [1 %i ;3 0; 5 6*%i; 7 8; 9 1; 2 3]; + o6 = correl(i11,i12,zfre); + disp(o6); +endfunction diff --git a/2.3-1/demos/Brijesh_Demos/test_covar.sci b/2.3-1/demos/Brijesh_Demos/test_covar.sci new file mode 100644 index 00000000..b1825328 --- /dev/null +++ b/2.3-1/demos/Brijesh_Demos/test_covar.sci @@ -0,0 +1,20 @@ +function test_covar + disp('Datatype: Double'); + i3 = [1 2 3 4 5 6]; + i4 = [1 2]; + fre = [1 2 ;3 4; 5 6; 7 8; 9 1; 2 3]; + o2 = covar(i3,i4,fre); + disp(o2); + disp('Datatype: float'); + i7 = float([1 2 3 4 5 6]); + i8 = float([1 2]); + ffre = float([1 2 ;3 4; 5 6; 7 8; 9 1; 2 3]); + o4 = covar(i7,i8,ffre); + disp(o4); + disp('Datatype: DoubleComplex'); + i11 = [1 2 %i 4 6+6*%i 5]; + i12 = [1 %i]; + zfre = [1 %i ;3 0; 5 6*%i; 7 8; 9 1; 2 3]; + o6 = covar(i11,i12,zfre); + disp(o6); +endfunction diff --git a/2.3-1/demos/Brijesh_Demos/test_gamma.sci b/2.3-1/demos/Brijesh_Demos/test_gamma.sci new file mode 100644 index 00000000..4ca5f021 --- /dev/null +++ b/2.3-1/demos/Brijesh_Demos/test_gamma.sci @@ -0,0 +1,10 @@ +function test_gamma + disp('Datatype: Double'); + i1 = [1 2 3; 4 5 6]; + o1 = gamma(i1); + disp(o1); + disp('Datatype: float'); + i2 = float([1 2 3; 4 5 6]); + o2 = gamma(i2); + disp(o2); +endfunction diff --git a/2.3-1/demos/Brijesh_Demos/test_gammaln.sci b/2.3-1/demos/Brijesh_Demos/test_gammaln.sci new file mode 100644 index 00000000..a12a57bb --- /dev/null +++ b/2.3-1/demos/Brijesh_Demos/test_gammaln.sci @@ -0,0 +1,10 @@ +function test_gammaln + disp('Datatype: Double'); + i1 = [1 2 3; 4 5 6]; + o1 = gammaln(i1); + disp(o1); + disp('Datatype: float'); + i2 = float([1 2 3; 4 5 6]); + o2 = gammaln(i2); + disp(o2); +endfunction diff --git a/2.3-1/demos/Brijesh_Demos/test_isinf.sci b/2.3-1/demos/Brijesh_Demos/test_isinf.sci new file mode 100644 index 00000000..59be9759 --- /dev/null +++ b/2.3-1/demos/Brijesh_Demos/test_isinf.sci @@ -0,0 +1,6 @@ +function test_isinf + disp('Datatype: Double'); + i1 = %inf; + o1 = isinf(float(i1)); + disp(o1); +endfunction diff --git a/2.3-1/demos/Brijesh_Demos/test_ndgrid.sci b/2.3-1/demos/Brijesh_Demos/test_ndgrid.sci new file mode 100644 index 00000000..79f9a5d3 --- /dev/null +++ b/2.3-1/demos/Brijesh_Demos/test_ndgrid.sci @@ -0,0 +1,20 @@ +function test_ndgrid + disp('Datatype: Double'); + i1 = linspace(-1,1,10); + i2 = linspace(-1,1,3); + [o1, o2] = ndgrid(i1,i2); + disp(o1); + disp(o2); + disp('Datatype: float'); + i3 = linspace(-1,1,10); + i4 = linspace(-1,1,3); + [o3, o4] = ndgrid(float(i3),float(i4)); + disp(o3); + disp(o4); + disp('Datatype: Double Complex'); + i5 = [1 %i 3]; + i6 = [%i 3+%i 5*%i 9 7 0]; + [o5, o6] = ndgrid(i5,i6); + disp(o5); + disp(o6); +endfunction diff --git a/2.3-1/demos/Brijesh_Demos/test_range.sci b/2.3-1/demos/Brijesh_Demos/test_range.sci new file mode 100644 index 00000000..beca7a1a --- /dev/null +++ b/2.3-1/demos/Brijesh_Demos/test_range.sci @@ -0,0 +1,8 @@ +function test_range + disp('Datatype: Double'); + i1 = [1 2 3; 4 5 6; 7 8 9]; + i2 = 4; + [o1, o2] = range(i1, i2); + disp(o1); + disp(o2); +endfunction diff --git a/2.3-1/demos/Brijesh_Demos/test_sind.sci b/2.3-1/demos/Brijesh_Demos/test_sind.sci new file mode 100644 index 00000000..7f391663 --- /dev/null +++ b/2.3-1/demos/Brijesh_Demos/test_sind.sci @@ -0,0 +1,10 @@ +function test_sind + disp('Datatype: Double'); + i1 = [0 30 45; 60 80 120] ; + o1 = sind(i1); + disp(o1); + disp('Datatype: float'); + i2 = float([0 30 45; 60 80 120]); + o2 = sind(i2); + disp(o2); +endfunction diff --git a/2.3-1/demos/Brijesh_Demos/test_tand.sci b/2.3-1/demos/Brijesh_Demos/test_tand.sci new file mode 100644 index 00000000..3143a88a --- /dev/null +++ b/2.3-1/demos/Brijesh_Demos/test_tand.sci @@ -0,0 +1,10 @@ +function test_tand + disp('Datatype: Double'); + i1 = [0 30 45; 60 80 120] ; + o1 = tand(i1); + disp(o1); + disp('Datatype: float'); + i2 = float([0 30 45; 60 80 120]); + o2 = tand(i2); + disp(o2); +endfunction diff --git a/2.3-1/demos/Brijesh_Demos/test_wcenter.sci b/2.3-1/demos/Brijesh_Demos/test_wcenter.sci new file mode 100644 index 00000000..921e9ee5 --- /dev/null +++ b/2.3-1/demos/Brijesh_Demos/test_wcenter.sci @@ -0,0 +1,14 @@ +function test_wcenter + disp('Datatype: Double'); + i1 = [1 2 3; 4 5 6]; + o1 = wcenter(i1,2); + disp(o1); + disp('Datatype: float'); + i2 = float([1 2 3; 4 5 6]); + o2 = wcenter(i2,2); + disp(o2); + disp('Datatype: Double Complex'); + i3 = [0 %i 3+%i; 4 5*%i 0]; + o3 = wcenter(i3,2); + disp(o3); +endfunction diff --git a/2.3-1/includes/sci2clib.h b/2.3-1/includes/sci2clib.h index 84663563..ac8f7e7d 100644 --- a/2.3-1/includes/sci2clib.h +++ b/2.3-1/includes/sci2clib.h @@ -102,6 +102,17 @@ extern "C" { #include "erfinv.h" #include "int_erfinv.h" +/* interfacing gamma */ +#include "gamma.h" +#include "int_gamma.h" + +/* interfacing gammaln */ +#include "gammaln.h" +#include "int_gammaln.h" + +/* interfacing beta */ +#include "beta.h" +#include "int_beta.h" /* ELEMENTARY FUNCTIONS */ @@ -168,6 +179,9 @@ extern "C" { /* interfacing atanh */ #include "atanh.h" #include "int_atanh.h" +/* interfacing tand */ +#include "tand.h" +#include "int_tand.h" /* interfacing cos */ #include "cos.h" #include "int_cos.h" @@ -253,6 +267,9 @@ extern "C" { /* interfacing sinh */ #include "sinh.h" #include "int_sinh.h" +/* interfacing sind */ +#include "sind.h" +#include "int_sind.h" /* interfacing sqrt */ #include "sqrt.h" #include "int_sqrt.h" @@ -407,6 +424,10 @@ extern "C" { #include "isequal.h" #include "int_isequal.h" +/*interfacing isinf*/ +#include "isinf.h" +#include "int_isinf.h" + /* IMPLICIT LISTS */ /* interfacing implicitList/OpColon */ @@ -523,15 +544,15 @@ extern "C" { /*interfacing norm*/ #include "int_norm.h" #include "norm.h" - /*interface Toeplitz */ #include "toeplitz.h" #include "int_toeplitz.h" - - /*interface Cross */ #include "cross.h" #include "int_cross.h" +/*interface Ndgrid */ +#include "ndgrid.h" +#include "int_ndgrid.h" /* SIGNAL PROCESSING */ @@ -674,6 +695,19 @@ extern "C" { /* interfacing variance */ #include "variance.h" #include "int_variance.h" +/* interfacing wcenter */ +#include "wcenter.h" +#include "int_wcenter.h" +/* interfacing center */ +#include "center.h" +#include "int_center.h" +/* interfacing correl */ +#include "correl.h" +#include "int_correl.h" +/* interfacing covar */ +#include "covar.h" +#include "int_covar.h" + /* TYPE */ /* interfacing real */ @@ -790,6 +824,9 @@ extern "C" { #include "rowcomp.h" /* Linear Algebra - row compression, range */ #include "int_rowcomp.h" +/*interfacing range*/ +#include "range.h" +#include "int_range.h" #include "qr.h" /* Linear Algebra - QR decomposition */ #include "int_qr.h" diff --git a/2.3-1/jar/scilab_en_US_help.jar b/2.3-1/jar/scilab_en_US_help.jar Binary files differindex 2011834c..fec28974 100644 --- a/2.3-1/jar/scilab_en_US_help.jar +++ b/2.3-1/jar/scilab_en_US_help.jar diff --git a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index c460eeb7..f46d1672 100644 --- a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -530,6 +530,7 @@ PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('s0'+ArgSeparator+'s0',ClassFileName,'file','y');
+PrintStringInfo('s0'+ArgSeparator+'d0',ClassFileName,'file','y');
PrintStringInfo('d0'+ArgSeparator+'d0',ClassFileName,'file','y');
PrintStringInfo('c0'+ArgSeparator+'c0',ClassFileName,'file','y');
PrintStringInfo('z0'+ArgSeparator+'z0',ClassFileName,'file','y');
@@ -539,6 +540,7 @@ PrintStringInfo('u160'+ArgSeparator+'s0',ClassFileName,'file','y'); PrintStringInfo('i160'+ArgSeparator+'s0',ClassFileName,'file','y');
PrintStringInfo('s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'d2',ClassFileName,'file','y');
PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
PrintStringInfo('c2'+ArgSeparator+'c2',ClassFileName,'file','y');
PrintStringInfo('z2'+ArgSeparator+'z2',ClassFileName,'file','y');
@@ -558,6 +560,11 @@ PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file', INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+FunctionName = 'sind'; //BJ : Done AS : Float_Done
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
FunctionName = 'asinh'; //BJ : Done AS : Float_Done
PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
@@ -578,6 +585,11 @@ PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file', INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+FunctionName = 'tand'; //BJ : Done AS : Float_Done
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
FunctionName = 'tanh'; //BJ : Done AS : Float_Done
PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
@@ -1053,6 +1065,169 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,Ex +// -------------------
+// --- Class WCENTER. ---
+// -------------------
+ClassName = 'wcenter';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+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)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+
+//---Function list class. ----
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('d2g2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('d2d0'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('s2g2'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('s2d0'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('z2'+ArgSeparator+'z2',ClassFileName,'file','y');
+PrintStringInfo('z2g2'+ArgSeparator+'z2',ClassFileName,'file','y');
+PrintStringInfo('z2d0'+ArgSeparator+'z2',ClassFileName,'file','y');
+
+
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'wcenter';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+// -------------------
+// --- Class CENTER. ---
+// -------------------
+ClassName = 'center';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+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)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+
+//---Function list class. ----
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('d2g2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('d2d0'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('s2g2'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('s2d0'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('z2'+ArgSeparator+'z2',ClassFileName,'file','y');
+PrintStringInfo('z2g2'+ArgSeparator+'z2',ClassFileName,'file','y');
+PrintStringInfo('z2d0'+ArgSeparator+'z2',ClassFileName,'file','y');
+
+
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'center';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+// -------------------
+// --- Class CORREL. ---
+// -------------------
+ClassName = 'correl';
+
+// --- 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)= ''1''',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 3',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)= ''1''',ClassFileName,'file','y');
+
+
+
+//---Function list class. ----
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2d2'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('d2d2d2'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('s2s2'+ArgSeparator+'s0',ClassFileName,'file','y');
+PrintStringInfo('s2s2s2'+ArgSeparator+'s0',ClassFileName,'file','y');
+PrintStringInfo('z2z2'+ArgSeparator+'z0',ClassFileName,'file','y');
+PrintStringInfo('z2z2z2'+ArgSeparator+'z0',ClassFileName,'file','y');
+
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'correl';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+// -------------------
+// --- Class COVAR. ---
+// -------------------
+ClassName = 'covar';
+
+// --- 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(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+
+
+//---Function list class. ----
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2d2d2'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('s2s2s2'+ArgSeparator+'s0',ClassFileName,'file','y');
+PrintStringInfo('z2z2z2'+ArgSeparator+'z0',ClassFileName,'file','y');
+
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'covar';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+
+
// -------------------
// --- Class Nanmin. ---
@@ -5184,6 +5359,39 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,Ex //------------------------------------
+//---- Class NDGRID ----------------
+//------------------------------------
+ClassName = 'ndgrid';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 2',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(2).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= IN(2).SZ(2)',ClassFileName,'file','y');
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2d2'+ArgSeparator+'d2d2',ClassFileName,'file','y');
+PrintStringInfo('s2s2'+ArgSeparator+'s2s2',ClassFileName,'file','y');
+PrintStringInfo('z2z2'+ArgSeparator+'z2z2',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'ndgrid';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+
+//------------------------------------
//---- Class ISEQUAL ----------------
//------------------------------------
ClassName = 'isequal';
@@ -5220,6 +5428,36 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,Ex //------------------------------------
+//---- Class ISINF ----------------
+//------------------------------------
+ClassName = 'isinf';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''g''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0'+ArgSeparator+'g0',ClassFileName,'file','y');
+PrintStringInfo('s0'+ArgSeparator+'g0',ClassFileName,'file','y');
+
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'isinf';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+//------------------------------------
//---- Class CALERF ----------------
//------------------------------------
ClassName = 'calerf';
@@ -5279,6 +5517,85 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,E INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+//------------------------------------
+//---- Class GAMMA ----------------
+//------------------------------------
+ClassName = 'gamma';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s0'+ArgSeparator+'s0',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'gamma';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class GAMMALN ----------------
+//------------------------------------
+ClassName = 'gammaln';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s0'+ArgSeparator+'s0',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+
+
+//------------------------------------
+//---- Class BETA ----------------
+//------------------------------------
+ClassName = 'beta';
+
+// --- 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)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('d2d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s0s0'+ArgSeparator+'s0',ClassFileName,'file','y');
+PrintStringInfo('s2s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'beta';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
//------------------------------------
@@ -8972,6 +9289,37 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,Ex //------------------------------------
+//---- Class RANGE ---------------------
+//------------------------------------
+ClassName = 'range';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 2',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= IN(1).SZ(1)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(1).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(2).SZ(2)= ''1''',ClassFileName,'file','y');
+
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d2d0'+ArgSeparator+'d2d0',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'range';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+
+//------------------------------------
//---- Class QR---------------------
//------------------------------------
ClassName = 'QR';
diff --git a/2.3-1/macros/findDeps/getAllHeaders.sci b/2.3-1/macros/findDeps/getAllHeaders.sci index ff737db0..e4d7133e 100644 --- a/2.3-1/macros/findDeps/getAllHeaders.sci +++ b/2.3-1/macros/findDeps/getAllHeaders.sci @@ -76,6 +76,7 @@ function allHeaders = getAllHeaders(SharedInfo) "src/c/matrixOperations/includes/norm.h" "src/c/matrixOperations/includes/toeplitz.h" "src/c/matrixOperations/includes/cross.h" + "src/c/matrixOperations/includes/ndgrid.h" "src/c/interpolation/includes/interp1.h" "src/c/elementaryFunctions/includes/nextpow2.h" "src/c/elementaryFunctions/includes/gcd.h" @@ -101,6 +102,7 @@ function allHeaders = getAllHeaders(SharedInfo) "src/c/elementaryFunctions/includes/dynlib_elementaryfunctions.h" "src/c/elementaryFunctions/includes/acosh.h" "src/c/elementaryFunctions/includes/sinh.h" + "src/c/elementaryFunctions/includes/sind.h" "src/c/elementaryFunctions/includes/lnp1m1.h" "src/c/elementaryFunctions/includes/tanh.h" "src/c/elementaryFunctions/includes/sqrt.h" @@ -115,6 +117,7 @@ function allHeaders = getAllHeaders(SharedInfo) "src/c/elementaryFunctions/includes/asinh.h" "src/c/elementaryFunctions/includes/atan2.h" "src/c/elementaryFunctions/includes/atanh.h" + "src/c/elementaryFunctions/includes/tand.h" "src/c/elementaryFunctions/includes/uint8.h" "src/c/elementaryFunctions/includes/int8.h" "src/c/elementaryFunctions/includes/uint16.h" @@ -147,6 +150,7 @@ function allHeaders = getAllHeaders(SharedInfo) "src/c/elementaryFunctions/includes/asind.h" "src/c/elementaryFunctions/includes/atand.h" "src/c/elementaryFunctions/includes/isequal.h" + "src/c/elementaryFunctions/includes/isinf.h" "src/c/statisticsFunctions/includes/variance.h" "src/c/statisticsFunctions/includes/sum.h" "src/c/statisticsFunctions/includes/mean.h" @@ -163,6 +167,10 @@ function allHeaders = getAllHeaders(SharedInfo) "src/c/statisticsFunctions/includes/statMax.h" "src/c/statisticsFunctions/includes/statMin.h" "src/c/statisticsFunctions/includes/moment.h" + "src/c/statisticsFunctions/includes/wcenter.h" + "src/c/statisticsFunctions/includes/center.h" + "src/c/statisticsFunctions/includes/correl.h" + "src/c/statisticsFunctions/includes/covar.h" "src/c/operations/includes/subtraction.h" "src/c/operations/includes/addition.h" "src/c/operations/includes/dynlib_operations.h" @@ -247,6 +255,9 @@ function allHeaders = getAllHeaders(SharedInfo) "src/c/specialFunctions/includes/erfcx.h" "src/c/specialFunctions/includes/erfinv.h" "src/c/specialFunctions/includes/calerf.h" + "src/c/specialFunctions/includes/gamma.h" + "src/c/specialFunctions/includes/gammaln.h" + "src/c/specialFunctions/includes/beta.h" "src/c/CACSD/includes/syslin.h" "src/c/CACSD/includes/lqr.h" "src/c/CACSD/includes/lqe.h" @@ -262,6 +273,7 @@ function allHeaders = getAllHeaders(SharedInfo) "src/c/linearAlgebra/includes/householder.h" "src/c/linearAlgebra/includes/fullrf.h" "src/c/linearAlgebra/includes/rowcomp.h" + "src/c/linearAlgebra/includes/range.h" "src/c/linearAlgebra/includes/rcond.h" "src/c/linearAlgebra/includes/qr.h" "src/c/linearAlgebra/includes/spec.h"]; diff --git a/2.3-1/macros/findDeps/getAllInterfaces.sci b/2.3-1/macros/findDeps/getAllInterfaces.sci index 45ac7683..48028745 100644 --- a/2.3-1/macros/findDeps/getAllInterfaces.sci +++ b/2.3-1/macros/findDeps/getAllInterfaces.sci @@ -65,6 +65,7 @@ function allInterfaces = getAllInterfaces(SharedInfo) "src/c/matrixOperations/interfaces/int_norm.h" "src/c/matrixOperations/interfaces/int_toeplitz.h" "src/c/matrixOperations/interfaces/int_cross.h" + "src/c/matrixOperations/interfaces/int_ndgrid.h" "src/c/interpolation/interfaces/int_interp1.h" "src/c/elementaryFunctions/interfaces/int_nextpow2.h" "src/c/elementaryFunctions/interfaces/int_gcd.h" @@ -89,7 +90,9 @@ function allInterfaces = getAllInterfaces(SharedInfo) "src/c/elementaryFunctions/interfaces/int_log.h" "src/c/elementaryFunctions/interfaces/int_pow.h" "src/c/elementaryFunctions/interfaces/int_sin.h" + "src/c/elementaryFunctions/interfaces/int_sind.h" "src/c/elementaryFunctions/interfaces/int_tan.h" + "src/c/elementaryFunctions/interfaces/int_tand.h" "src/c/elementaryFunctions/interfaces/int_acosh.h" "src/c/elementaryFunctions/interfaces/int_acos.h" "src/c/elementaryFunctions/interfaces/int_asin.h" @@ -138,6 +141,7 @@ function allInterfaces = getAllInterfaces(SharedInfo) "src/c/elementaryFunctions/interfaces/int_gcd.h" "src/c/elementaryFunctions/interfaces/int_lcm.h" "src/c/elementaryFunctions/interfaces/int_isequal.h" + "src/c/elementaryFunctions/interfaces/int_isinf.h" "src/c/statisticsFunctions/interfaces/int_mean.h" "src/c/statisticsFunctions/interfaces/int_median.h" "src/c/statisticsFunctions/interfaces/int_nanmedian.h" @@ -151,6 +155,10 @@ function allInterfaces = getAllInterfaces(SharedInfo) "src/c/statisticsFunctions/interfaces/int_variance.h" "src/c/statisticsFunctions/interfaces/int_sum.h" "src/c/statisticsFunctions/interfaces/int_moment.h" + "src/c/statisticsFunctions/interfaces/int_wcenter.h" + "src/c/statisticsFunctions/interfaces/int_center.h" + "src/c/statisticsFunctions/interfaces/int_correl.h" + "src/c/statisticsFunctions/interfaces/int_covar.h" "src/c/operations/interfaces/int_OpEqual.h" "src/c/operations/interfaces/int_OpLogNot.h" "src/c/operations/interfaces/int_OpLogEq.h" @@ -242,6 +250,9 @@ function allInterfaces = getAllInterfaces(SharedInfo) "src/c/specialFunctions/interfaces/int_erfcx.h" "src/c/specialFunctions/interfaces/int_erfinv.h" "src/c/specialFunctions/interfaces/int_calerf.h" + "src/c/specialFunctions/interfaces/int_gamma.h" + "src/c/specialFunctions/interfaces/int_gammaln.h" + "src/c/specialFunctions/interfaces/int_beta.h" "src/c/CACSD/interfaces/int_syslin.h" "src/c/CACSD/interfaces/int_lqr.h" "src/c/CACSD/interfaces/int_lqe.h" @@ -258,6 +269,7 @@ function allInterfaces = getAllInterfaces(SharedInfo) "src/c/linearAlgebra/interfaces/int_householder.h" "src/c/linearAlgebra/interfaces/int_fullrf.h" "src/c/linearAlgebra/interfaces/int_rowcomp.h" + "src/c/linearAlgebra/interfaces/int_range.h" "src/c/linearAlgebra/interfaces/int_qr.h"; "src/c/linearAlgebra/interfaces/int_rcond.h"]; diff --git a/2.3-1/macros/findDeps/getAllSources.sci b/2.3-1/macros/findDeps/getAllSources.sci index 9b36b5e5..606139a7 100644 --- a/2.3-1/macros/findDeps/getAllSources.sci +++ b/2.3-1/macros/findDeps/getAllSources.sci @@ -360,6 +360,9 @@ function allSources = getAllSources(SharedInfo,BuildTool) "src/c/matrixOperations/cross/i8crossa.c" "src/c/matrixOperations/cross/u16crossa.c" "src/c/matrixOperations/cross/i16crossa.c" + "src/c/matrixOperations/ndgrid/dndgrida.c" + "src/c/matrixOperations/ndgrid/sndgrida.c" + "src/c/matrixOperations/ndgrid/zndgrida.c" "src/c/elementaryFunctions/nextpow2/dnextpow2a.c" "src/c/elementaryFunctions/isreal/sisreals.c" "src/c/elementaryFunctions/isreal/disreals.c" @@ -475,6 +478,14 @@ function allSources = getAllSources(SharedInfo,BuildTool) "src/c/elementaryFunctions/acos/dacoss.c" "src/c/elementaryFunctions/acos/sacosa.c" "src/c/elementaryFunctions/acos/sacoss.c" + "src/c/elementaryFunctions/tand/dtands.c" + "src/c/elementaryFunctions/tand/stands.c" + "src/c/elementaryFunctions/tand/dtanda.c" + "src/c/elementaryFunctions/tand/standa.c" + "src/c/elementaryFunctions/sind/dsinds.c" + "src/c/elementaryFunctions/sind/ssinds.c" + "src/c/elementaryFunctions/sind/dsinda.c" + "src/c/elementaryFunctions/sind/ssinda.c" "src/c/elementaryFunctions/asin/dasina.c" "src/c/elementaryFunctions/asin/dasins.c" "src/c/elementaryFunctions/asin/sasina.c" @@ -940,6 +951,8 @@ function allSources = getAllSources(SharedInfo,BuildTool) "src/c/elementaryFunctions/isequal/zisequala.c" "src/c/elementaryFunctions/isequal/u16isequals.c" "src/c/elementaryFunctions/isequal/u16isequala.c" + "src/c/elementaryFunctions/isinf/disinfs.c" + "src/c/elementaryFunctions/isinf/sisinfs.c" "src/c/statisticsFunctions/max/dmaxa.c" "src/c/statisticsFunctions/max/smaxa.c" "src/c/statisticsFunctions/max/srowmaxa.c" @@ -1095,6 +1108,33 @@ function allSources = getAllSources(SharedInfo,BuildTool) "src/c/statisticsFunctions/moment/zmoments.c" "src/c/statisticsFunctions/moment/zmomentrowa.c" "src/c/statisticsFunctions/moment/zmomentcola.c" + "src/c/statisticsFunctions/wcenter/dwcentera.c" + "src/c/statisticsFunctions/wcenter/dwcenterrowa.c" + "src/c/statisticsFunctions/wcenter/dwcentercola.c" + "src/c/statisticsFunctions/wcenter/swcentera.c" + "src/c/statisticsFunctions/wcenter/swcenterrowa.c" + "src/c/statisticsFunctions/wcenter/swcentercola.c" + "src/c/statisticsFunctions/wcenter/zwcentera.c" + "src/c/statisticsFunctions/wcenter/zwcenterrowa.c" + "src/c/statisticsFunctions/wcenter/zwcentercola.c" + "src/c/statisticsFunctions/center/dcentera.c" + "src/c/statisticsFunctions/center/dcenterrowa.c" + "src/c/statisticsFunctions/center/dcentercola.c" + "src/c/statisticsFunctions/center/scentera.c" + "src/c/statisticsFunctions/center/scenterrowa.c" + "src/c/statisticsFunctions/center/scentercola.c" + "src/c/statisticsFunctions/center/zcentera.c" + "src/c/statisticsFunctions/center/zcenterrowa.c" + "src/c/statisticsFunctions/center/zcentercola.c" + "src/c/statisticsFunctions/correl/dcorrels.c" + "src/c/statisticsFunctions/correl/dcorrelfres.c" + "src/c/statisticsFunctions/correl/scorrels.c" + "src/c/statisticsFunctions/correl/scorrelfres.c" + "src/c/statisticsFunctions/correl/zcorrels.c" + "src/c/statisticsFunctions/correl/zcorrelfres.c" + "src/c/statisticsFunctions/covar/dcovars.c" + "src/c/statisticsFunctions/covar/scovars.c" + "src/c/statisticsFunctions/covar/zcovars.c" "src/c/operations/multiplication/cmula.c" "src/c/operations/multiplication/cmuls.c" "src/c/operations/multiplication/cmulv.c" @@ -1492,6 +1532,18 @@ function allSources = getAllSources(SharedInfo,BuildTool) "src/c/specialFunctions/calerf/dcalerfa.c" "src/c/specialFunctions/calerf/scalerfs.c" "src/c/specialFunctions/calerf/scalerfa.c" + "src/c/specialFunctions/gamma/dgammas.c" + "src/c/specialFunctions/gamma/dgammaa.c" + "src/c/specialFunctions/gamma/sgammas.c" + "src/c/specialFunctions/gamma/sgammaa.c" + "src/c/specialFunctions/gammaln/dgammalns.c" + "src/c/specialFunctions/gammaln/dgammalna.c" + "src/c/specialFunctions/gammaln/sgammalns.c" + "src/c/specialFunctions/gammaln/sgammalna.c" + "src/c/specialFunctions/beta/dbetas.c" + "src/c/specialFunctions/beta/dbetaa.c" + "src/c/specialFunctions/beta/sbetas.c" + "src/c/specialFunctions/beta/sbetaa.c" "src/c/CACSD/syslin/dsyslina.c" "src/c/CACSD/lqr/dlqra.c" "src/c/CACSD/lqe/dlqea.c" @@ -1519,6 +1571,7 @@ function allSources = getAllSources(SharedInfo,BuildTool) "src/c/linearAlgebra/spec/dspec1a.c" "src/c/linearAlgebra/fullrf/dfullrfa.c" "src/c/linearAlgebra/rowcomp/drowcompa.c" + "src/c/linearAlgebra/range/drangea.c" "src/c/linearAlgebra/qr/dqra.c" "src/c/linearAlgebra/rcond/drconda.c"]; diff --git a/2.3-1/src/c/elementaryFunctions/includes/isinf.h b/2.3-1/src/c/elementaryFunctions/includes/isinf.h new file mode 100644 index 00000000..6752c377 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/includes/isinf.h @@ -0,0 +1,35 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __ISINF_H__ +#define __ISINF_H__ + +#include "dynlib_elementaryfunctions.h" +#include "floatComplex.h" +#include "doubleComplex.h" +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +char disinfs(double x); +char sisinfs(float x); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +#endif /* !__ISINF_H__ */ + diff --git a/2.3-1/src/c/elementaryFunctions/includes/sind.h b/2.3-1/src/c/elementaryFunctions/includes/sind.h new file mode 100644 index 00000000..d98bd683 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/includes/sind.h @@ -0,0 +1,37 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __SIND_H__ +#define __SIND_H__ + +#include "dynlib_elementaryfunctions.h" +#include "floatComplex.h" +#include "doubleComplex.h" +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double dsinds(double x); +float ssinds(float x); +void dsinda(double* x, int size, double* y); +void ssinda(float* x, int size, double* y); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +#endif /* !__SIND_H__ */ + diff --git a/2.3-1/src/c/elementaryFunctions/includes/tand (copy).h b/2.3-1/src/c/elementaryFunctions/includes/tand (copy).h new file mode 100644 index 00000000..918d43ab --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/includes/tand (copy).h @@ -0,0 +1,37 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __TAND_H__ +#define __TAND_H__ + +#include "dynlib_elementaryfunctions.h" +#include "floatComplex.h" +#include "doubleComplex.h" +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +double dtands(double x); +float stands(float x); +void dtanda(double* x, int size, double* y); +void standa(float* x, int size, double* y); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +#endif /* !__TAND_H__ */ + diff --git a/2.3-1/src/c/elementaryFunctions/includes/tand.h b/2.3-1/src/c/elementaryFunctions/includes/tand.h new file mode 100644 index 00000000..918d43ab --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/includes/tand.h @@ -0,0 +1,37 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __TAND_H__ +#define __TAND_H__ + +#include "dynlib_elementaryfunctions.h" +#include "floatComplex.h" +#include "doubleComplex.h" +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +double dtands(double x); +float stands(float x); +void dtanda(double* x, int size, double* y); +void standa(float* x, int size, double* y); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +#endif /* !__TAND_H__ */ + diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_isinf.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_isinf.h new file mode 100644 index 00000000..9eefa658 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_isinf.h @@ -0,0 +1,20 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __INT_ISINF_H__ +#define __INT_ISINF_H__ + +#define d0isinfg0(in) disinfs(in) +#define s0isinfg0(in) sisinfs(in) + + +#endif /* !__INT_ISINF_H__ */ diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_sind.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_sind.h new file mode 100644 index 00000000..780a6965 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_sind.h @@ -0,0 +1,23 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __INT_SIND_H__ +#define __INT_SIND_H__ + +#define d0sindd0(in) dsinds(in) +#define s0sinds0(in) ssinds(in) +#define s0sindd0(in) ssinds(in) +#define d2sindd2(in, size1, out) dsinda(in, size1[0]*size1[1], out) +#define s2sinds2(in, size1, out) ssinda(in, size1[0]*size1[1], out) +#define s2sindd2(in, size1, out) ssinda(in, size1[0]*size1[1], out) + +#endif /* !__INT_SIND_H__ */ diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_tand.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_tand.h new file mode 100644 index 00000000..d2fb30ea --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_tand.h @@ -0,0 +1,23 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __INT_TAND_H__ +#define __INT_TAND_H__ + +#define d0tandd0(in) dtands(in) +#define s0tands0(in) stands(in) +#define s0tandd0(in) stands(in) +#define d2tandd2(in, size1, out) dtanda(in, size1[0]*size1[1], out) +#define s2tands2(in, size1, out) standa(in, size1[0]*size1[1], out) +#define s2tandd2(in, size1, out) standa(in, size1[0]*size1[1], out) + +#endif /* !__INT_TAND_H__ */ diff --git a/2.3-1/src/c/elementaryFunctions/isinf/disinfs.c b/2.3-1/src/c/elementaryFunctions/isinf/disinfs.c new file mode 100644 index 00000000..1d940051 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/isinf/disinfs.c @@ -0,0 +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: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isinf.h" + +char disinfs(double x) +{ + char o = 'F'; + if (x == INFINITY || x == - INFINITY) + o = 'T'; + return o; +} diff --git a/2.3-1/src/c/elementaryFunctions/isinf/sisinfs.c b/2.3-1/src/c/elementaryFunctions/isinf/sisinfs.c new file mode 100644 index 00000000..c36c0a5b --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/isinf/sisinfs.c @@ -0,0 +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: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "isinf.h" + +char sisinfs(float x) +{ + char o = 'F'; + if (x == INFINITY || x == - INFINITY) + o = 'T'; + return o; +} diff --git a/2.3-1/src/c/elementaryFunctions/sind/dsinda.c b/2.3-1/src/c/elementaryFunctions/sind/dsinda.c new file mode 100644 index 00000000..c13fa0c7 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/sind/dsinda.c @@ -0,0 +1,20 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include "sind.h" + +void dsinda(double* x, int size, double* y) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = dsinds(x[i]); + } +} diff --git a/2.3-1/src/c/elementaryFunctions/sind/dsinds.c b/2.3-1/src/c/elementaryFunctions/sind/dsinds.c new file mode 100644 index 00000000..f7dc54f1 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/sind/dsinds.c @@ -0,0 +1,18 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ +#include <math.h> +#include "sind.h" +#define PI 3.1415927 + +double dsinds(double x) { + return sin(x*PI/180); +} diff --git a/2.3-1/src/c/elementaryFunctions/sind/ssinda.c b/2.3-1/src/c/elementaryFunctions/sind/ssinda.c new file mode 100644 index 00000000..baefd68d --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/sind/ssinda.c @@ -0,0 +1,19 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ +#include "sind.h" + +void ssinda(float* x, int size, double* y) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = ssinds(x[i]); + } +} diff --git a/2.3-1/src/c/elementaryFunctions/sind/ssinds.c b/2.3-1/src/c/elementaryFunctions/sind/ssinds.c new file mode 100644 index 00000000..9d5bf0e7 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/sind/ssinds.c @@ -0,0 +1,19 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ +#include <math.h> +#include "sind.h" +#include "sin.h" +#define PI 3.1415927 + +float ssinds(float x) { + return ssins(x*PI/180); +} diff --git a/2.3-1/src/c/elementaryFunctions/tand/dtanda.c b/2.3-1/src/c/elementaryFunctions/tand/dtanda.c new file mode 100644 index 00000000..e5d56a87 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/tand/dtanda.c @@ -0,0 +1,19 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ +#include "tand.h" + +void dtanda(double* x, int size, double* y) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = dtands(x[i]); + } +} diff --git a/2.3-1/src/c/elementaryFunctions/tand/dtands.c b/2.3-1/src/c/elementaryFunctions/tand/dtands.c new file mode 100644 index 00000000..6fda5b7d --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/tand/dtands.c @@ -0,0 +1,18 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ +#include <math.h> +#include "tand.h" +#define PI 3.1415927 + +double dtands(double x) { + return tan(x*PI/180); +} diff --git a/2.3-1/src/c/elementaryFunctions/tand/standa.c b/2.3-1/src/c/elementaryFunctions/tand/standa.c new file mode 100644 index 00000000..e37f5a05 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/tand/standa.c @@ -0,0 +1,19 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ +#include "tand.h" + +void standa(float* x, int size, double* y) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = stands(x[i]); + } +} diff --git a/2.3-1/src/c/elementaryFunctions/tand/stands.c b/2.3-1/src/c/elementaryFunctions/tand/stands.c new file mode 100644 index 00000000..4d667015 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/tand/stands.c @@ -0,0 +1,19 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ +#include <math.h> +#include "tand.h" +#include "tan.h" +#define PI 3.1415927 + +float stands(float x) { + return stans(x*PI/180); +} diff --git a/2.3-1/src/c/linearAlgebra/includes/range.h b/2.3-1/src/c/linearAlgebra/includes/range.h new file mode 100644 index 00000000..cb1d3a3e --- /dev/null +++ b/2.3-1/src/c/linearAlgebra/includes/range.h @@ -0,0 +1,34 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __RANGE_H__ +#define __RANGE_H__ +#include "types.h" +#include "eye.h" +#include "rowcomp.h" +#include "doubleComplex.h" +#include "floatComplex.h" +#include "matrixTranspose.h" +#include "matrixMultiplication.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double drangea(double* inp1, int row, int col, double inp2, double* out1); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__RANGE_H__*/ diff --git a/2.3-1/src/c/linearAlgebra/interfaces/int_range.h b/2.3-1/src/c/linearAlgebra/interfaces/int_range.h new file mode 100644 index 00000000..d0c529d8 --- /dev/null +++ b/2.3-1/src/c/linearAlgebra/interfaces/int_range.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: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __INT_RANGE_H__ +#define __INT_RANGE_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define d2d0ranged2d0(in1,size1,in2,out1) drangea(in1,size1[0],size1[1],in2,out1) +#define d2ranged2d0(in1,size1,out1) drangea(in1,size1[0],size1[1], 1,out1) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_RANGE_H__*/ diff --git a/2.3-1/src/c/linearAlgebra/range/drangea.c b/2.3-1/src/c/linearAlgebra/range/drangea.c new file mode 100644 index 00000000..7627f24a --- /dev/null +++ b/2.3-1/src/c/linearAlgebra/range/drangea.c @@ -0,0 +1,78 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "range.h" + +double drangea(double* inp1, int row, int col, double inp2, double* out1) +{ + double a[row*col], aprod[row*col], dim = 0, u[row*row], utrans[row*row], o[row*row], unew[row*col], otemp[row*col]; + if (inp2 == 0) + { + deyea(out1, row, col); + return row; + + } + + dim = drowcompa(1,inp1,row,col,NULL,0,u); + + + for(int i = 0; i < row*row; i++) + o[i] = u[i]; + + for(int i = 0; i < row*col; i++) + a[i] = inp1[i]; + + dtransposea(u,row,row, utrans); + + + for(int i = 2; i <= inp2; i++) + { + + dmulma(a, row, col, utrans, row, row, aprod); + + for(int i = 0; i < row*col; i++) + a[i] = aprod[i]; + + + double acut[row*(int)dim]; + + for(int i = 0; i < row*dim; i++) + acut[i] = a[i]; + + + + dim = drowcompa(1,acut,row,(int)dim,NULL,0,unew); + + for(int i = 0; i < row*col; i++) + u[i] = unew[i]; + + + + dmulma(u, row, row, o, row, col, otemp); + + for(int i = 0; i < row*col; i++) + o[i] = otemp[i]; + + + } + + + + for(int i = 0; i < row*col; i++) + out1[i] = o[i]; + + return dim; + +} diff --git a/2.3-1/src/c/matrixOperations/includes/ndgrid.h b/2.3-1/src/c/matrixOperations/includes/ndgrid.h new file mode 100644 index 00000000..2c6f9cfb --- /dev/null +++ b/2.3-1/src/c/matrixOperations/includes/ndgrid.h @@ -0,0 +1,31 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __NDGRID_H__ +#define __NDGRID_H__ +#include "types.h" +#include "doubleComplex.h" +#include "floatComplex.h" +#include "ndgrid.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dndgrida(double* inp1, int size1, double* inp2, int size2, double* out1, double* out2); +void sndgrida(float* inp1, int size1, float* inp2, int size2, float* out1, float* out2); +void zndgrida(doubleComplex* inp1, int size1, doubleComplex* inp2, int size2, doubleComplex* out1, doubleComplex* out2); +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__NDGRID_H__*/ diff --git a/2.3-1/src/c/matrixOperations/interfaces/int_ndgrid.h b/2.3-1/src/c/matrixOperations/interfaces/int_ndgrid.h new file mode 100644 index 00000000..b7fd0a65 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/interfaces/int_ndgrid.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: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __INT_NDGRID_H__ +#define __INT_NDGRID_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define d2d2ndgridd2d2(in1,size1,in2,size2,out1,out2) dndgrida(in1,size1[0]*size1[1],in2,size2[0]*size2[1],out1,out2) +#define s2s2ndgrids2s2(in1,size1,in2,size2,out1,out2) sndgrida(in1,size1[0]*size1[1],in2,size2[0]*size2[1],out1,out2) +#define z2z2ndgridz2z2(in1,size1,in2,size2,out1,out2) zndgrida(in1,size1[0]*size1[1],in2,size2[0]*size2[1],out1,out2) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_NDGRID_H__*/ diff --git a/2.3-1/src/c/matrixOperations/ndgrid/dndgrida.c b/2.3-1/src/c/matrixOperations/ndgrid/dndgrida.c new file mode 100644 index 00000000..d0c1ee0a --- /dev/null +++ b/2.3-1/src/c/matrixOperations/ndgrid/dndgrida.c @@ -0,0 +1,31 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "ndgrid.h" + +void dndgrida(double* inp1, int size1, double* inp2, int size2, double* out1, double* out2) +{ + for(int i = 0; i < size2; i++) + { + for(int j = 0; j < size1; j++) + out1[j + i*size1] = inp1[j]; + } + + for(int i = 0; i < size2; i++) + { + for(int j = 0; j < size1; j++) + out2[j + i*size1] = inp2[i]; + } +} diff --git a/2.3-1/src/c/matrixOperations/ndgrid/sndgrida.c b/2.3-1/src/c/matrixOperations/ndgrid/sndgrida.c new file mode 100644 index 00000000..355d85e9 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/ndgrid/sndgrida.c @@ -0,0 +1,32 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "ndgrid.h" + +void sndgrida(float* inp1, int size1, float* inp2, int size2, float* out1, float* out2) +{ + for(int i = 0; i < size2; i++) + { + for(int j = 0; j < size1; j++) + out1[j + i*size1] = inp1[j]; + } + + for(int i = 0; i < size2; i++) + { + for(int j = 0; j < size1; j++) + out2[j + i*size1] = inp2[i]; + } + +} diff --git a/2.3-1/src/c/matrixOperations/ndgrid/zndgrida.c b/2.3-1/src/c/matrixOperations/ndgrid/zndgrida.c new file mode 100644 index 00000000..28360e20 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/ndgrid/zndgrida.c @@ -0,0 +1,39 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "ndgrid.h" +#include "doubleComplex.h" + +void zndgrida(doubleComplex* inp1, int size1, doubleComplex* inp2, int size2, doubleComplex* out1, doubleComplex* out2) +{ + for(int i = 0; i < size2; i++) + { + for(int j = 0; j < size1; j++) + { + (out1[j + i*size1]) = (inp1[j]); + (out1[j + i*size1]) = (inp1[j]); + } + } + + for(int i = 0; i < size2; i++) + { + for(int j = 0; j < size1; j++) + { + (out2[j + i*size1]) = (inp2[i]); + (out2[j + i*size1]) = (inp2[i]); + } + } + +} diff --git a/2.3-1/src/c/specialFunctions/beta/dbetaa.c b/2.3-1/src/c/specialFunctions/beta/dbetaa.c new file mode 100644 index 00000000..cba98be3 --- /dev/null +++ b/2.3-1/src/c/specialFunctions/beta/dbetaa.c @@ -0,0 +1,22 @@ +/* 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 + Organization: FOSSEE, IIT Bombay + Author: Brijesh Gupta C R + Email: toolbox@scilab.in +*/ +#include <stdio.h> +#include <math.h> +#include "factorial.h" +#include "gamma.h" +#include "beta.h" + +void dbetaa(double* inp1,int size1, double* inp2,int size2, double* out) +{ + for(int i = 0; i<size1; i++) + out[i] = dbetas(inp1[i],inp2[i]); +} diff --git a/2.3-1/src/c/specialFunctions/beta/dbetas.c b/2.3-1/src/c/specialFunctions/beta/dbetas.c new file mode 100644 index 00000000..5ef02578 --- /dev/null +++ b/2.3-1/src/c/specialFunctions/beta/dbetas.c @@ -0,0 +1,21 @@ +/* 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 + Organization: FOSSEE, IIT Bombay + Author: Brijesh Gupta C R + Email: toolbox@scilab.in +*/ +#include <stdio.h> +#include <math.h> +#include "factorial.h" +#include "gamma.h" +#include "beta.h" + +double dbetas(double inp1, double inp2) +{ + return dgammas(inp1)*dgammas(inp2)/dgammas(inp1+inp2); +} diff --git a/2.3-1/src/c/specialFunctions/beta/sbetaa.c b/2.3-1/src/c/specialFunctions/beta/sbetaa.c new file mode 100644 index 00000000..f3fc380e --- /dev/null +++ b/2.3-1/src/c/specialFunctions/beta/sbetaa.c @@ -0,0 +1,22 @@ +/* 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 + Organization: FOSSEE, IIT Bombay + Author: Brijesh Gupta C R + Email: toolbox@scilab.in +*/ +#include <stdio.h> +#include <math.h> +#include "factorial.h" +#include "gamma.h" +#include "beta.h" + +void sbetaa(float* inp1,int size1, float* inp2,int size2, float* out) +{ + for(int i = 0; i<size1; i++) + out[i] = sbetas(inp1[i],inp2[i]); +} diff --git a/2.3-1/src/c/specialFunctions/beta/sbetas.c b/2.3-1/src/c/specialFunctions/beta/sbetas.c new file mode 100644 index 00000000..cbe3368b --- /dev/null +++ b/2.3-1/src/c/specialFunctions/beta/sbetas.c @@ -0,0 +1,21 @@ +/* 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 + Organization: FOSSEE, IIT Bombay + Author: Brijesh Gupta C R + Email: toolbox@scilab.in +*/ +#include <stdio.h> +#include <math.h> +#include "factorial.h" +#include "gamma.h" +#include "beta.h" + +float sbetas(float inp1, float inp2) +{ + return dgammas(inp1)*dgammas(inp2)/dgammas(inp1+inp2); +} diff --git a/2.3-1/src/c/specialFunctions/gamma/dgammaa.c b/2.3-1/src/c/specialFunctions/gamma/dgammaa.c new file mode 100644 index 00000000..e2bfadf9 --- /dev/null +++ b/2.3-1/src/c/specialFunctions/gamma/dgammaa.c @@ -0,0 +1,21 @@ +/* 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 + Organization: FOSSEE, IIT Bombay + Author: Brijesh Gupta C R + Email: toolbox@scilab.in +*/ +#include <stdio.h> +#include <math.h> +#include "factorial.h" +#include "gamma.h" + +void dgammaa(double* inp,int size,double* out) +{ + for(int i = 0; i<size; i++) + out[i] = dgammas(inp[i]); +} diff --git a/2.3-1/src/c/specialFunctions/gamma/dgammas.c b/2.3-1/src/c/specialFunctions/gamma/dgammas.c new file mode 100644 index 00000000..2dae08ce --- /dev/null +++ b/2.3-1/src/c/specialFunctions/gamma/dgammas.c @@ -0,0 +1,20 @@ +/* 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 + Organization: FOSSEE, IIT Bombay + Author: Brijesh Gupta C R + Email: toolbox@scilab.in +*/ +#include <stdio.h> +#include <math.h> +#include "factorial.h" +#include "gamma.h" + +double dgammas(double inp) +{ + return dfactorials(inp-1); +} diff --git a/2.3-1/src/c/specialFunctions/gamma/sgammaa.c b/2.3-1/src/c/specialFunctions/gamma/sgammaa.c new file mode 100644 index 00000000..4636e344 --- /dev/null +++ b/2.3-1/src/c/specialFunctions/gamma/sgammaa.c @@ -0,0 +1,21 @@ +/* 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 + Organization: FOSSEE, IIT Bombay + Author: Brijesh Gupta C R + Email: toolbox@scilab.in +*/ +#include <stdio.h> +#include <math.h> +#include "factorial.h" +#include "gamma.h" + +void sgammaa(float* inp,int size,float* out) +{ + for(int i = 0; i<size; i++) + out[i] = sgammas(inp[i]); +} diff --git a/2.3-1/src/c/specialFunctions/gamma/sgammas.c b/2.3-1/src/c/specialFunctions/gamma/sgammas.c new file mode 100644 index 00000000..9f2f705a --- /dev/null +++ b/2.3-1/src/c/specialFunctions/gamma/sgammas.c @@ -0,0 +1,20 @@ +/* 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 + Organization: FOSSEE, IIT Bombay + Author: Brijesh Gupta C R + Email: toolbox@scilab.in +*/ +#include <stdio.h> +#include <math.h> +#include "factorial.h" +#include "gamma.h" + +float sgammas(float inp) +{ + return dfactorials(inp-1); +} diff --git a/2.3-1/src/c/specialFunctions/gammaln/dgammalna.c b/2.3-1/src/c/specialFunctions/gammaln/dgammalna.c new file mode 100644 index 00000000..8a2dd54b --- /dev/null +++ b/2.3-1/src/c/specialFunctions/gammaln/dgammalna.c @@ -0,0 +1,21 @@ +/* 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 + Organization: FOSSEE, IIT Bombay + Author: Brijesh Gupta C R + Email: toolbox@scilab.in +*/ +#include <stdio.h> +#include <math.h> +#include "factorial.h" +#include "gammaln.h" + +void dgammalna(double* inp,int size,double* out) +{ + for(int i = 0; i<size; i++) + out[i] = dgammalns(inp[i]); +} diff --git a/2.3-1/src/c/specialFunctions/gammaln/dgammalns.c b/2.3-1/src/c/specialFunctions/gammaln/dgammalns.c new file mode 100644 index 00000000..1c6c2918 --- /dev/null +++ b/2.3-1/src/c/specialFunctions/gammaln/dgammalns.c @@ -0,0 +1,20 @@ +/* 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 + Organization: FOSSEE, IIT Bombay + Author: Brijesh Gupta C R + Email: toolbox@scilab.in +*/ +#include <stdio.h> +#include <math.h> +#include "factorial.h" +#include "gammaln.h" + +double dgammalns(double inp) +{ + return log(dgammas(inp)); +} diff --git a/2.3-1/src/c/specialFunctions/gammaln/sgammalna.c b/2.3-1/src/c/specialFunctions/gammaln/sgammalna.c new file mode 100644 index 00000000..1760ca92 --- /dev/null +++ b/2.3-1/src/c/specialFunctions/gammaln/sgammalna.c @@ -0,0 +1,21 @@ +/* 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 + Organization: FOSSEE, IIT Bombay + Author: Brijesh Gupta C R + Email: toolbox@scilab.in +*/ +#include <stdio.h> +#include <math.h> +#include "factorial.h" +#include "gammaln.h" + +void sgammalna(float* inp,int size,float* out) +{ + for(int i = 0; i<size; i++) + out[i] = sgammalns(inp[i]); +} diff --git a/2.3-1/src/c/specialFunctions/gammaln/sgammalns.c b/2.3-1/src/c/specialFunctions/gammaln/sgammalns.c new file mode 100644 index 00000000..af4c27fe --- /dev/null +++ b/2.3-1/src/c/specialFunctions/gammaln/sgammalns.c @@ -0,0 +1,20 @@ +/* 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 + Organization: FOSSEE, IIT Bombay + Author: Brijesh Gupta C R + Email: toolbox@scilab.in +*/ +#include <stdio.h> +#include <math.h> +#include "factorial.h" +#include "gammaln.h" + +float sgammalns(float inp) +{ + return log(sgammas(inp)); +} diff --git a/2.3-1/src/c/specialFunctions/includes/beta.h b/2.3-1/src/c/specialFunctions/includes/beta.h new file mode 100644 index 00000000..be0caf69 --- /dev/null +++ b/2.3-1/src/c/specialFunctions/includes/beta.h @@ -0,0 +1,36 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __BETA_H__ +#define __BETA_H__ +#include "types.h" +#include "floatComplex.h" +#include "doubleComplex.h" +#include "uint8.h" +#include "uint16.h" +#include "int16.h" +#include "factorial.h" +#include "gamma.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double dbetas(double inp1, double inp2); +float sbetas(float inp1, float inp2); +void dbetaa(double* inp1,int size1, double* inp2,int size2, double* out); +void sbetaa(float* inp1,int size1, float* inp2,int size2, float* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__BETA_H__*/ diff --git a/2.3-1/src/c/specialFunctions/includes/gamma.h b/2.3-1/src/c/specialFunctions/includes/gamma.h new file mode 100644 index 00000000..bd438b6d --- /dev/null +++ b/2.3-1/src/c/specialFunctions/includes/gamma.h @@ -0,0 +1,35 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __GAMMA_H__ +#define __GAMMA_H__ +#include "types.h" +#include "floatComplex.h" +#include "doubleComplex.h" +#include "uint8.h" +#include "uint16.h" +#include "int16.h" +#include "factorial.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double dgammas(double inp); +float sgammas(float inp); +void dgammaa(double* inp,int size,double* out); +void sgammaa(float* inp,int size,float* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__GAMMA_H__*/ diff --git a/2.3-1/src/c/specialFunctions/includes/gammaln.h b/2.3-1/src/c/specialFunctions/includes/gammaln.h new file mode 100644 index 00000000..f3af242b --- /dev/null +++ b/2.3-1/src/c/specialFunctions/includes/gammaln.h @@ -0,0 +1,36 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __GAMMALN_H__ +#define __GAMMALN_H__ +#include "types.h" +#include "floatComplex.h" +#include "doubleComplex.h" +#include "uint8.h" +#include "uint16.h" +#include "int16.h" +#include "factorial.h" +#include "gamma.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double dgammalns(double inp); +float sgammalns(float inp); +void dgammalna(double* inp,int size,double* out); +void sgammalna(float* inp,int size,float* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__GAMMALN_H__*/ diff --git a/2.3-1/src/c/specialFunctions/interfaces/int_beta.h b/2.3-1/src/c/specialFunctions/interfaces/int_beta.h new file mode 100644 index 00000000..4f3981ee --- /dev/null +++ b/2.3-1/src/c/specialFunctions/interfaces/int_beta.h @@ -0,0 +1,30 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __INT_BETA_H__ +#define __INT_BETA_H__ + +#ifdef __cplusplus +extern "C" { +#endif + + + +#define d0d0betad0(in1, in2) dbetas(in1, in2) +#define d2d2betad2(in1, size1, in2, size2, out) dbetaa(in1,size1[0]*size1[1], in2, size2[0]*size2[1], out) +#define s0s0betas0(in1, in2) sbetas(in1, in2) +#define s2s2betas2(in1, size1, in2, size2, out) sbetaa(in1,size1[0]*size1[1], in2, size2[0]*size2[1], out) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_BETA_H__*/ diff --git a/2.3-1/src/c/specialFunctions/interfaces/int_gamma.h b/2.3-1/src/c/specialFunctions/interfaces/int_gamma.h new file mode 100644 index 00000000..b527fddc --- /dev/null +++ b/2.3-1/src/c/specialFunctions/interfaces/int_gamma.h @@ -0,0 +1,31 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __INT_GAMMA_H__ +#define __INT_GAMMA_H__ + +#ifdef __cplusplus +extern "C" { +#endif + + + +#define d0gammad0(in1) dgammas(in1) +#define s0gammas0(in1) sgammas(in1) +#define d2gammad2(in1,size,out) dgammaa(in1,size[0]*size[1],out) +#define s2gammas2(in1,size,out) sgammaa(in1,size[0]*size[1],out) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_GAMMA_H__*/ diff --git a/2.3-1/src/c/specialFunctions/interfaces/int_gammaln.h b/2.3-1/src/c/specialFunctions/interfaces/int_gammaln.h new file mode 100644 index 00000000..5be29f1e --- /dev/null +++ b/2.3-1/src/c/specialFunctions/interfaces/int_gammaln.h @@ -0,0 +1,31 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __INT_GAMMALN_H__ +#define __INT_GAMMALN_H__ + +#ifdef __cplusplus +extern "C" { +#endif + + + +#define d0gammalnd0(in1) dgammalns(in1) +#define s0gammalns0(in1) sgammalns(in1) +#define d2gammalnd2(in1,size,out) dgammalna(in1,size[0]*size[1],out) +#define s2gammalns2(in1,size,out) sgammalna(in1,size[0]*size[1],out) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_GAMMALN_H__*/ diff --git a/2.3-1/src/c/statisticsFunctions/center/dcentera.c b/2.3-1/src/c/statisticsFunctions/center/dcentera.c new file mode 100644 index 00000000..87480386 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/center/dcentera.c @@ -0,0 +1,25 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "subtraction.h" +#include "multiplication.h" +#include "center.h" + +void dcentera (double* inp, int row, int col, double* out) +{ + double sum = 0, xbar = 0, sigma = 0; + for(int i = 0; i < row*col; i++) // Findinag the maen of all the elements of the matrix + sum += inp[i]; + xbar = sum/(row*col); + + double one[row*col]; // Creating a matrix of ones + donesa(one,row,col); + + double prod[row*col]; + for(int i = 0; i < row*col; i++) // Applying the formula (x(i,j)-xbar)/sigma + prod[i] = one[i]*xbar; + + for(int i = 0; i < row*col; i++) + out[i] = inp[i] - prod[i]; +} diff --git a/2.3-1/src/c/statisticsFunctions/center/dcentercola.c b/2.3-1/src/c/statisticsFunctions/center/dcentercola.c new file mode 100644 index 00000000..e92a1d29 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/center/dcentercola.c @@ -0,0 +1,38 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "subtraction.h" +#include "matrixMultiplication.h" +#include "center.h" + +void dcentercola (double* inp, int row, int col, double* out) +{ + + double sum[row], xbar[row]; + for(int i = 0; i < row; i++) + sum[i] = 0; + + + for(int i = 0; i < row; i++) + { + for(int j = 0; j < col; j++) + { + sum[i] += inp[i + j*row]; + } + } + + + for(int i = 0; i < row; i++) + xbar[i] = sum[i]/col; + + double one[col]; // Creating a matrix of ones + donesa(one,1,col); + + + double prod[row*col]; + dmulma(xbar, row, 1, one, 1, col, prod); + + for(int i = 0; i< row*col; i++) + out[i] = inp[i] - prod[i]; +} diff --git a/2.3-1/src/c/statisticsFunctions/center/dcenterrowa.c b/2.3-1/src/c/statisticsFunctions/center/dcenterrowa.c new file mode 100644 index 00000000..e6f7e3cd --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/center/dcenterrowa.c @@ -0,0 +1,40 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "subtraction.h" +#include "matrixMultiplication.h" +#include "center.h" + +void dcenterrowa (double* inp, int row, int col, double* out) +{ + + double sum[col], xbar[col]; + for(int i = 0; i < col; i++) + sum[i] = 0; + + + for(int i = 0; i < col; i++) + { + for(int j = 0; j < row; j++) + { + sum[i] += inp[j + i*row]; + } + } + + + + for(int i = 0; i < col; i++) + xbar[i] = sum[i]/row; + + double one[row]; // Creating a matrix of ones + donesa(one,row,1); + + double prod[row*col]; + dmulma(one, row, 1, xbar, 1, col, prod); + + + + for(int i = 0; i< row*col; i++) + out[i] = inp[i] - prod[i]; +} diff --git a/2.3-1/src/c/statisticsFunctions/center/scentera.c b/2.3-1/src/c/statisticsFunctions/center/scentera.c new file mode 100644 index 00000000..2b165be1 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/center/scentera.c @@ -0,0 +1,25 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "subtraction.h" +#include "multiplication.h" +#include "center.h" + +void scentera (float* inp, int row, int col, float* out) +{ + float sum = 0, xbar = 0, sigma = 0; + for(int i = 0; i < row*col; i++) // Findinag the maen of all the elements of the matrix + sum += inp[i]; + xbar = sum/(row*col); + + float one[row*col]; // Creating a matrix of ones + sonesa(one,row,col); + + float prod[row*col]; + for(int i = 0; i < row*col; i++) // Applying the formula (x(i,j)-xbar)/sigma + prod[i] = one[i]*xbar; + + for(int i = 0; i < row*col; i++) + out[i] = inp[i] - prod[i]; +} diff --git a/2.3-1/src/c/statisticsFunctions/center/scentercola.c b/2.3-1/src/c/statisticsFunctions/center/scentercola.c new file mode 100644 index 00000000..d5ef5eeb --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/center/scentercola.c @@ -0,0 +1,37 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "subtraction.h" +#include "matrixMultiplication.h" +#include "center.h" + +void scentercola (float* inp, int row, int col, float* out) +{ + + float sum[row], xbar[row]; + for(int i = 0; i < row; i++) + sum[i] = 0; + + + for(int i = 0; i < row; i++) + { + for(int j = 0; j < col; j++) + { + sum[i] += inp[i + j*row]; + } + } + + for(int i = 0; i < row; i++) + xbar[i] = sum[i]/col; + + float one[col]; // Creating a matrix of ones + sonesa(one,1,col); + + + float prod[row*col]; + smulma(xbar, row, 1, one, 1, col, prod); + + for(int i = 0; i< row*col; i++) + out[i] = inp[i] - prod[i]; +} diff --git a/2.3-1/src/c/statisticsFunctions/center/scenterrowa.c b/2.3-1/src/c/statisticsFunctions/center/scenterrowa.c new file mode 100644 index 00000000..b5910cd9 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/center/scenterrowa.c @@ -0,0 +1,40 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "subtraction.h" +#include "matrixMultiplication.h" +#include "center.h" + +void scenterrowa (float* inp, int row, int col, float* out) +{ + + float sum[col], xbar[col]; + for(int i = 0; i < col; i++) + sum[i] = 0; + + + for(int i = 0; i < col; i++) + { + for(int j = 0; j < row; j++) + { + sum[i] += inp[j + i*row]; + } + } + + + + for(int i = 0; i < col; i++) + xbar[i] = sum[i]/row; + + float one[row]; // Creating a matrix of ones + sonesa(one,row,1); + + float prod[row*col]; + smulma(one, row, 1, xbar, 1, col, prod); + + + + for(int i = 0; i< row*col; i++) + out[i] = inp[i] - prod[i]; +} diff --git a/2.3-1/src/c/statisticsFunctions/center/zcentera.c b/2.3-1/src/c/statisticsFunctions/center/zcentera.c new file mode 100644 index 00000000..22ce70d7 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/center/zcentera.c @@ -0,0 +1,29 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "addition.h" +#include "subtraction.h" +#include "multiplication.h" +#include "division.h" +#include "center.h" +#include "doubleComplex.h" +#include "sqrt.h" + +void zcentera (doubleComplex* inp, int row, int col, doubleComplex* out) +{ + doubleComplex sum = 0, xbar = 0, sigma = 0; + for(int i = 0; i < row*col; i++) // Findinag the maen of all the elements of the matrix + sum = zadds(sum,inp[i]); + xbar = zrdivs(sum,(row*col)); + + doubleComplex one[row*col]; // Creating a matrix of ones + zonesa(one,row,col); + + doubleComplex prod[row*col]; + for(int i = 0; i < row*col; i++) // Applying the formula (x(i,j)-xbar)/sigma + prod[i] = zmuls(one[i],xbar); + + for(int i = 0; i < row*col; i++) + out[i] = zdiffs(inp[i], prod[i]); +} diff --git a/2.3-1/src/c/statisticsFunctions/center/zcentercola.c b/2.3-1/src/c/statisticsFunctions/center/zcentercola.c new file mode 100644 index 00000000..8a838bc5 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/center/zcentercola.c @@ -0,0 +1,42 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "addition.h" +#include "subtraction.h" +#include "multiplication.h" +#include "division.h" +#include "center.h" +#include "doubleComplex.h" +#include "sqrt.h" + +void zcentercola (doubleComplex* inp, int row, int col, doubleComplex* out) +{ + + doubleComplex sum[row], xbar[row]; + for(int i = 0; i < row; i++) + sum[i] = DoubleComplex(0,0); + + + for(int i = 0; i < row; i++) + { + for(int j = 0; j < col; j++) + { + sum[i] = zadds(sum[i], inp[i + j*row]); + } + } + + + for(int i = 0; i < row; i++) + xbar[i] = zrdivs(sum[i], col); + + doubleComplex one[col]; // Creating a matrix of ones + zonesa(one,1,col); + + + doubleComplex prod[row*col]; + zmulma(xbar, row, 1, one, 1, col, prod); + + for(int i = 0; i< row*col; i++) + out[i] = zdiffs(inp[i], prod[i]); +} diff --git a/2.3-1/src/c/statisticsFunctions/center/zcenterrowa.c b/2.3-1/src/c/statisticsFunctions/center/zcenterrowa.c new file mode 100644 index 00000000..cddd3403 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/center/zcenterrowa.c @@ -0,0 +1,44 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "addition.h" +#include "subtraction.h" +#include "multiplication.h" +#include "division.h" +#include "center.h" +#include "doubleComplex.h" +#include "sqrt.h" + +void zcenterrowa (doubleComplex* inp, int row, int col, doubleComplex* out) +{ + + doubleComplex sum[col], xbar[col]; + for(int i = 0; i < col; i++) + sum[i] = DoubleComplex(0,0); + + + for(int i = 0; i < col; i++) + { + for(int j = 0; j < row; j++) + { + sum[i] = zadds(sum[i], inp[j + i*row]); + } + } + + + + for(int i = 0; i < col; i++) + xbar[i] = zrdivs(sum[i], row); + + doubleComplex one[row]; // Creating a matrix of ones + zonesa(one,row,1); + + doubleComplex prod[row*col]; + zmulma(one, row, 1, xbar, 1, col, prod); + + + + for(int i = 0; i< row*col; i++) + out[i] = zdiffs(inp[i], prod[i]); +} diff --git a/2.3-1/src/c/statisticsFunctions/correl/dcorrelfres.c b/2.3-1/src/c/statisticsFunctions/correl/dcorrelfres.c new file mode 100644 index 00000000..7d4c718a --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/correl/dcorrelfres.c @@ -0,0 +1,56 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "addition.h" +#include "subtraction.h" +#include "multiplication.h" +#include "division.h" +#include "sqrt.h" +#include "sum.h" +#include "correl.h" +#include "matrix.h" +#include "mean.h" + +double dcorrelfres (double* inp1, int sr1, int sc1, double* inp2, int sr2, int sc2, double* inp3, int sr3, int sc3) +{ + double p1[sr3], p2[sc3], m1 = 0, m2 = 0, s1 = 0, s2 = 0, s3 = 0, diff1[sr1*sc1], diff2[sr2*sc2], sum = 0, prod[sr3]; + + double fr[sr3*sc3]; + + for(int i = 0; i < sr3*sc3; i++) + s3 += inp3[i]; + + for(int i = 0; i < sr3*sc3; i++) + fr[i] = inp3[i]/s3; + + + + dcolumnsuma(fr, sr3, sc3, p1); + drowsuma(fr, sr3, sc3, p2); + + + + m1 = dmulv(inp1, p1, sr3); + m2 = dmulv(inp2, p2, sc3); + + for(int i = 0; i < sr1*sc1; i++) + diff1[i] = pow(inp1[i] - m1, 2); + + for(int i = 0; i < sr2*sc2; i++) + diff2[i] = pow(inp2[i] - m2, 2); + + + s1 = dsqrts(dmulv(diff1, p1, sr3)); + s2 = dsqrts(dmulv(p2, diff2, sc3)); + + for(int i = 0; i < sr1*sc1; i++) + diff1[i] = inp1[i] - m1; + + for(int i = 0; i < sr2*sc2; i++) + diff2[i] = inp2[i] - m2; + + dmulma(fr, sr3, sc3, diff2, sc2, 1, prod); + + return dmulv(diff1, prod, sr3)/(s1*s2); +} diff --git a/2.3-1/src/c/statisticsFunctions/correl/dcorrels.c b/2.3-1/src/c/statisticsFunctions/correl/dcorrels.c new file mode 100644 index 00000000..eda07fc1 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/correl/dcorrels.c @@ -0,0 +1,35 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "addition.h" +#include "subtraction.h" +#include "multiplication.h" +#include "division.h" +#include "sqrt.h" +#include "sum.h" +#include "correl.h" +#include "matrix.h" +#include "mean.h" + +double dcorrels (double* inp1, int sr1, int sc1, double* inp2, int sr2, int sc2) +{ + double m1 = 0, m2 = 0, s1 = 0, s2 = 0, diff1[sr1*sc1], diff2[sr2*sc2], sum = 0; + m1 = dmeana(inp1, sr1*sc1); + m2 = dmeana(inp2, sr2*sc2); + + for(int i = 0; i < sr1*sc1; i++) + diff1[i] = pow(inp1[i] - m1, 2); + + for(int i = 0; i < sr2*sc2; i++) + diff2[i] = pow(inp2[i] - m2, 2); + + + s1 = dsqrts(dsuma(diff1, sr1*sc1)); + s2 = dsqrts(dsuma(diff2, sr2*sc2)); + + for(int i = 0; i < sr2*sc2; i++) + sum += (inp1[i] - m1) * (inp2[i] - m2); + + return sum / (s1*s2); +} diff --git a/2.3-1/src/c/statisticsFunctions/correl/scorrelfres.c b/2.3-1/src/c/statisticsFunctions/correl/scorrelfres.c new file mode 100644 index 00000000..2d056a5b --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/correl/scorrelfres.c @@ -0,0 +1,56 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "addition.h" +#include "subtraction.h" +#include "multiplication.h" +#include "division.h" +#include "sqrt.h" +#include "sum.h" +#include "correl.h" +#include "matrix.h" +#include "mean.h" + +float scorrelfres (float* inp1, int sr1, int sc1, float* inp2, int sr2, int sc2, float* inp3, int sr3, int sc3) +{ + float p1[sr3], p2[sc3], m1 = 0, m2 = 0, s1 = 0, s2 = 0, s3 = 0, diff1[sr1*sc1], diff2[sr2*sc2], sum = 0, prod[sr3]; + + float fr[sr3*sc3]; + + for(int i = 0; i < sr3*sc3; i++) + s3 += inp3[i]; + + for(int i = 0; i < sr3*sc3; i++) + fr[i] = inp3[i]/s3; + + + + scolumnsuma(fr, sr3, sc3, p1); + srowsuma(fr, sr3, sc3, p2); + + + + m1 = smulv(inp1, p1, sr3); + m2 = smulv(inp2, p2, sc3); + + for(int i = 0; i < sr1*sc1; i++) + diff1[i] = pow(inp1[i] - m1, 2); + + for(int i = 0; i < sr2*sc2; i++) + diff2[i] = pow(inp2[i] - m2, 2); + + + s1 = ssqrts(smulv(diff1, p1, sr3)); + s2 = ssqrts(smulv(p2, diff2, sc3)); + + for(int i = 0; i < sr1*sc1; i++) + diff1[i] = inp1[i] - m1; + + for(int i = 0; i < sr2*sc2; i++) + diff2[i] = inp2[i] - m2; + + smulma(fr, sr3, sc3, diff2, sc2, 1, prod); + + return smulv(diff1, prod, sr3)/(s1*s2); +} diff --git a/2.3-1/src/c/statisticsFunctions/correl/scorrels.c b/2.3-1/src/c/statisticsFunctions/correl/scorrels.c new file mode 100644 index 00000000..892d8762 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/correl/scorrels.c @@ -0,0 +1,35 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "addition.h" +#include "subtraction.h" +#include "multiplication.h" +#include "division.h" +#include "sqrt.h" +#include "sum.h" +#include "correl.h" +#include "matrix.h" +#include "mean.h" + +float scorrels (float* inp1, int sr1, int sc1, float* inp2, int sr2, int sc2) +{ + float m1 = 0, m2 = 0, s1 = 0, s2 = 0, diff1[sr1*sc1], diff2[sr2*sc2], sum = 0; + m1 = smeana(inp1, sr1*sc1); + m2 = smeana(inp2, sr2*sc2); + + for(int i = 0; i < sr1*sc1; i++) + diff1[i] = pow(inp1[i] - m1, 2); + + for(int i = 0; i < sr2*sc2; i++) + diff2[i] = pow(inp2[i] - m2, 2); + + + s1 = ssqrts(ssuma(diff1, sr1*sc1)); + s2 = ssqrts(ssuma(diff2, sr2*sc2)); + + for(int i = 0; i < sr2*sc2; i++) + sum += (inp1[i] - m1) * (inp2[i] - m2); + + return sum / (s1*s2); +} diff --git a/2.3-1/src/c/statisticsFunctions/correl/zcorrelfres.c b/2.3-1/src/c/statisticsFunctions/correl/zcorrelfres.c new file mode 100644 index 00000000..b026c58a --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/correl/zcorrelfres.c @@ -0,0 +1,58 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "addition.h" +#include "subtraction.h" +#include "multiplication.h" +#include "division.h" +#include "pow.h" +#include "sqrt.h" +#include "sum.h" +#include "correl.h" +#include "matrix.h" +#include "mean.h" +#include "doubleComplex.h" + +doubleComplex zcorrelfres (doubleComplex* inp1, int sr1, int sc1, doubleComplex* inp2, int sr2, int sc2, doubleComplex* inp3, int sr3, int sc3) +{ + doubleComplex p1[sr3], p2[sc3], m1 = 0, m2 = 0, s1 = 0, s2 = 0, s3 = 0, diff1[sr1*sc1], diff2[sr2*sc2], sum = 0, prod[sr3]; + + doubleComplex fr[sr3*sc3]; + + for(int i = 0; i < sr3*sc3; i++) + s3 = zadds(s3, inp3[i]); + + for(int i = 0; i < sr3*sc3; i++) + fr[i] = zrdivs(inp3[i],s3); + + + + zcolumnsuma(fr, sr3, sc3, p1); + zrowsuma(fr, sr3, sc3, p2); + + + + m1 = zmulv(inp1, p1, sr3); + m2 = zmulv(inp2, p2, sc3); + + for(int i = 0; i < sr1*sc1; i++) + diff1[i] = zpows(zdiffs(inp1[i], m1), DoubleComplex(2,0)); + + for(int i = 0; i < sr2*sc2; i++) + diff2[i] = zpows(zdiffs(inp2[i], m2), DoubleComplex(2,0)); + + + s1 = zsqrts(zmulv(diff1, p1, sr3)); + s2 = zsqrts(zmulv(p2, diff2, sc3)); + + for(int i = 0; i < sr1*sc1; i++) + diff1[i] = zdiffs(inp1[i], m1); + + for(int i = 0; i < sr2*sc2; i++) + diff2[i] = zdiffs(inp2[i], m2); + + zmulma(fr, sr3, sc3, diff2, sc2, 1, prod); + + return zrdivs(zmulv(diff1, prod, sr3), zmuls(s1, s2)); +} diff --git a/2.3-1/src/c/statisticsFunctions/correl/zcorrels.c b/2.3-1/src/c/statisticsFunctions/correl/zcorrels.c new file mode 100644 index 00000000..818a6800 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/correl/zcorrels.c @@ -0,0 +1,37 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "addition.h" +#include "subtraction.h" +#include "multiplication.h" +#include "division.h" +#include "pow.h" +#include "sqrt.h" +#include "sum.h" +#include "correl.h" +#include "matrix.h" +#include "mean.h" +#include "doubleComplex.h" + +doubleComplex zcorrels (doubleComplex* inp1, int sr1, int sc1, doubleComplex* inp2, int sr2, int sc2) +{ + doubleComplex m1 = 0, m2 = 0, s1 = 0, s2 = 0, diff1[sr1*sc1], diff2[sr2*sc2], sum = 0; + m1 = zmeana(inp1, sr1*sc1); + m2 = zmeana(inp2, sr2*sc2); + + for(int i = 0; i < sr1*sc1; i++) + diff1[i] = zpows(zdiffs(inp1[i], m1), DoubleComplex(2,0)); + + for(int i = 0; i < sr2*sc2; i++) + diff2[i] = zpows(zdiffs(inp2[i], m2), DoubleComplex(2,0)); + + + s1 = zsqrts(zsuma(diff1, sr1*sc1)); + s2 = zsqrts(zsuma(diff2, sr2*sc2)); + + for(int i = 0; i < sr2*sc2; i++) + sum = zadds(sum, zmuls(zdiffs(inp1[i], m1), zdiffs(inp2[i], m2))); + + return zrdivs(sum, zmuls(s1,s2)); +} diff --git a/2.3-1/src/c/statisticsFunctions/covar/dcovars.c b/2.3-1/src/c/statisticsFunctions/covar/dcovars.c new file mode 100644 index 00000000..f67905ee --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/covar/dcovars.c @@ -0,0 +1,70 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "addition.h" +#include "subtraction.h" +#include "multiplication.h" +#include "division.h" +#include "sqrt.h" +#include "sum.h" +#include "correl.h" +#include "matrix.h" +#include "mean.h" + +double dcovars (double* inp1, int sr1, int sc1, double* inp2, int sr2, int sc2, double* fre, int sr3, int sc3) +{ + double fr[sr3*sc3], s3 = 0, sfrr[sc3], p1[sc2*sc3], s1 = 0, d1[sc2] , one[sr1*sc1], p2[sc1 * sc2], p3[sr3*sc3], sfrc[sr3], p4[sr3], s2 = 0, d2[sr1*sc1], one2[sr2*sc2], p5[sr1*sc1*sr2*sc2], p6[sr1*sc1*sr2*sc2],s4 = 0; + + for(int i = 0; i < sr3*sc3; i++) + s3 += fre[i]; + + for(int i = 0; i < sr3*sc3; i++) + fr[i] = fre[i]/s3; + + drowsuma(fr, sr3, sc3, sfrr); + + for(int i = 0; i < sc3; i++) + p1[i] = inp2[i] * sfrr[i]; + + for(int i = 0; i < sc3; i++) + s1 += p1[i]; + + + + for(int i = 0; i < sc2; i++) + d1[i] = inp2[i] - s1; + + donesa(one, sr1*sc1, 1); + + dmulma(one, sr1*sc1, 1, d1, 1, sc2, p2); + + for(int i = 0; i < sr3*sc3; i++) + p3[i] = fr[i] * p2[i]; + + dcolumnsuma(fr, sr3, sc3, sfrc); + + for(int i = 0; i < sr3; i++) + p4[i] = inp1[i] * sfrc[i]; + + for(int i = 0; i < sr3; i++) + s2 += p4[i]; + + for(int i = 0; i < sr1*sc1; i++) + d2[i] = inp1[i] - s2; + + donesa(one2, 1, sr2*sc2); + + dmulma(d2, sr1*sc1, 1, one2, 1, sr2*sc2, p5); + + for(int i = 0; i < sr1*sc1*sr2*sc2; i++) + p6[i] = p5[i] * p3[i]; + + + for(int i = 0; i < sr1*sc1*sr2*sc2; i++) + s4 += p6[i]; + + + return s4; + +} diff --git a/2.3-1/src/c/statisticsFunctions/covar/scovars.c b/2.3-1/src/c/statisticsFunctions/covar/scovars.c new file mode 100644 index 00000000..daff6b94 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/covar/scovars.c @@ -0,0 +1,70 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "addition.h" +#include "subtraction.h" +#include "multiplication.h" +#include "division.h" +#include "sqrt.h" +#include "sum.h" +#include "correl.h" +#include "matrix.h" +#include "mean.h" + +float scovars (float* inp1, int sr1, int sc1, float* inp2, int sr2, int sc2, float* fre, int sr3, int sc3) +{ + float fr[sr3*sc3], s3 = 0, sfrr[sc3], p1[sc2*sc3], s1 = 0, d1[sc2] , one[sr1*sc1], p2[sc1 * sc2], p3[sr3*sc3], sfrc[sr3], p4[sr3], s2 = 0, d2[sr1*sc1], one2[sr2*sc2], p5[sr1*sc1*sr2*sc2], p6[sr1*sc1*sr2*sc2],s4 = 0; + + for(int i = 0; i < sr3*sc3; i++) + s3 += fre[i]; + + for(int i = 0; i < sr3*sc3; i++) + fr[i] = fre[i]/s3; + + srowsuma(fr, sr3, sc3, sfrr); + + for(int i = 0; i < sc3; i++) + p1[i] = inp2[i] * sfrr[i]; + + for(int i = 0; i < sc3; i++) + s1 += p1[i]; + + + + for(int i = 0; i < sc2; i++) + d1[i] = inp2[i] - s1; + + sonesa(one, sr1*sc1, 1); + + smulma(one, sr1*sc1, 1, d1, 1, sc2, p2); + + for(int i = 0; i < sr3*sc3; i++) + p3[i] = fr[i] * p2[i]; + + scolumnsuma(fr, sr3, sc3, sfrc); + + for(int i = 0; i < sr3; i++) + p4[i] = inp1[i] * sfrc[i]; + + for(int i = 0; i < sr3; i++) + s2 += p4[i]; + + for(int i = 0; i < sr1*sc1; i++) + d2[i] = inp1[i] - s2; + + sonesa(one2, 1, sr2*sc2); + + smulma(d2, sr1*sc1, 1, one2, 1, sr2*sc2, p5); + + for(int i = 0; i < sr1*sc1*sr2*sc2; i++) + p6[i] = p5[i] * p3[i]; + + + for(int i = 0; i < sr1*sc1*sr2*sc2; i++) + s4 += p6[i]; + + + return s4; + +} diff --git a/2.3-1/src/c/statisticsFunctions/covar/zcovars.c b/2.3-1/src/c/statisticsFunctions/covar/zcovars.c new file mode 100644 index 00000000..6adbd3c9 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/covar/zcovars.c @@ -0,0 +1,71 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "addition.h" +#include "subtraction.h" +#include "multiplication.h" +#include "division.h" +#include "sqrt.h" +#include "sum.h" +#include "correl.h" +#include "matrix.h" +#include "mean.h" +#include "doubleComplex.h" + +doubleComplex zcovars (doubleComplex* inp1, int sr1, int sc1, doubleComplex* inp2, int sr2, int sc2, doubleComplex* fre, int sr3, int sc3) +{ + doubleComplex fr[sr3*sc3], s3 = 0, sfrr[sc3], p1[sc2*sc3], s1 = 0, d1[sc2] , one[sr1*sc1], p2[sc1 * sc2], p3[sr3*sc3], sfrc[sr3], p4[sr3], s2 = 0, d2[sr1*sc1], one2[sr2*sc2], p5[sr1*sc1*sr2*sc2], p6[sr1*sc1*sr2*sc2],s4 = 0; + + for(int i = 0; i < sr3*sc3; i++) + s3 = zadds(s3, fre[i]); + + for(int i = 0; i < sr3*sc3; i++) + fr[i] = zrdivs(fre[i], s3); + + zrowsuma(fr, sr3, sc3, sfrr); + + for(int i = 0; i < sc3; i++) + p1[i] = zmuls(inp2[i], sfrr[i]); + + for(int i = 0; i < sc3; i++) + s1 = zadds(s1, p1[i]); + + + + for(int i = 0; i < sc2; i++) + d1[i] = zdiffs(inp2[i], s1); + + zonesa(one, sr1*sc1, 1); + + zmulma(one, sr1*sc1, 1, d1, 1, sc2, p2); + + for(int i = 0; i < sr3*sc3; i++) + p3[i] = fr[i] * p2[i]; + + zcolumnsuma(fr, sr3, sc3, sfrc); + + for(int i = 0; i < sr3; i++) + p4[i] = zmuls(inp1[i], sfrc[i]); + + for(int i = 0; i < sr3; i++) + s2 = zadds(s2, p4[i]); + + for(int i = 0; i < sr1*sc1; i++) + d2[i] = zdiffs(inp1[i], s2); + + zonesa(one2, 1, sr2*sc2); + + zmulma(d2, sr1*sc1, 1, one2, 1, sr2*sc2, p5); + + for(int i = 0; i < sr1*sc1*sr2*sc2; i++) + p6[i] = zmuls(p5[i], p3[i]); + + + for(int i = 0; i < sr1*sc1*sr2*sc2; i++) + s4 = zadds(s4, p6[i]); + + + return s4; + +} diff --git a/2.3-1/src/c/statisticsFunctions/includes/center.h b/2.3-1/src/c/statisticsFunctions/includes/center.h new file mode 100644 index 00000000..57a109b3 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/includes/center.h @@ -0,0 +1,47 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __CENTER_H__ +#define __CENTER_H__ +#include "types.h" +#include "doubleComplex.h" +#include "floatComplex.h" +#include <math.h> +#include <ones.h> +#include "addition.h" +#include "subtraction.h" +#include "multiplication.h" +#include "division.h" +#include "sqrt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dcentera (double* inp, int row, int col, double* out); +void dcentercola (double* inp, int row, int col, double* out); +void dcenterrowa (double* inp, int row, int col, double* out); + +void scentera (float* inp, int row, int col, float* out); +void scentercola (float* inp, int row, int col, float* out); +void scenterrowa (float* inp, int row, int col, float* out); + +void zcentera (doubleComplex* inp, int row, int col, doubleComplex* out); +void zcentercola (doubleComplex* inp, int row, int col, doubleComplex* out); +void zcenterrowa (doubleComplex* inp, int row, int col, doubleComplex* out); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__CENTER_H__*/ diff --git a/2.3-1/src/c/statisticsFunctions/includes/correl.h b/2.3-1/src/c/statisticsFunctions/includes/correl.h new file mode 100644 index 00000000..8a9c0365 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/includes/correl.h @@ -0,0 +1,48 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __CORREL_H__ +#define __CORREL_H__ +#include "types.h" +#include "doubleComplex.h" +#include "floatComplex.h" +#include <math.h> +#include <ones.h> +#include "addition.h" +#include "subtraction.h" +#include "multiplication.h" +#include "division.h" +#include "sqrt.h" +#include "sum.h" +#include "correl.h" +#include "matrix.h" +#include "mean.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double dcorrels (double* inp1, int sr1, int sc1, double* inp2, int sr2, int sc2); +double dcorrelfres (double* inp1, int sr1, int sc1, double* inp2, int sr2, int sc2, double* inp3, int sr3, int sc3); + +float scorrels (float* inp1, int sr1, int sc1, float* inp2, int sr2, int sc2); +float scorrelfres (float* inp1, int sr1, int sc1, float* inp2, int sr2, int sc2, float* inp3, int sr3, int sc3); + +doubleComplex zcorrels (doubleComplex* inp1, int sr1, int sc1, doubleComplex* inp2, int sr2, int sc2); +doubleComplex zcorrelfres (doubleComplex* inp1, int sr1, int sc1, doubleComplex* inp2, int sr2, int sc2, doubleComplex* inp3, int sr3, int sc3); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__CORREL_H__*/ diff --git a/2.3-1/src/c/statisticsFunctions/includes/covar.h b/2.3-1/src/c/statisticsFunctions/includes/covar.h new file mode 100644 index 00000000..4f37f852 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/includes/covar.h @@ -0,0 +1,43 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __COVAR_H__ +#define __COVAR_H__ +#include "types.h" +#include "doubleComplex.h" +#include "floatComplex.h" +#include <math.h> +#include <ones.h> +#include "addition.h" +#include "subtraction.h" +#include "multiplication.h" +#include "division.h" +#include "sqrt.h" +#include "sum.h" +#include "correl.h" +#include "matrix.h" +#include "mean.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double dcovars (double* inp1, int sr1, int sc1, double* inp2, int sr2, int sc2, double* fre, int sr3, int sc3); +float scovars (float* inp1, int sr1, int sc1, float* inp2, int sr2, int sc2, float* fre, int sr3, int sc3); +doubleComplex zcovars (doubleComplex* inp1, int sr1, int sc1, doubleComplex* inp2, int sr2, int sc2, doubleComplex* fre, int sr3, int sc3); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__COVAR_H__*/ diff --git a/2.3-1/src/c/statisticsFunctions/includes/wcenter.h b/2.3-1/src/c/statisticsFunctions/includes/wcenter.h new file mode 100644 index 00000000..3919fd37 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/includes/wcenter.h @@ -0,0 +1,47 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#ifndef __WCENTER_H__ +#define __WCENTER_H__ +#include "types.h" +#include "doubleComplex.h" +#include "floatComplex.h" +#include <math.h> +#include <ones.h> +#include "addition.h" +#include "subtraction.h" +#include "multiplication.h" +#include "division.h" +#include "sqrt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void dwcentera (double* inp, int row, int col, double* out); +void dwcentercola (double* inp, int row, int col, double* out); +void dwcenterrowa (double* inp, int row, int col, double* out); + +void swcentera (float* inp, int row, int col, float* out); +void swcentercola (float* inp, int row, int col, float* out); +void swcenterrowa (float* inp, int row, int col, float* out); + +void zwcentera (doubleComplex* inp, int row, int col, doubleComplex* out); +void zwcentercola (doubleComplex* inp, int row, int col, doubleComplex* out); +void zwcenterrowa (doubleComplex* inp, int row, int col, doubleComplex* out); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__WCENTER_H__*/ diff --git a/2.3-1/src/c/statisticsFunctions/interfaces/int_center.h b/2.3-1/src/c/statisticsFunctions/interfaces/int_center.h new file mode 100644 index 00000000..041937e0 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/interfaces/int_center.h @@ -0,0 +1,36 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __INT_CENTER_H__ +#define __INT_CENTER_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define d2centerd2(in1,size, out) dcentera(in1,size[0],size[1],out) +#define d2g2centerd2(in1, size, in2, size2 ,out) (in2[0] == 'r') ? dcenterrowa(in1, size[0], size[1], out) : dcentercola(in1, size[0], size[1], out) +#define d2d0centerd2(in1, size, in2 ,out) (in2 == 1) ? dcenterrowa(in1, size[0], size[1], out) : dcentercola(in1, size[0], size[1], out) + +#define s2centers2(in1,size, out) scentera(in1,size[0],size[1],out) +#define s2g2centers2(in1, size, in2, size2 ,out) (in2[0] == 'r') ? scenterrowa(in1, size[0], size[1], out) : scentercola(in1, size[0], size[1], out) +#define s2d0centers2(in1, size, in2 ,out) (in2 == 1) ? scenterrowa(in1, size[0], size[1], out) : scentercola(in1, size[0], size[1], out) + +#define z2centerz2(in1,size, out) zcentera(in1,size[0],size[1],out) +#define z2g2centerz2(in1, size, in2, size2 ,out) (in2[0] == 'r') ? zcenterrowa(in1, size[0], size[1], out) : zcentercola(in1, size[0], size[1], out) +#define z2d0centerz2(in1, size, in2 ,out) (in2 == 1) ? zcenterrowa(in1, size[0], size[1], out) : zcentercola(in1, size[0], size[1], out) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_CENTER_H__*/ diff --git a/2.3-1/src/c/statisticsFunctions/interfaces/int_correl.h b/2.3-1/src/c/statisticsFunctions/interfaces/int_correl.h new file mode 100644 index 00000000..8dd5c31e --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/interfaces/int_correl.h @@ -0,0 +1,34 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __INT_CORREL_H__ +#define __INT_CORREL_H__ + +#ifdef __cplusplus +extern "C" { +#endif + + +#define d2d2correld0(in1, size, in2, size2) dcorrels(in1, size[0], size[1], in2, size2[0], size2[1]) +#define d2d2d2correld0(in1, size, in2, size2, in3, size3) dcorrelfres(in1, size[0], size[1], in2, size2[0], size2[1], in3, size3[0], size3[1]) + +#define s2s2correls0(in1, size, in2, size2) scorrels(in1, size[0], size[1], in2, size2[0], size2[1]) +#define s2s2s2correls0(in1, size, in2, size2, in3, size3) scorrelfres(in1, size[0], size[1], in2, size2[0], size2[1], in3, size3[0], size3[1]) + +#define z2z2correlz0(in1, size, in2, size2) zcorrels(in1, size[0], size[1], in2, size2[0], size2[1]) +#define z2z2z2correlz0(in1, size, in2, size2, in3, size3) zcorrelfres(in1, size[0], size[1], in2, size2[0], size2[1], in3, size3[0], size3[1]) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_CORREL_H__*/ diff --git a/2.3-1/src/c/statisticsFunctions/interfaces/int_covar.h b/2.3-1/src/c/statisticsFunctions/interfaces/int_covar.h new file mode 100644 index 00000000..5ebef22f --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/interfaces/int_covar.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: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __INT_COVAR_H__ +#define __INT_COVAR_H__ + +#ifdef __cplusplus +extern "C" { +#endif + + +#define d2d2d2covard0(in1, size, in2, size2, in3, size3) dcovars(in1, size[0], size[1], in2, size2[0], size2[1], in3, size3[0], size3[1]) +#define s2s2s2covars0(in1, size, in2, size2, in3, size3) scovars(in1, size[0], size[1], in2, size2[0], size2[1], in3, size3[0], size3[1]) +#define z2z2z2covarz0(in1, size, in2, size2, in3, size3) zcovars(in1, size[0], size[1], in2, size2[0], size2[1], in3, size3[0], size3[1]) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_COVAR_H__*/ diff --git a/2.3-1/src/c/statisticsFunctions/interfaces/int_wcenter.h b/2.3-1/src/c/statisticsFunctions/interfaces/int_wcenter.h new file mode 100644 index 00000000..38273af1 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/interfaces/int_wcenter.h @@ -0,0 +1,36 @@ + /* Copyright (C) 2017 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __INT_WCENTER_H__ +#define __INT_WCENTER_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define d2wcenterd2(in1,size, out) dwcentera(in1,size[0],size[1],out) +#define d2g2wcenterd2(in1, size, in2, size2 ,out) (in2[0] == 'r') ? dwcenterrowa(in1, size[0], size[1], out) : dwcentercola(in1, size[0], size[1], out) +#define d2d0wcenterd2(in1, size, in2 ,out) (in2 == 1) ? dwcenterrowa(in1, size[0], size[1], out) : dwcentercola(in1, size[0], size[1], out) + +#define s2wcenters2(in1,size, out) swcentera(in1,size[0],size[1],out) +#define s2g2wcenters2(in1, size, in2, size2 ,out) (in2[0] == 'r') ? swcenterrowa(in1, size[0], size[1], out) : swcentercola(in1, size[0], size[1], out) +#define s2d0wcenters2(in1, size, in2 ,out) (in2 == 1) ? swcenterrowa(in1, size[0], size[1], out) : swcentercola(in1, size[0], size[1], out) + +#define z2wcenterz2(in1,size, out) zwcentera(in1,size[0],size[1],out) +#define z2g2wcenterz2(in1, size, in2, size2 ,out) (in2[0] == 'r') ? zwcenterrowa(in1, size[0], size[1], out) : zwcentercola(in1, size[0], size[1], out) +#define z2d0wcenterz2(in1, size, in2 ,out) (in2 == 1) ? zwcenterrowa(in1, size[0], size[1], out) : zwcentercola(in1, size[0], size[1], out) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_WCENTER_H__*/ diff --git a/2.3-1/src/c/statisticsFunctions/moment/dmoments.c b/2.3-1/src/c/statisticsFunctions/moment/dmoments.c index b9d8564a..779ffa0f 100644 --- a/2.3-1/src/c/statisticsFunctions/moment/dmoments.c +++ b/2.3-1/src/c/statisticsFunctions/moment/dmoments.c @@ -8,7 +8,7 @@ double dmoments (double* inp, int size, double ord) { double sum = 0; - for(int i = 0; i < size; i++) + for(int i = 0; i < size; i++) // Elements are raised to the order and then their mean is calculated to give moment { sum = sum + pow(inp[i], ord); } diff --git a/2.3-1/src/c/statisticsFunctions/moment/smoments.c b/2.3-1/src/c/statisticsFunctions/moment/smoments.c index aee9dc9e..c900d815 100644 --- a/2.3-1/src/c/statisticsFunctions/moment/smoments.c +++ b/2.3-1/src/c/statisticsFunctions/moment/smoments.c @@ -8,7 +8,7 @@ float smoments (float* inp, int size, double ord) { float sum = 0; - for(int i = 0; i < size; i++) + for(int i = 0; i < size; i++) // Elements are raised to the order and then their mean is calculated to give moment { sum = sum + pow(inp[i], ord); } diff --git a/2.3-1/src/c/statisticsFunctions/moment/zmoments.c b/2.3-1/src/c/statisticsFunctions/moment/zmoments.c index 1b847376..b70df707 100644 --- a/2.3-1/src/c/statisticsFunctions/moment/zmoments.c +++ b/2.3-1/src/c/statisticsFunctions/moment/zmoments.c @@ -13,7 +13,7 @@ doubleComplex zmoments (doubleComplex* inp, int size, double ord) { doubleComplex sum = DoubleComplex(0,0); - for(int i = 0; i < size; i++) + for(int i = 0; i < size; i++) // Elements are raised to the order and then their mean is calculated to give moment { sum = zadds(sum,zpows(inp[i], ord)); } diff --git a/2.3-1/src/c/statisticsFunctions/wcenter/dwcentera.c b/2.3-1/src/c/statisticsFunctions/wcenter/dwcentera.c new file mode 100644 index 00000000..5c05cc86 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/wcenter/dwcentera.c @@ -0,0 +1,34 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "subtraction.h" +#include "multiplication.h" +#include "wcenter.h" + +void dwcentera (double* inp, int row, int col, double* out) +{ + double sum = 0, xbar = 0, sigma = 0; + for(int i = 0; i < row*col; i++) // Findinag the maen of all the elements of the matrix + sum += inp[i]; + xbar = sum/(row*col); + + double one[row*col]; // Creating a matrix of ones + donesa(one,row,col); + + double prod[row*col]; + for(int i = 0; i < row*col; i++) // Applying the formula (x(i,j)-xbar)/sigma + prod[i] = one[i]*xbar; + + for(int i = 0; i < row*col; i++) + out[i] = inp[i] - prod[i]; + + sum = 0; + for(int i = 0; i < row*col; i++) + sum = sum + out[i]*out[i]; + + sigma = sqrt(sum/(row*col-1)); + + for(int i = 0; i < row*col; i++) + out[i] = out[i]/sigma; +} diff --git a/2.3-1/src/c/statisticsFunctions/wcenter/dwcentercola.c b/2.3-1/src/c/statisticsFunctions/wcenter/dwcentercola.c new file mode 100644 index 00000000..ab82acfe --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/wcenter/dwcentercola.c @@ -0,0 +1,64 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "subtraction.h" +#include "matrixMultiplication.h" +#include "wcenter.h" + +void dwcentercola (double* inp, int row, int col, double* out) +{ + + double sum[row], xbar[row]; + for(int i = 0; i < row; i++) + sum[i] = 0; + + + for(int i = 0; i < row; i++) + { + for(int j = 0; j < col; j++) + { + sum[i] += inp[i + j*row]; + } + } + + //for(int i = 0; i < row; i++) + //printf("%lf \n",sum[i]); + + for(int i = 0; i < row; i++) + xbar[i] = sum[i]/col; + + double one[col]; // Creating a matrix of ones + donesa(one,1,col); + + + double prod[row*col]; + dmulma(xbar, row, 1, one, 1, col, prod); + + for(int i = 0; i< row*col; i++) + out[i] = inp[i] - prod[i]; + + for(int i = 0; i < row; i++) + sum[i] = 0; + + for(int i = 0; i < row; i++) + { + for(int j = 0; j < col; j++) + { + sum[i] += out[i + j*row] * out[i + j*row]; + } + } + + double sigma[row]; + for(int i = 0; i < row; i++) + sigma[i] = sqrt(sum[i]/(col-1)); + + for(int i = 0; i < row*col; i++) + prod[i] = 0; + + dmulma(sigma, row, 1, one, 1, col, prod); + + for(int i = 0; i < row*col; i++) + out[i] = out[i] / prod[i]; + +} diff --git a/2.3-1/src/c/statisticsFunctions/wcenter/dwcenterrowa.c b/2.3-1/src/c/statisticsFunctions/wcenter/dwcenterrowa.c new file mode 100644 index 00000000..72e37931 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/wcenter/dwcenterrowa.c @@ -0,0 +1,68 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "subtraction.h" +#include "matrixMultiplication.h" +#include "wcenter.h" + +void dwcenterrowa (double* inp, int row, int col, double* out) +{ + + double sum[col], xbar[col]; + for(int i = 0; i < col; i++) + sum[i] = 0; + + + for(int i = 0; i < col; i++) + { + for(int j = 0; j < row; j++) + { + sum[i] += inp[j + i*row]; + } + } + + + + for(int i = 0; i < col; i++) + xbar[i] = sum[i]/row; + + double one[row]; // Creating a matrix of ones + donesa(one,row,1); + + double prod[row*col]; + dmulma(one, row, 1, xbar, 1, col, prod); + + + + for(int i = 0; i< row*col; i++) + out[i] = inp[i] - prod[i]; + + + for(int i = 0; i < col; i++) + sum[i] = 0; + + for(int i = 0; i < col; i++) + { + for(int j = 0; j < row; j++) + { + sum[i] += out[j + i*row] * out[j + i*row]; + } + } + + + + double sigma[col]; + for(int i = 0; i < col; i++) + sigma[i] = sqrt(sum[i]/(row-1)); + + + for(int i = 0; i < row*col; i++) + prod[i] = 0; + + dmulma(one, row, 1, sigma, 1, col, prod); + + for(int i = 0; i < row*col; i++) + out[i] = out[i] / prod[i]; + +} diff --git a/2.3-1/src/c/statisticsFunctions/wcenter/swcentera.c b/2.3-1/src/c/statisticsFunctions/wcenter/swcentera.c new file mode 100644 index 00000000..91206fcf --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/wcenter/swcentera.c @@ -0,0 +1,34 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "subtraction.h" +#include "multiplication.h" +#include "wcenter.h" + +void swcentera (float* inp, int row, int col, float* out) +{ + float sum = 0, xbar = 0, sigma = 0; + for(int i = 0; i < row*col; i++) // Findinag the maen of all the elements of the matrix + sum += inp[i]; + xbar = sum/(row*col); + + float one[row*col]; // Creating a matrix of ones + sonesa(one,row,col); + + float prod[row*col]; + for(int i = 0; i < row*col; i++) // Applying the formula (x(i,j)-xbar)/sigma + prod[i] = one[i]*xbar; + + for(int i = 0; i < row*col; i++) + out[i] = inp[i] - prod[i]; + + sum = 0; + for(int i = 0; i < row*col; i++) + sum = sum + out[i]*out[i]; + + sigma = sqrt(sum/(row*col-1)); + + for(int i = 0; i < row*col; i++) + out[i] = out[i]/sigma; +} diff --git a/2.3-1/src/c/statisticsFunctions/wcenter/swcentercola.c b/2.3-1/src/c/statisticsFunctions/wcenter/swcentercola.c new file mode 100644 index 00000000..6fafe9f9 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/wcenter/swcentercola.c @@ -0,0 +1,61 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "subtraction.h" +#include "matrixMultiplication.h" +#include "wcenter.h" + +void swcentercola (float* inp, int row, int col, float* out) +{ + + float sum[row], xbar[row]; + for(int i = 0; i < row; i++) + sum[i] = 0; + + + for(int i = 0; i < row; i++) + { + for(int j = 0; j < col; j++) + { + sum[i] += inp[i + j*row]; + } + } + + for(int i = 0; i < row; i++) + xbar[i] = sum[i]/col; + + float one[col]; // Creating a matrix of ones + sonesa(one,1,col); + + + float prod[row*col]; + smulma(xbar, row, 1, one, 1, col, prod); + + for(int i = 0; i< row*col; i++) + out[i] = inp[i] - prod[i]; + + for(int i = 0; i < row; i++) + sum[i] = 0; + + for(int i = 0; i < row; i++) + { + for(int j = 0; j < col; j++) + { + sum[i] += out[i + j*row] * out[i + j*row]; + } + } + + float sigma[row]; + for(int i = 0; i < row; i++) + sigma[i] = sqrt(sum[i]/(col-1)); + + for(int i = 0; i < row*col; i++) + prod[i] = 0; + + smulma(sigma, row, 1, one, 1, col, prod); + + for(int i = 0; i < row*col; i++) + out[i] = out[i] / prod[i]; + +} diff --git a/2.3-1/src/c/statisticsFunctions/wcenter/swcenterrowa.c b/2.3-1/src/c/statisticsFunctions/wcenter/swcenterrowa.c new file mode 100644 index 00000000..ce1df2e9 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/wcenter/swcenterrowa.c @@ -0,0 +1,68 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "subtraction.h" +#include "matrixMultiplication.h" +#include "wcenter.h" + +void swcenterrowa (float* inp, int row, int col, float* out) +{ + + float sum[col], xbar[col]; + for(int i = 0; i < col; i++) + sum[i] = 0; + + + for(int i = 0; i < col; i++) + { + for(int j = 0; j < row; j++) + { + sum[i] += inp[j + i*row]; + } + } + + + + for(int i = 0; i < col; i++) + xbar[i] = sum[i]/row; + + float one[row]; // Creating a matrix of ones + sonesa(one,row,1); + + float prod[row*col]; + smulma(one, row, 1, xbar, 1, col, prod); + + + + for(int i = 0; i< row*col; i++) + out[i] = inp[i] - prod[i]; + + + for(int i = 0; i < col; i++) + sum[i] = 0; + + for(int i = 0; i < col; i++) + { + for(int j = 0; j < row; j++) + { + sum[i] += out[j + i*row] * out[j + i*row]; + } + } + + + + float sigma[col]; + for(int i = 0; i < col; i++) + sigma[i] = sqrt(sum[i]/(row-1)); + + + for(int i = 0; i < row*col; i++) + prod[i] = 0; + + smulma(one, row, 1, sigma, 1, col, prod); + + for(int i = 0; i < row*col; i++) + out[i] = out[i] / prod[i]; + +} diff --git a/2.3-1/src/c/statisticsFunctions/wcenter/zwcentera.c b/2.3-1/src/c/statisticsFunctions/wcenter/zwcentera.c new file mode 100644 index 00000000..8571dd62 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/wcenter/zwcentera.c @@ -0,0 +1,38 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "addition.h" +#include "subtraction.h" +#include "multiplication.h" +#include "division.h" +#include "wcenter.h" +#include "doubleComplex.h" +#include "sqrt.h" + +void zwcentera (doubleComplex* inp, int row, int col, doubleComplex* out) +{ + doubleComplex sum = 0, xbar = 0, sigma = 0; + for(int i = 0; i < row*col; i++) // Findinag the maen of all the elements of the matrix + sum = zadds(sum,inp[i]); + xbar = zrdivs(sum,(row*col)); + + doubleComplex one[row*col]; // Creating a matrix of ones + zonesa(one,row,col); + + doubleComplex prod[row*col]; + for(int i = 0; i < row*col; i++) // Applying the formula (x(i,j)-xbar)/sigma + prod[i] = zmuls(one[i],xbar); + + for(int i = 0; i < row*col; i++) + out[i] = zdiffs(inp[i], prod[i]); + + sum = DoubleComplex(0,0); + for(int i = 0; i < row*col; i++) + sum = zadds(sum, zmuls(out[i],out[i])); + + sigma = zsqrts(zrdivs(sum,(row*col-1))); + + for(int i = 0; i < row*col; i++) + out[i] = zrdivs(out[i],sigma); +} diff --git a/2.3-1/src/c/statisticsFunctions/wcenter/zwcentercola.c b/2.3-1/src/c/statisticsFunctions/wcenter/zwcentercola.c new file mode 100644 index 00000000..5e4e2bdd --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/wcenter/zwcentercola.c @@ -0,0 +1,66 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "addition.h" +#include "subtraction.h" +#include "multiplication.h" +#include "division.h" +#include "wcenter.h" +#include "doubleComplex.h" +#include "sqrt.h" + +void zwcentercola (doubleComplex* inp, int row, int col, doubleComplex* out) +{ + + doubleComplex sum[row], xbar[row]; + for(int i = 0; i < row; i++) + sum[i] = DoubleComplex(0,0); + + + for(int i = 0; i < row; i++) + { + for(int j = 0; j < col; j++) + { + sum[i] = zadds(sum[i], inp[i + j*row]); + } + } + + + for(int i = 0; i < row; i++) + xbar[i] = zrdivs(sum[i], col); + + doubleComplex one[col]; // Creating a matrix of ones + zonesa(one,1,col); + + + doubleComplex prod[row*col]; + zmulma(xbar, row, 1, one, 1, col, prod); + + for(int i = 0; i< row*col; i++) + out[i] = zdiffs(inp[i], prod[i]); + + for(int i = 0; i < row; i++) + sum[i] = DoubleComplex(0,0); + + for(int i = 0; i < row; i++) + { + for(int j = 0; j < col; j++) + { + sum[i] = zadds(sum[i], zmuls(out[i + j*row], out[i + j*row])); + } + } + + doubleComplex sigma[row]; + for(int i = 0; i < row; i++) + sigma[i] = zsqrts(zrdivs(sum[i],(col-1))); + + for(int i = 0; i < row*col; i++) + prod[i] = DoubleComplex(0,0); + + zmulma(sigma, row, 1, one, 1, col, prod); + + for(int i = 0; i < row*col; i++) + out[i] = zrdivs(out[i], prod[i]); + +} diff --git a/2.3-1/src/c/statisticsFunctions/wcenter/zwcenterrowa.c b/2.3-1/src/c/statisticsFunctions/wcenter/zwcenterrowa.c new file mode 100644 index 00000000..f68835d8 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/wcenter/zwcenterrowa.c @@ -0,0 +1,72 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <ones.h> +#include "addition.h" +#include "subtraction.h" +#include "multiplication.h" +#include "division.h" +#include "wcenter.h" +#include "doubleComplex.h" +#include "sqrt.h" + +void zwcenterrowa (doubleComplex* inp, int row, int col, doubleComplex* out) +{ + + doubleComplex sum[col], xbar[col]; + for(int i = 0; i < col; i++) + sum[i] = DoubleComplex(0,0); + + + for(int i = 0; i < col; i++) + { + for(int j = 0; j < row; j++) + { + sum[i] = zadds(sum[i], inp[j + i*row]); + } + } + + + + for(int i = 0; i < col; i++) + xbar[i] = zrdivs(sum[i], row); + + doubleComplex one[row]; // Creating a matrix of ones + zonesa(one,row,1); + + doubleComplex prod[row*col]; + zmulma(one, row, 1, xbar, 1, col, prod); + + + + for(int i = 0; i< row*col; i++) + out[i] = zdiffs(inp[i], prod[i]); + + + for(int i = 0; i < col; i++) + sum[i] = DoubleComplex(0,0); + + for(int i = 0; i < col; i++) + { + for(int j = 0; j < row; j++) + { + sum[i] = zadds(sum[i], zmuls(out[j + i*row], out[j + i*row])); + } + } + + + + doubleComplex sigma[col]; + for(int i = 0; i < col; i++) + sigma[i] = zsqrts(zrdivs(sum[i],(row-1))); + + + for(int i = 0; i < row*col; i++) + prod[i] = DoubleComplex(0,0); + + zmulma(one, row, 1, sigma, 1, col, prod); + + for(int i = 0; i < row*col; i++) + out[i] = zrdivs(out[i], prod[i]); + +} |