summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrijeshcr2017-08-04 21:40:41 +0530
committerBrijeshcr2017-08-04 21:40:41 +0530
commitad787796e65e1debe25871a98f9713f23d655ae4 (patch)
tree366cdd52cae4308686b47a5f30894f591155c2ef
parent49dd0d9d013d80ad685a3c32b6f0a2f97349e710 (diff)
downloadScilab2C_fossee_old-ad787796e65e1debe25871a98f9713f23d655ae4.tar.gz
Scilab2C_fossee_old-ad787796e65e1debe25871a98f9713f23d655ae4.tar.bz2
Scilab2C_fossee_old-ad787796e65e1debe25871a98f9713f23d655ae4.zip
Added Covar
-rw-r--r--demos/Brijesh_Demos/test_covar.sci20
-rw-r--r--includes/sci2clib.h3
-rw-r--r--jar/scilab_en_US_help.jarbin18035 -> 11210 bytes
-rw-r--r--macros/ASTManagement/libbin0 -> 2008 bytes
-rw-r--r--macros/CCodeGeneration/libbin0 -> 1056 bytes
-rw-r--r--macros/ErrorMessages/libbin0 -> 520 bytes
-rw-r--r--macros/FunctionAnnotation/libbin0 -> 2412 bytes
-rw-r--r--macros/FunctionList/libbin0 -> 588 bytes
-rw-r--r--macros/GeneralFunctions/libbin0 -> 1132 bytes
-rw-r--r--macros/Hardware/AVR/libbin0 -> 972 bytes
-rw-r--r--macros/Hardware/RasberryPi/Digital/libbin0 -> 600 bytes
-rw-r--r--macros/Hardware/RasberryPi/I2C/libbin0 -> 704 bytes
-rw-r--r--macros/Hardware/RasberryPi/Interrupt/libbin0 -> 536 bytes
-rw-r--r--macros/Hardware/RasberryPi/Misc/libbin0 -> 564 bytes
-rw-r--r--macros/Hardware/RasberryPi/SPI/libbin0 -> 584 bytes
-rw-r--r--macros/Hardware/RasberryPi/Serial/libbin0 -> 692 bytes
-rw-r--r--macros/Hardware/RasberryPi/Setup/libbin0 -> 616 bytes
-rw-r--r--macros/Hardware/RasberryPi/Shift/libbin0 -> 568 bytes
-rw-r--r--macros/Hardware/RasberryPi/Soft/libbin0 -> 636 bytes
-rw-r--r--macros/Hardware/RasberryPi/Timing/libbin0 -> 596 bytes
-rw-r--r--macros/Hardware/RasberryPi/gertBoard/libbin0 -> 656 bytes
-rw-r--r--macros/Hardware/RasberryPi/lcd/libbin0 -> 776 bytes
-rw-r--r--macros/Hardware/RasberryPi/lcd128x64/libbin0 -> 800 bytes
-rw-r--r--macros/Hardware/RasberryPi/libbin0 -> 592 bytes
-rw-r--r--macros/Hardware/RasberryPi/mcp/libbin0 -> 608 bytes
-rw-r--r--macros/Hardware/RasberryPi/pcf/libbin0 -> 536 bytes
-rw-r--r--macros/Hardware/RasberryPi/piGlow/libbin0 -> 596 bytes
-rw-r--r--macros/Hardware/RasberryPi/pinMap/libbin0 -> 548 bytes
-rw-r--r--macros/Hardware/RasberryPi/pwm/libbin0 -> 608 bytes
-rw-r--r--macros/ImageProcessing/core/libbin0 -> 524 bytes
-rw-r--r--macros/ImageProcessing/highgui/libbin0 -> 584 bytes
-rw-r--r--macros/ImageProcessing/imgproc/libbin0 -> 752 bytes
-rw-r--r--macros/Scilab-Arduino/libbin0 -> 716 bytes
-rw-r--r--macros/SymbolTable/libbin0 -> 752 bytes
-rw-r--r--macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci35
-rw-r--r--macros/ToolInitialization/libbin0 -> 804 bytes
-rw-r--r--macros/findDeps/getAllHeaders.sci1
-rw-r--r--macros/findDeps/getAllInterfaces.sci1
-rw-r--r--macros/findDeps/getAllSources.sci3
-rw-r--r--macros/findDeps/libbin0 -> 620 bytes
-rw-r--r--macros/libbin0 -> 536 bytes
-rw-r--r--src/c/statisticsFunctions/covar/dcovars.c70
-rw-r--r--src/c/statisticsFunctions/covar/scovars.c70
-rw-r--r--src/c/statisticsFunctions/covar/zcovars.c71
-rw-r--r--src/c/statisticsFunctions/includes/covar.h43
-rw-r--r--src/c/statisticsFunctions/interfaces/int_covar.h29
46 files changed, 346 insertions, 0 deletions
diff --git a/demos/Brijesh_Demos/test_covar.sci b/demos/Brijesh_Demos/test_covar.sci
new file mode 100644
index 0000000..b182532
--- /dev/null
+++ b/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/includes/sci2clib.h b/includes/sci2clib.h
index d7964b5..9a252ee 100644
--- a/includes/sci2clib.h
+++ b/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/jar/scilab_en_US_help.jar b/jar/scilab_en_US_help.jar
index aeb5ddf..45d24f1 100644
--- a/jar/scilab_en_US_help.jar
+++ b/jar/scilab_en_US_help.jar
Binary files differ
diff --git a/macros/ASTManagement/lib b/macros/ASTManagement/lib
new file mode 100644
index 0000000..dee4362
--- /dev/null
+++ b/macros/ASTManagement/lib
Binary files differ
diff --git a/macros/CCodeGeneration/lib b/macros/CCodeGeneration/lib
new file mode 100644
index 0000000..3d4fed1
--- /dev/null
+++ b/macros/CCodeGeneration/lib
Binary files differ
diff --git a/macros/ErrorMessages/lib b/macros/ErrorMessages/lib
new file mode 100644
index 0000000..ba3b9a5
--- /dev/null
+++ b/macros/ErrorMessages/lib
Binary files differ
diff --git a/macros/FunctionAnnotation/lib b/macros/FunctionAnnotation/lib
new file mode 100644
index 0000000..239105c
--- /dev/null
+++ b/macros/FunctionAnnotation/lib
Binary files differ
diff --git a/macros/FunctionList/lib b/macros/FunctionList/lib
new file mode 100644
index 0000000..1c722dd
--- /dev/null
+++ b/macros/FunctionList/lib
Binary files differ
diff --git a/macros/GeneralFunctions/lib b/macros/GeneralFunctions/lib
new file mode 100644
index 0000000..7586a91
--- /dev/null
+++ b/macros/GeneralFunctions/lib
Binary files differ
diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib
new file mode 100644
index 0000000..ed4c52b
--- /dev/null
+++ b/macros/Hardware/AVR/lib
Binary files differ
diff --git a/macros/Hardware/RasberryPi/Digital/lib b/macros/Hardware/RasberryPi/Digital/lib
new file mode 100644
index 0000000..ba42ba7
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Digital/lib
Binary files differ
diff --git a/macros/Hardware/RasberryPi/I2C/lib b/macros/Hardware/RasberryPi/I2C/lib
new file mode 100644
index 0000000..561476c
--- /dev/null
+++ b/macros/Hardware/RasberryPi/I2C/lib
Binary files differ
diff --git a/macros/Hardware/RasberryPi/Interrupt/lib b/macros/Hardware/RasberryPi/Interrupt/lib
new file mode 100644
index 0000000..97a61ac
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Interrupt/lib
Binary files differ
diff --git a/macros/Hardware/RasberryPi/Misc/lib b/macros/Hardware/RasberryPi/Misc/lib
new file mode 100644
index 0000000..c718615
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Misc/lib
Binary files differ
diff --git a/macros/Hardware/RasberryPi/SPI/lib b/macros/Hardware/RasberryPi/SPI/lib
new file mode 100644
index 0000000..a16d474
--- /dev/null
+++ b/macros/Hardware/RasberryPi/SPI/lib
Binary files differ
diff --git a/macros/Hardware/RasberryPi/Serial/lib b/macros/Hardware/RasberryPi/Serial/lib
new file mode 100644
index 0000000..a007f00
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Serial/lib
Binary files differ
diff --git a/macros/Hardware/RasberryPi/Setup/lib b/macros/Hardware/RasberryPi/Setup/lib
new file mode 100644
index 0000000..83655c9
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Setup/lib
Binary files differ
diff --git a/macros/Hardware/RasberryPi/Shift/lib b/macros/Hardware/RasberryPi/Shift/lib
new file mode 100644
index 0000000..2b12025
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Shift/lib
Binary files differ
diff --git a/macros/Hardware/RasberryPi/Soft/lib b/macros/Hardware/RasberryPi/Soft/lib
new file mode 100644
index 0000000..09ecede
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Soft/lib
Binary files differ
diff --git a/macros/Hardware/RasberryPi/Timing/lib b/macros/Hardware/RasberryPi/Timing/lib
new file mode 100644
index 0000000..d271c90
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Timing/lib
Binary files differ
diff --git a/macros/Hardware/RasberryPi/gertBoard/lib b/macros/Hardware/RasberryPi/gertBoard/lib
new file mode 100644
index 0000000..e8db080
--- /dev/null
+++ b/macros/Hardware/RasberryPi/gertBoard/lib
Binary files differ
diff --git a/macros/Hardware/RasberryPi/lcd/lib b/macros/Hardware/RasberryPi/lcd/lib
new file mode 100644
index 0000000..c2b693f
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/lib
Binary files differ
diff --git a/macros/Hardware/RasberryPi/lcd128x64/lib b/macros/Hardware/RasberryPi/lcd128x64/lib
new file mode 100644
index 0000000..94dfda8
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/lib
Binary files differ
diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib
new file mode 100644
index 0000000..49ed811
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lib
Binary files differ
diff --git a/macros/Hardware/RasberryPi/mcp/lib b/macros/Hardware/RasberryPi/mcp/lib
new file mode 100644
index 0000000..d411aad
--- /dev/null
+++ b/macros/Hardware/RasberryPi/mcp/lib
Binary files differ
diff --git a/macros/Hardware/RasberryPi/pcf/lib b/macros/Hardware/RasberryPi/pcf/lib
new file mode 100644
index 0000000..da6a8da
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pcf/lib
Binary files differ
diff --git a/macros/Hardware/RasberryPi/piGlow/lib b/macros/Hardware/RasberryPi/piGlow/lib
new file mode 100644
index 0000000..3f30f85
--- /dev/null
+++ b/macros/Hardware/RasberryPi/piGlow/lib
Binary files differ
diff --git a/macros/Hardware/RasberryPi/pinMap/lib b/macros/Hardware/RasberryPi/pinMap/lib
new file mode 100644
index 0000000..133363e
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pinMap/lib
Binary files differ
diff --git a/macros/Hardware/RasberryPi/pwm/lib b/macros/Hardware/RasberryPi/pwm/lib
new file mode 100644
index 0000000..8711baf
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pwm/lib
Binary files differ
diff --git a/macros/ImageProcessing/core/lib b/macros/ImageProcessing/core/lib
new file mode 100644
index 0000000..40b7b0a
--- /dev/null
+++ b/macros/ImageProcessing/core/lib
Binary files differ
diff --git a/macros/ImageProcessing/highgui/lib b/macros/ImageProcessing/highgui/lib
new file mode 100644
index 0000000..0d7f88a
--- /dev/null
+++ b/macros/ImageProcessing/highgui/lib
Binary files differ
diff --git a/macros/ImageProcessing/imgproc/lib b/macros/ImageProcessing/imgproc/lib
new file mode 100644
index 0000000..63b5e7e
--- /dev/null
+++ b/macros/ImageProcessing/imgproc/lib
Binary files differ
diff --git a/macros/Scilab-Arduino/lib b/macros/Scilab-Arduino/lib
new file mode 100644
index 0000000..a62fd4e
--- /dev/null
+++ b/macros/Scilab-Arduino/lib
Binary files differ
diff --git a/macros/SymbolTable/lib b/macros/SymbolTable/lib
new file mode 100644
index 0000000..4379c83
--- /dev/null
+++ b/macros/SymbolTable/lib
Binary files differ
diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
index ff5afb5..617f689 100644
--- a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
+++ b/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/macros/ToolInitialization/lib b/macros/ToolInitialization/lib
new file mode 100644
index 0000000..670a52e
--- /dev/null
+++ b/macros/ToolInitialization/lib
Binary files differ
diff --git a/macros/findDeps/getAllHeaders.sci b/macros/findDeps/getAllHeaders.sci
index 6f417ec..d33bf16 100644
--- a/macros/findDeps/getAllHeaders.sci
+++ b/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/macros/findDeps/getAllInterfaces.sci b/macros/findDeps/getAllInterfaces.sci
index 9d44df9..967051d 100644
--- a/macros/findDeps/getAllInterfaces.sci
+++ b/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/macros/findDeps/getAllSources.sci b/macros/findDeps/getAllSources.sci
index c3fd3a5..34f9dd3 100644
--- a/macros/findDeps/getAllSources.sci
+++ b/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/macros/findDeps/lib b/macros/findDeps/lib
new file mode 100644
index 0000000..afcd3ca
--- /dev/null
+++ b/macros/findDeps/lib
Binary files differ
diff --git a/macros/lib b/macros/lib
new file mode 100644
index 0000000..551263e
--- /dev/null
+++ b/macros/lib
Binary files differ
diff --git a/src/c/statisticsFunctions/covar/dcovars.c b/src/c/statisticsFunctions/covar/dcovars.c
new file mode 100644
index 0000000..f67905e
--- /dev/null
+++ b/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/src/c/statisticsFunctions/covar/scovars.c b/src/c/statisticsFunctions/covar/scovars.c
new file mode 100644
index 0000000..daff6b9
--- /dev/null
+++ b/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/src/c/statisticsFunctions/covar/zcovars.c b/src/c/statisticsFunctions/covar/zcovars.c
new file mode 100644
index 0000000..6adbd3c
--- /dev/null
+++ b/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/src/c/statisticsFunctions/includes/covar.h b/src/c/statisticsFunctions/includes/covar.h
new file mode 100644
index 0000000..4f37f85
--- /dev/null
+++ b/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/src/c/statisticsFunctions/interfaces/int_covar.h b/src/c/statisticsFunctions/interfaces/int_covar.h
new file mode 100644
index 0000000..5ebef22
--- /dev/null
+++ b/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__*/