From 08907f873ad769a7f2326d15c9a20a84bcef5008 Mon Sep 17 00:00:00 2001 From: Brijeshcr Date: Tue, 1 Aug 2017 16:18:48 +0530 Subject: Added Moment --- 2.3-1/demos/Brijesh_Demos/test_moment.sci | 14 +++++++ 2.3-1/includes/sci2clib.h | 3 ++ 2.3-1/jar/scilab_en_US_help.jar | Bin 18123 -> 11210 bytes 2.3-1/macros/ASTManagement/lib | Bin 0 -> 2008 bytes 2.3-1/macros/CCodeGeneration/lib | Bin 0 -> 1056 bytes 2.3-1/macros/ErrorMessages/lib | Bin 0 -> 520 bytes 2.3-1/macros/FunctionAnnotation/lib | Bin 0 -> 2412 bytes 2.3-1/macros/FunctionList/lib | Bin 0 -> 588 bytes 2.3-1/macros/GeneralFunctions/lib | Bin 0 -> 1132 bytes 2.3-1/macros/Hardware/AVR/lib | Bin 0 -> 972 bytes 2.3-1/macros/Hardware/RasberryPi/Digital/lib | Bin 0 -> 600 bytes 2.3-1/macros/Hardware/RasberryPi/I2C/lib | Bin 0 -> 704 bytes 2.3-1/macros/Hardware/RasberryPi/Interrupt/lib | Bin 0 -> 536 bytes 2.3-1/macros/Hardware/RasberryPi/Misc/lib | Bin 0 -> 564 bytes 2.3-1/macros/Hardware/RasberryPi/SPI/lib | Bin 0 -> 584 bytes 2.3-1/macros/Hardware/RasberryPi/Serial/lib | Bin 0 -> 692 bytes 2.3-1/macros/Hardware/RasberryPi/Setup/lib | Bin 0 -> 616 bytes 2.3-1/macros/Hardware/RasberryPi/Shift/lib | Bin 0 -> 568 bytes 2.3-1/macros/Hardware/RasberryPi/Soft/lib | Bin 0 -> 636 bytes 2.3-1/macros/Hardware/RasberryPi/Timing/lib | Bin 0 -> 596 bytes 2.3-1/macros/Hardware/RasberryPi/gertBoard/lib | Bin 0 -> 656 bytes 2.3-1/macros/Hardware/RasberryPi/lcd/lib | Bin 0 -> 776 bytes 2.3-1/macros/Hardware/RasberryPi/lcd128x64/lib | Bin 0 -> 800 bytes 2.3-1/macros/Hardware/RasberryPi/lib | Bin 0 -> 592 bytes 2.3-1/macros/Hardware/RasberryPi/mcp/lib | Bin 0 -> 608 bytes 2.3-1/macros/Hardware/RasberryPi/pcf/lib | Bin 0 -> 536 bytes 2.3-1/macros/Hardware/RasberryPi/piGlow/lib | Bin 0 -> 596 bytes 2.3-1/macros/Hardware/RasberryPi/pinMap/lib | Bin 0 -> 548 bytes 2.3-1/macros/Hardware/RasberryPi/pwm/lib | Bin 0 -> 608 bytes 2.3-1/macros/ImageProcessing/core/lib | Bin 0 -> 524 bytes 2.3-1/macros/ImageProcessing/highgui/lib | Bin 0 -> 584 bytes 2.3-1/macros/ImageProcessing/imgproc/lib | Bin 0 -> 752 bytes 2.3-1/macros/Scilab-Arduino/lib | Bin 0 -> 716 bytes 2.3-1/macros/SymbolTable/lib | Bin 0 -> 752 bytes .../ToolInitialization/INIT_FillSCI2LibCDirs.sci | 40 ++++++++++++++++++++ 2.3-1/macros/ToolInitialization/lib | Bin 0 -> 804 bytes 2.3-1/macros/findDeps/getAllHeaders.sci | 1 + 2.3-1/macros/findDeps/getAllInterfaces.sci | 1 + 2.3-1/macros/findDeps/getAllSources.sci | 9 +++++ 2.3-1/macros/findDeps/lib | Bin 0 -> 620 bytes 2.3-1/macros/lib | Bin 0 -> 536 bytes 2.3-1/src/c/statisticsFunctions/includes/moment.h | 42 +++++++++++++++++++++ .../c/statisticsFunctions/interfaces/int_moment.h | 33 ++++++++++++++++ .../src/c/statisticsFunctions/moment/dmomentcola.c | 18 +++++++++ .../src/c/statisticsFunctions/moment/dmomentrowa.c | 18 +++++++++ 2.3-1/src/c/statisticsFunctions/moment/dmoments.c | 17 +++++++++ .../src/c/statisticsFunctions/moment/smomentcola.c | 18 +++++++++ .../src/c/statisticsFunctions/moment/smomentrowa.c | 18 +++++++++ 2.3-1/src/c/statisticsFunctions/moment/smoments.c | 17 +++++++++ .../src/c/statisticsFunctions/moment/zmomentcola.c | 20 ++++++++++ .../src/c/statisticsFunctions/moment/zmomentrowa.c | 20 ++++++++++ 2.3-1/src/c/statisticsFunctions/moment/zmoments.c | 22 +++++++++++ 52 files changed, 311 insertions(+) create mode 100644 2.3-1/demos/Brijesh_Demos/test_moment.sci create mode 100644 2.3-1/macros/ASTManagement/lib create mode 100644 2.3-1/macros/CCodeGeneration/lib create mode 100644 2.3-1/macros/ErrorMessages/lib create mode 100644 2.3-1/macros/FunctionAnnotation/lib create mode 100644 2.3-1/macros/FunctionList/lib create mode 100644 2.3-1/macros/GeneralFunctions/lib create mode 100644 2.3-1/macros/Hardware/AVR/lib create mode 100644 2.3-1/macros/Hardware/RasberryPi/Digital/lib create mode 100644 2.3-1/macros/Hardware/RasberryPi/I2C/lib create mode 100644 2.3-1/macros/Hardware/RasberryPi/Interrupt/lib create mode 100644 2.3-1/macros/Hardware/RasberryPi/Misc/lib create mode 100644 2.3-1/macros/Hardware/RasberryPi/SPI/lib create mode 100644 2.3-1/macros/Hardware/RasberryPi/Serial/lib create mode 100644 2.3-1/macros/Hardware/RasberryPi/Setup/lib create mode 100644 2.3-1/macros/Hardware/RasberryPi/Shift/lib create mode 100644 2.3-1/macros/Hardware/RasberryPi/Soft/lib create mode 100644 2.3-1/macros/Hardware/RasberryPi/Timing/lib create mode 100644 2.3-1/macros/Hardware/RasberryPi/gertBoard/lib create mode 100644 2.3-1/macros/Hardware/RasberryPi/lcd/lib create mode 100644 2.3-1/macros/Hardware/RasberryPi/lcd128x64/lib create mode 100644 2.3-1/macros/Hardware/RasberryPi/lib create mode 100644 2.3-1/macros/Hardware/RasberryPi/mcp/lib create mode 100644 2.3-1/macros/Hardware/RasberryPi/pcf/lib create mode 100644 2.3-1/macros/Hardware/RasberryPi/piGlow/lib create mode 100644 2.3-1/macros/Hardware/RasberryPi/pinMap/lib create mode 100644 2.3-1/macros/Hardware/RasberryPi/pwm/lib create mode 100644 2.3-1/macros/ImageProcessing/core/lib create mode 100644 2.3-1/macros/ImageProcessing/highgui/lib create mode 100644 2.3-1/macros/ImageProcessing/imgproc/lib create mode 100644 2.3-1/macros/Scilab-Arduino/lib create mode 100644 2.3-1/macros/SymbolTable/lib create mode 100644 2.3-1/macros/ToolInitialization/lib create mode 100644 2.3-1/macros/findDeps/lib create mode 100644 2.3-1/macros/lib create mode 100644 2.3-1/src/c/statisticsFunctions/includes/moment.h create mode 100644 2.3-1/src/c/statisticsFunctions/interfaces/int_moment.h create mode 100644 2.3-1/src/c/statisticsFunctions/moment/dmomentcola.c create mode 100644 2.3-1/src/c/statisticsFunctions/moment/dmomentrowa.c create mode 100644 2.3-1/src/c/statisticsFunctions/moment/dmoments.c create mode 100644 2.3-1/src/c/statisticsFunctions/moment/smomentcola.c create mode 100644 2.3-1/src/c/statisticsFunctions/moment/smomentrowa.c create mode 100644 2.3-1/src/c/statisticsFunctions/moment/smoments.c create mode 100644 2.3-1/src/c/statisticsFunctions/moment/zmomentcola.c create mode 100644 2.3-1/src/c/statisticsFunctions/moment/zmomentrowa.c create mode 100644 2.3-1/src/c/statisticsFunctions/moment/zmoments.c (limited to '2.3-1') diff --git a/2.3-1/demos/Brijesh_Demos/test_moment.sci b/2.3-1/demos/Brijesh_Demos/test_moment.sci new file mode 100644 index 00000000..35e0d7aa --- /dev/null +++ b/2.3-1/demos/Brijesh_Demos/test_moment.sci @@ -0,0 +1,14 @@ +function test_moment + disp('Datatype: Double'); + i1 = [1 2 3; 4 5 6]; + o1 = moment(i1,1,'r'); + disp(o1); + disp('Datatype: float'); + i2 = float([1 2 3; 4 5 6]); + o2 = moment(i2,1,'r'); + disp(o2); + disp('Datatype: Double Complex'); + i3 = [0 %i 3+4*%i;%i 5+%i 6+%i]; + o3 = moment(i3,1,'r'); + disp(o3); +endfunction diff --git a/2.3-1/includes/sci2clib.h b/2.3-1/includes/sci2clib.h index 5f94371e..40fa5799 100644 --- a/2.3-1/includes/sci2clib.h +++ b/2.3-1/includes/sci2clib.h @@ -632,6 +632,9 @@ extern "C" { /* interfacing median */ #include "median.h" #include "int_median.h" +/* interfacing moment */ +#include "moment.h" +#include "int_moment.h" /* interfacing nanmedian */ #include "nanmedian.h" #include "int_nanmedian.h" diff --git a/2.3-1/jar/scilab_en_US_help.jar b/2.3-1/jar/scilab_en_US_help.jar index 5194f999..93393a06 100644 Binary files a/2.3-1/jar/scilab_en_US_help.jar and b/2.3-1/jar/scilab_en_US_help.jar differ diff --git a/2.3-1/macros/ASTManagement/lib b/2.3-1/macros/ASTManagement/lib new file mode 100644 index 00000000..dee4362f Binary files /dev/null and b/2.3-1/macros/ASTManagement/lib differ diff --git a/2.3-1/macros/CCodeGeneration/lib b/2.3-1/macros/CCodeGeneration/lib new file mode 100644 index 00000000..3d4fed1d Binary files /dev/null and b/2.3-1/macros/CCodeGeneration/lib differ diff --git a/2.3-1/macros/ErrorMessages/lib b/2.3-1/macros/ErrorMessages/lib new file mode 100644 index 00000000..ba3b9a5a Binary files /dev/null and b/2.3-1/macros/ErrorMessages/lib differ diff --git a/2.3-1/macros/FunctionAnnotation/lib b/2.3-1/macros/FunctionAnnotation/lib new file mode 100644 index 00000000..239105c8 Binary files /dev/null and b/2.3-1/macros/FunctionAnnotation/lib differ diff --git a/2.3-1/macros/FunctionList/lib b/2.3-1/macros/FunctionList/lib new file mode 100644 index 00000000..1c722dd0 Binary files /dev/null and b/2.3-1/macros/FunctionList/lib differ diff --git a/2.3-1/macros/GeneralFunctions/lib b/2.3-1/macros/GeneralFunctions/lib new file mode 100644 index 00000000..7586a91b Binary files /dev/null and b/2.3-1/macros/GeneralFunctions/lib differ diff --git a/2.3-1/macros/Hardware/AVR/lib b/2.3-1/macros/Hardware/AVR/lib new file mode 100644 index 00000000..ed4c52b8 Binary files /dev/null and b/2.3-1/macros/Hardware/AVR/lib differ diff --git a/2.3-1/macros/Hardware/RasberryPi/Digital/lib b/2.3-1/macros/Hardware/RasberryPi/Digital/lib new file mode 100644 index 00000000..ba42ba7c Binary files /dev/null and b/2.3-1/macros/Hardware/RasberryPi/Digital/lib differ diff --git a/2.3-1/macros/Hardware/RasberryPi/I2C/lib b/2.3-1/macros/Hardware/RasberryPi/I2C/lib new file mode 100644 index 00000000..561476c1 Binary files /dev/null and b/2.3-1/macros/Hardware/RasberryPi/I2C/lib differ diff --git a/2.3-1/macros/Hardware/RasberryPi/Interrupt/lib b/2.3-1/macros/Hardware/RasberryPi/Interrupt/lib new file mode 100644 index 00000000..97a61acb Binary files /dev/null and b/2.3-1/macros/Hardware/RasberryPi/Interrupt/lib differ diff --git a/2.3-1/macros/Hardware/RasberryPi/Misc/lib b/2.3-1/macros/Hardware/RasberryPi/Misc/lib new file mode 100644 index 00000000..c718615f Binary files /dev/null and b/2.3-1/macros/Hardware/RasberryPi/Misc/lib differ diff --git a/2.3-1/macros/Hardware/RasberryPi/SPI/lib b/2.3-1/macros/Hardware/RasberryPi/SPI/lib new file mode 100644 index 00000000..a16d474e Binary files /dev/null and b/2.3-1/macros/Hardware/RasberryPi/SPI/lib differ diff --git a/2.3-1/macros/Hardware/RasberryPi/Serial/lib b/2.3-1/macros/Hardware/RasberryPi/Serial/lib new file mode 100644 index 00000000..a007f001 Binary files /dev/null and b/2.3-1/macros/Hardware/RasberryPi/Serial/lib differ diff --git a/2.3-1/macros/Hardware/RasberryPi/Setup/lib b/2.3-1/macros/Hardware/RasberryPi/Setup/lib new file mode 100644 index 00000000..83655c94 Binary files /dev/null and b/2.3-1/macros/Hardware/RasberryPi/Setup/lib differ diff --git a/2.3-1/macros/Hardware/RasberryPi/Shift/lib b/2.3-1/macros/Hardware/RasberryPi/Shift/lib new file mode 100644 index 00000000..2b12025f Binary files /dev/null and b/2.3-1/macros/Hardware/RasberryPi/Shift/lib differ diff --git a/2.3-1/macros/Hardware/RasberryPi/Soft/lib b/2.3-1/macros/Hardware/RasberryPi/Soft/lib new file mode 100644 index 00000000..09ecede9 Binary files /dev/null and b/2.3-1/macros/Hardware/RasberryPi/Soft/lib differ diff --git a/2.3-1/macros/Hardware/RasberryPi/Timing/lib b/2.3-1/macros/Hardware/RasberryPi/Timing/lib new file mode 100644 index 00000000..d271c900 Binary files /dev/null and b/2.3-1/macros/Hardware/RasberryPi/Timing/lib differ diff --git a/2.3-1/macros/Hardware/RasberryPi/gertBoard/lib b/2.3-1/macros/Hardware/RasberryPi/gertBoard/lib new file mode 100644 index 00000000..e8db080c Binary files /dev/null and b/2.3-1/macros/Hardware/RasberryPi/gertBoard/lib differ diff --git a/2.3-1/macros/Hardware/RasberryPi/lcd/lib b/2.3-1/macros/Hardware/RasberryPi/lcd/lib new file mode 100644 index 00000000..c2b693fa Binary files /dev/null and b/2.3-1/macros/Hardware/RasberryPi/lcd/lib differ diff --git a/2.3-1/macros/Hardware/RasberryPi/lcd128x64/lib b/2.3-1/macros/Hardware/RasberryPi/lcd128x64/lib new file mode 100644 index 00000000..94dfda86 Binary files /dev/null and b/2.3-1/macros/Hardware/RasberryPi/lcd128x64/lib differ diff --git a/2.3-1/macros/Hardware/RasberryPi/lib b/2.3-1/macros/Hardware/RasberryPi/lib new file mode 100644 index 00000000..49ed8116 Binary files /dev/null and b/2.3-1/macros/Hardware/RasberryPi/lib differ diff --git a/2.3-1/macros/Hardware/RasberryPi/mcp/lib b/2.3-1/macros/Hardware/RasberryPi/mcp/lib new file mode 100644 index 00000000..d411aad8 Binary files /dev/null and b/2.3-1/macros/Hardware/RasberryPi/mcp/lib differ diff --git a/2.3-1/macros/Hardware/RasberryPi/pcf/lib b/2.3-1/macros/Hardware/RasberryPi/pcf/lib new file mode 100644 index 00000000..da6a8dad Binary files /dev/null and b/2.3-1/macros/Hardware/RasberryPi/pcf/lib differ diff --git a/2.3-1/macros/Hardware/RasberryPi/piGlow/lib b/2.3-1/macros/Hardware/RasberryPi/piGlow/lib new file mode 100644 index 00000000..3f30f859 Binary files /dev/null and b/2.3-1/macros/Hardware/RasberryPi/piGlow/lib differ diff --git a/2.3-1/macros/Hardware/RasberryPi/pinMap/lib b/2.3-1/macros/Hardware/RasberryPi/pinMap/lib new file mode 100644 index 00000000..133363e6 Binary files /dev/null and b/2.3-1/macros/Hardware/RasberryPi/pinMap/lib differ diff --git a/2.3-1/macros/Hardware/RasberryPi/pwm/lib b/2.3-1/macros/Hardware/RasberryPi/pwm/lib new file mode 100644 index 00000000..8711baf0 Binary files /dev/null and b/2.3-1/macros/Hardware/RasberryPi/pwm/lib differ diff --git a/2.3-1/macros/ImageProcessing/core/lib b/2.3-1/macros/ImageProcessing/core/lib new file mode 100644 index 00000000..40b7b0a1 Binary files /dev/null and b/2.3-1/macros/ImageProcessing/core/lib differ diff --git a/2.3-1/macros/ImageProcessing/highgui/lib b/2.3-1/macros/ImageProcessing/highgui/lib new file mode 100644 index 00000000..0d7f88a9 Binary files /dev/null and b/2.3-1/macros/ImageProcessing/highgui/lib differ diff --git a/2.3-1/macros/ImageProcessing/imgproc/lib b/2.3-1/macros/ImageProcessing/imgproc/lib new file mode 100644 index 00000000..63b5e7e9 Binary files /dev/null and b/2.3-1/macros/ImageProcessing/imgproc/lib differ diff --git a/2.3-1/macros/Scilab-Arduino/lib b/2.3-1/macros/Scilab-Arduino/lib new file mode 100644 index 00000000..a62fd4e4 Binary files /dev/null and b/2.3-1/macros/Scilab-Arduino/lib differ diff --git a/2.3-1/macros/SymbolTable/lib b/2.3-1/macros/SymbolTable/lib new file mode 100644 index 00000000..4379c83d Binary files /dev/null and b/2.3-1/macros/SymbolTable/lib differ diff --git a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index 2ca622fe..872a7507 100644 --- a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -1014,6 +1014,46 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,E INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun); +// ------------------- +// --- Class MOMENT. --- +// ------------------- +ClassName = 'moment'; + +// --- 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)= FA_SZ_SEL1(IN(1).SZ(1),IN(3).VAL)',ClassFileName,'file','y'); +PrintStringInfo('OUT(1).SZ(2)= FA_SZ_SEL2(IN(1).SZ(2),IN(3).VAL)',ClassFileName,'file','y'); + +//---Function list class. ---- +ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls); +PrintStringInfo('d2d0'+ArgSeparator+'d0',ClassFileName,'file','y'); +PrintStringInfo('d2d0g2'+ArgSeparator+'d2',ClassFileName,'file','y'); +PrintStringInfo('s2d0'+ArgSeparator+'s0',ClassFileName,'file','y'); +PrintStringInfo('s2d0g2'+ArgSeparator+'s2',ClassFileName,'file','y'); +PrintStringInfo('z2d0'+ArgSeparator+'z0',ClassFileName,'file','y'); +PrintStringInfo('z2d0g2'+ArgSeparator+'z2',ClassFileName,'file','y'); + + + +// --- Annotation Function And Function List Function. --- +FunctionName = 'moment'; +PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y'); +INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun); +INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun); + + + + // ------------------- // --- Class Nanmin. --- // ------------------- diff --git a/2.3-1/macros/ToolInitialization/lib b/2.3-1/macros/ToolInitialization/lib new file mode 100644 index 00000000..670a52e0 Binary files /dev/null and b/2.3-1/macros/ToolInitialization/lib differ diff --git a/2.3-1/macros/findDeps/getAllHeaders.sci b/2.3-1/macros/findDeps/getAllHeaders.sci index 1a455232..7711b81a 100644 --- a/2.3-1/macros/findDeps/getAllHeaders.sci +++ b/2.3-1/macros/findDeps/getAllHeaders.sci @@ -157,6 +157,7 @@ function allHeaders = getAllHeaders(SharedInfo) "src/c/statisticsFunctions/includes/dynlib_statisticsfunctions.h" "src/c/statisticsFunctions/includes/statMax.h" "src/c/statisticsFunctions/includes/statMin.h" + "src/c/statisticsFunctions/includes/moment.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 12f5b3d4..0ff4775d 100644 --- a/2.3-1/macros/findDeps/getAllInterfaces.sci +++ b/2.3-1/macros/findDeps/getAllInterfaces.sci @@ -145,6 +145,7 @@ function allInterfaces = getAllInterfaces(SharedInfo) "src/c/statisticsFunctions/interfaces/int_prod.h" "src/c/statisticsFunctions/interfaces/int_variance.h" "src/c/statisticsFunctions/interfaces/int_sum.h" + "src/c/statisticsFunctions/interfaces/int_moment.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 7e0a806c..949fe0d9 100644 --- a/2.3-1/macros/findDeps/getAllSources.sci +++ b/2.3-1/macros/findDeps/getAllSources.sci @@ -1046,6 +1046,15 @@ function allSources = getAllSources(SharedInfo,BuildTool) "src/c/statisticsFunctions/stdevf/zrowstdevfa.c" "src/c/statisticsFunctions/stdevf/ccolumnstdevfa.c" "src/c/statisticsFunctions/stdevf/scolumnstdevfa.c" + "src/c/statisticsFunctions/moment/dmoments.c" + "src/c/statisticsFunctions/moment/dmomentrowa.c" + "src/c/statisticsFunctions/moment/dmomentcola.c" + "src/c/statisticsFunctions/moment/smoments.c" + "src/c/statisticsFunctions/moment/smomentrowa.c" + "src/c/statisticsFunctions/moment/smomentcola.c" + "src/c/statisticsFunctions/moment/zmoments.c" + "src/c/statisticsFunctions/moment/zmomentrowa.c" + "src/c/statisticsFunctions/moment/zmomentcola.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 new file mode 100644 index 00000000..afcd3cab Binary files /dev/null and b/2.3-1/macros/findDeps/lib differ diff --git a/2.3-1/macros/lib b/2.3-1/macros/lib new file mode 100644 index 00000000..551263ea Binary files /dev/null and b/2.3-1/macros/lib differ diff --git a/2.3-1/src/c/statisticsFunctions/includes/moment.h b/2.3-1/src/c/statisticsFunctions/includes/moment.h new file mode 100644 index 00000000..3f419d06 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/includes/moment.h @@ -0,0 +1,42 @@ + /* 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 __MOMENT_H__ +#define __MOMENT_H__ +#include "types.h" +#include "doubleComplex.h" +#include "floatComplex.h" +#include "pow.h" +#include "addition.h" + +#ifdef __cplusplus +extern "C" { +#endif + +double dmoments (double* inp, int size, double ord); +void dmomentrowa (double* inp, int row, int col, double ord, double* out); +void dmomentcola (double* inp, int row, int col, double ord, double* out); + +float smoments (float* inp, int size, double ord); +void smomentrowa (float* inp, int row, int col, double ord, float* out); +void smomentcola (float* inp, int row, int col, double ord, float* out); + +doubleComplex zmoments (doubleComplex* inp, int size, double ord); +void zmomentrowa (doubleComplex* inp, int row, int col, double ord, doubleComplex* out); +void zmomentcola (doubleComplex* inp, int row, int col, double ord, doubleComplex* out); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__MOMENT_H__*/ diff --git a/2.3-1/src/c/statisticsFunctions/interfaces/int_moment.h b/2.3-1/src/c/statisticsFunctions/interfaces/int_moment.h new file mode 100644 index 00000000..5e9a0362 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/interfaces/int_moment.h @@ -0,0 +1,33 @@ + /* 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_MOMENT_H__ +#define __INT_MOMENT_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define d2d0momentd0(in1,size,in2) dmoments(in1,size[0]*size[1], in2) +#define d2d0g2momentd2(in1, size, in2, in3, size2 ,out) (in3[0] == 'r') ? dmomentrowa(in1, size[0], size[1], in2, out) : dmomentcola(in1, size[0], size[1], in2, out) + +#define s2d0moments0(in1,size,in2) smoments(in1,size[0]*size[1], in2) +#define s2d0g2moments2(in1, size, in2, in3, size2 ,out) (in3[0] == 'r') ? smomentrowa(in1, size[0], size[1], in2, out) : smomentcola(in1, size[0], size[1], in2, out) + +#define z2d0momentz0(in1,size,in2) zmoments(in1,size[0]*size[1], in2) +#define z2d0g2momentz2(in1, size, in2, in3, size2 ,out) (in3[0] == 'r') ? zmomentrowa(in1, size[0], size[1], in2, out) : zmomentcola(in1, size[0], size[1], in2, out) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_MOMENT_H__*/ diff --git a/2.3-1/src/c/statisticsFunctions/moment/dmomentcola.c b/2.3-1/src/c/statisticsFunctions/moment/dmomentcola.c new file mode 100644 index 00000000..538328e3 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/moment/dmomentcola.c @@ -0,0 +1,18 @@ +#include +#include +#include +#include "moment.h" + +void dmomentcola (double* inp, int row, int col, double ord, double* out) +{ + double vect[col]; + for(int i = 0; i < row ; i++) + { + for(int j = 0; j < col ; j++) + { + vect[j] = inp[i + j*row]; + } + out[i] = dmoments(vect, col, ord); + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/moment/dmomentrowa.c b/2.3-1/src/c/statisticsFunctions/moment/dmomentrowa.c new file mode 100644 index 00000000..811aac39 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/moment/dmomentrowa.c @@ -0,0 +1,18 @@ +#include +#include +#include +#include "moment.h" + +void dmomentrowa (double* inp, int row, int col, double ord, double* out) +{ + double vect[row]; + for(int i = 0; i < col ; i++) + { + for(int j = 0; j < row ; j++) + { + vect[j] = inp[j + i*row]; + } + out[i] = dmoments(vect, row, ord); + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/moment/dmoments.c b/2.3-1/src/c/statisticsFunctions/moment/dmoments.c new file mode 100644 index 00000000..b9d8564a --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/moment/dmoments.c @@ -0,0 +1,17 @@ +#include +#include +#include +#include "moment.h" + + +double dmoments (double* inp, int size, double ord) +{ + double sum = 0; + + for(int i = 0; i < size; i++) + { + sum = sum + pow(inp[i], ord); + } + + return sum/size; +} diff --git a/2.3-1/src/c/statisticsFunctions/moment/smomentcola.c b/2.3-1/src/c/statisticsFunctions/moment/smomentcola.c new file mode 100644 index 00000000..4255782c --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/moment/smomentcola.c @@ -0,0 +1,18 @@ +#include +#include +#include +#include "moment.h" + +void smomentcola (float* inp, int row, int col, double ord, float* out) +{ + float vect[col]; + for(int i = 0; i < row ; i++) + { + for(int j = 0; j < col ; j++) + { + vect[j] = inp[i + j*row]; + } + out[i] = smoments(vect, col, ord); + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/moment/smomentrowa.c b/2.3-1/src/c/statisticsFunctions/moment/smomentrowa.c new file mode 100644 index 00000000..574ebe76 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/moment/smomentrowa.c @@ -0,0 +1,18 @@ +#include +#include +#include +#include "moment.h" + +void smomentrowa (float* inp, int row, int col, double ord, float* out) +{ + float vect[row]; + for(int i = 0; i < col ; i++) + { + for(int j = 0; j < row ; j++) + { + vect[j] = inp[j + i*row]; + } + out[i] = smoments(vect, row, ord); + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/moment/smoments.c b/2.3-1/src/c/statisticsFunctions/moment/smoments.c new file mode 100644 index 00000000..aee9dc9e --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/moment/smoments.c @@ -0,0 +1,17 @@ +#include +#include +#include +#include "moment.h" + + +float smoments (float* inp, int size, double ord) +{ + float sum = 0; + + for(int i = 0; i < size; i++) + { + sum = sum + pow(inp[i], ord); + } + + return sum/size; +} diff --git a/2.3-1/src/c/statisticsFunctions/moment/zmomentcola.c b/2.3-1/src/c/statisticsFunctions/moment/zmomentcola.c new file mode 100644 index 00000000..2b3cebb1 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/moment/zmomentcola.c @@ -0,0 +1,20 @@ +#include +#include +#include +#include "moment.h" +#include "doubleComplex.h" +#include "floatComplex.h" + +void zmomentcola (doubleComplex* inp, int row, int col, double ord, doubleComplex* out) +{ + double vect[col]; + for(int i = 0; i < row ; i++) + { + for(int j = 0; j < col ; j++) + { + vect[j] = inp[i + j*row]; + } + out[i] = zmoments(vect, col, ord); + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/moment/zmomentrowa.c b/2.3-1/src/c/statisticsFunctions/moment/zmomentrowa.c new file mode 100644 index 00000000..e1e1b47d --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/moment/zmomentrowa.c @@ -0,0 +1,20 @@ +#include +#include +#include +#include "moment.h" +#include "doubleComplex.h" +#include "floatComplex.h" + +void zmomentrowa (doubleComplex* inp, int row, int col, double ord, doubleComplex* out) +{ + doubleComplex vect[row]; + for(int i = 0; i < col ; i++) + { + for(int j = 0; j < row ; j++) + { + vect[j] = inp[j + i*row]; + } + out[i] = zmoments(vect, row, ord); + } + +} diff --git a/2.3-1/src/c/statisticsFunctions/moment/zmoments.c b/2.3-1/src/c/statisticsFunctions/moment/zmoments.c new file mode 100644 index 00000000..1b847376 --- /dev/null +++ b/2.3-1/src/c/statisticsFunctions/moment/zmoments.c @@ -0,0 +1,22 @@ +#include +#include +#include +#include "moment.h" +#include "doubleComplex.h" +#include "floatComplex.h" +#include "pow.h" +#include "addition.h" +#include "division.h" + + +doubleComplex zmoments (doubleComplex* inp, int size, double ord) +{ + doubleComplex sum = DoubleComplex(0,0); + + for(int i = 0; i < size; i++) + { + sum = zadds(sum,zpows(inp[i], ord)); + } + + return zrdivs(sum,size); +} -- cgit