diff options
author | Brijeshcr | 2017-08-04 21:40:41 +0530 |
---|---|---|
committer | Brijeshcr | 2017-08-04 21:40:41 +0530 |
commit | 3633223e4816948c61e107f4fb18eb193c0add27 (patch) | |
tree | b0d5c593ca71e5b80b744892d01552b296965405 | |
parent | 54e1cdd2b4f5d4a214fab050e1d8b8e3790fe860 (diff) | |
download | Scilab2C-3633223e4816948c61e107f4fb18eb193c0add27.tar.gz Scilab2C-3633223e4816948c61e107f4fb18eb193c0add27.tar.bz2 Scilab2C-3633223e4816948c61e107f4fb18eb193c0add27.zip |
Added Covar
46 files changed, 346 insertions, 0 deletions
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/includes/sci2clib.h b/2.3-1/includes/sci2clib.h index d7964b5d..9a252ee7 100644 --- a/2.3-1/includes/sci2clib.h +++ b/2.3-1/includes/sci2clib.h @@ -677,6 +677,9 @@ extern "C" { /* interfacing correl */ #include "correl.h" #include "int_correl.h" +/* interfacing covar */ +#include "covar.h" +#include "int_covar.h" /* TYPE */ 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 aeb5ddf2..45d24f1b 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/ASTManagement/lib b/2.3-1/macros/ASTManagement/lib Binary files differnew file mode 100644 index 00000000..dee4362f --- /dev/null +++ b/2.3-1/macros/ASTManagement/lib diff --git a/2.3-1/macros/CCodeGeneration/lib b/2.3-1/macros/CCodeGeneration/lib Binary files differnew file mode 100644 index 00000000..3d4fed1d --- /dev/null +++ b/2.3-1/macros/CCodeGeneration/lib diff --git a/2.3-1/macros/ErrorMessages/lib b/2.3-1/macros/ErrorMessages/lib Binary files differnew file mode 100644 index 00000000..ba3b9a5a --- /dev/null +++ b/2.3-1/macros/ErrorMessages/lib diff --git a/2.3-1/macros/FunctionAnnotation/lib b/2.3-1/macros/FunctionAnnotation/lib Binary files differnew file mode 100644 index 00000000..239105c8 --- /dev/null +++ b/2.3-1/macros/FunctionAnnotation/lib diff --git a/2.3-1/macros/FunctionList/lib b/2.3-1/macros/FunctionList/lib Binary files differnew file mode 100644 index 00000000..1c722dd0 --- /dev/null +++ b/2.3-1/macros/FunctionList/lib diff --git a/2.3-1/macros/GeneralFunctions/lib b/2.3-1/macros/GeneralFunctions/lib Binary files differnew file mode 100644 index 00000000..7586a91b --- /dev/null +++ b/2.3-1/macros/GeneralFunctions/lib diff --git a/2.3-1/macros/Hardware/AVR/lib b/2.3-1/macros/Hardware/AVR/lib Binary files differnew file mode 100644 index 00000000..ed4c52b8 --- /dev/null +++ b/2.3-1/macros/Hardware/AVR/lib diff --git a/2.3-1/macros/Hardware/RasberryPi/Digital/lib b/2.3-1/macros/Hardware/RasberryPi/Digital/lib Binary files differnew file mode 100644 index 00000000..ba42ba7c --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/Digital/lib diff --git a/2.3-1/macros/Hardware/RasberryPi/I2C/lib b/2.3-1/macros/Hardware/RasberryPi/I2C/lib Binary files differnew file mode 100644 index 00000000..561476c1 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/I2C/lib diff --git a/2.3-1/macros/Hardware/RasberryPi/Interrupt/lib b/2.3-1/macros/Hardware/RasberryPi/Interrupt/lib Binary files differnew file mode 100644 index 00000000..97a61acb --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/Interrupt/lib diff --git a/2.3-1/macros/Hardware/RasberryPi/Misc/lib b/2.3-1/macros/Hardware/RasberryPi/Misc/lib Binary files differnew file mode 100644 index 00000000..c718615f --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/Misc/lib diff --git a/2.3-1/macros/Hardware/RasberryPi/SPI/lib b/2.3-1/macros/Hardware/RasberryPi/SPI/lib Binary files differnew file mode 100644 index 00000000..a16d474e --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/SPI/lib diff --git a/2.3-1/macros/Hardware/RasberryPi/Serial/lib b/2.3-1/macros/Hardware/RasberryPi/Serial/lib Binary files differnew file mode 100644 index 00000000..a007f001 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/Serial/lib diff --git a/2.3-1/macros/Hardware/RasberryPi/Setup/lib b/2.3-1/macros/Hardware/RasberryPi/Setup/lib Binary files differnew file mode 100644 index 00000000..83655c94 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/Setup/lib diff --git a/2.3-1/macros/Hardware/RasberryPi/Shift/lib b/2.3-1/macros/Hardware/RasberryPi/Shift/lib Binary files differnew file mode 100644 index 00000000..2b12025f --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/Shift/lib diff --git a/2.3-1/macros/Hardware/RasberryPi/Soft/lib b/2.3-1/macros/Hardware/RasberryPi/Soft/lib Binary files differnew file mode 100644 index 00000000..09ecede9 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/Soft/lib diff --git a/2.3-1/macros/Hardware/RasberryPi/Timing/lib b/2.3-1/macros/Hardware/RasberryPi/Timing/lib Binary files differnew file mode 100644 index 00000000..d271c900 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/Timing/lib diff --git a/2.3-1/macros/Hardware/RasberryPi/gertBoard/lib b/2.3-1/macros/Hardware/RasberryPi/gertBoard/lib Binary files differnew file mode 100644 index 00000000..e8db080c --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/gertBoard/lib diff --git a/2.3-1/macros/Hardware/RasberryPi/lcd/lib b/2.3-1/macros/Hardware/RasberryPi/lcd/lib Binary files differnew file mode 100644 index 00000000..c2b693fa --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/lcd/lib diff --git a/2.3-1/macros/Hardware/RasberryPi/lcd128x64/lib b/2.3-1/macros/Hardware/RasberryPi/lcd128x64/lib Binary files differnew file mode 100644 index 00000000..94dfda86 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/lcd128x64/lib diff --git a/2.3-1/macros/Hardware/RasberryPi/lib b/2.3-1/macros/Hardware/RasberryPi/lib Binary files differnew file mode 100644 index 00000000..49ed8116 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/lib diff --git a/2.3-1/macros/Hardware/RasberryPi/mcp/lib b/2.3-1/macros/Hardware/RasberryPi/mcp/lib Binary files differnew file mode 100644 index 00000000..d411aad8 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/mcp/lib diff --git a/2.3-1/macros/Hardware/RasberryPi/pcf/lib b/2.3-1/macros/Hardware/RasberryPi/pcf/lib Binary files differnew file mode 100644 index 00000000..da6a8dad --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/pcf/lib diff --git a/2.3-1/macros/Hardware/RasberryPi/piGlow/lib b/2.3-1/macros/Hardware/RasberryPi/piGlow/lib Binary files differnew file mode 100644 index 00000000..3f30f859 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/piGlow/lib diff --git a/2.3-1/macros/Hardware/RasberryPi/pinMap/lib b/2.3-1/macros/Hardware/RasberryPi/pinMap/lib Binary files differnew file mode 100644 index 00000000..133363e6 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/pinMap/lib diff --git a/2.3-1/macros/Hardware/RasberryPi/pwm/lib b/2.3-1/macros/Hardware/RasberryPi/pwm/lib Binary files differnew file mode 100644 index 00000000..8711baf0 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/pwm/lib diff --git a/2.3-1/macros/ImageProcessing/core/lib b/2.3-1/macros/ImageProcessing/core/lib Binary files differnew file mode 100644 index 00000000..40b7b0a1 --- /dev/null +++ b/2.3-1/macros/ImageProcessing/core/lib diff --git a/2.3-1/macros/ImageProcessing/highgui/lib b/2.3-1/macros/ImageProcessing/highgui/lib Binary files differnew file mode 100644 index 00000000..0d7f88a9 --- /dev/null +++ b/2.3-1/macros/ImageProcessing/highgui/lib diff --git a/2.3-1/macros/ImageProcessing/imgproc/lib b/2.3-1/macros/ImageProcessing/imgproc/lib Binary files differnew file mode 100644 index 00000000..63b5e7e9 --- /dev/null +++ b/2.3-1/macros/ImageProcessing/imgproc/lib diff --git a/2.3-1/macros/Scilab-Arduino/lib b/2.3-1/macros/Scilab-Arduino/lib Binary files differnew file mode 100644 index 00000000..a62fd4e4 --- /dev/null +++ b/2.3-1/macros/Scilab-Arduino/lib diff --git a/2.3-1/macros/SymbolTable/lib b/2.3-1/macros/SymbolTable/lib Binary files differnew file mode 100644 index 00000000..4379c83d --- /dev/null +++ b/2.3-1/macros/SymbolTable/lib diff --git a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index ff5afb5e..617f6893 100644 --- a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -1183,6 +1183,41 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,Ex // -------------------
+// --- 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. ---
// -------------------
ClassName = 'Nanmin';
diff --git a/2.3-1/macros/ToolInitialization/lib b/2.3-1/macros/ToolInitialization/lib Binary files differnew file mode 100644 index 00000000..670a52e0 --- /dev/null +++ b/2.3-1/macros/ToolInitialization/lib diff --git a/2.3-1/macros/findDeps/getAllHeaders.sci b/2.3-1/macros/findDeps/getAllHeaders.sci index 6f417eca..d33bf16b 100644 --- a/2.3-1/macros/findDeps/getAllHeaders.sci +++ b/2.3-1/macros/findDeps/getAllHeaders.sci @@ -164,6 +164,7 @@ function allHeaders = getAllHeaders(SharedInfo) "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" diff --git a/2.3-1/macros/findDeps/getAllInterfaces.sci b/2.3-1/macros/findDeps/getAllInterfaces.sci index 9d44df90..967051d6 100644 --- a/2.3-1/macros/findDeps/getAllInterfaces.sci +++ b/2.3-1/macros/findDeps/getAllInterfaces.sci @@ -152,6 +152,7 @@ function allInterfaces = getAllInterfaces(SharedInfo) "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" diff --git a/2.3-1/macros/findDeps/getAllSources.sci b/2.3-1/macros/findDeps/getAllSources.sci index c3fd3a5f..34f9dd3a 100644 --- a/2.3-1/macros/findDeps/getAllSources.sci +++ b/2.3-1/macros/findDeps/getAllSources.sci @@ -1100,6 +1100,9 @@ function allSources = getAllSources(SharedInfo,BuildTool) "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" diff --git a/2.3-1/macros/findDeps/lib b/2.3-1/macros/findDeps/lib Binary files differnew file mode 100644 index 00000000..afcd3cab --- /dev/null +++ b/2.3-1/macros/findDeps/lib diff --git a/2.3-1/macros/lib b/2.3-1/macros/lib Binary files differnew file mode 100644 index 00000000..551263ea --- /dev/null +++ b/2.3-1/macros/lib 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/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/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__*/ |