diff options
author | siddhu8990 | 2016-05-10 17:17:41 +0530 |
---|---|---|
committer | siddhu8990 | 2016-05-10 17:17:41 +0530 |
commit | 7d13dc4707f5c4387acdb1946b955490629d2f98 (patch) | |
tree | a343e5ec78c9fa354444688f1b3bbd89ca55170f /2.3-1 | |
parent | d0dae962944e7fdb42bca7d0aa80055c44881b45 (diff) | |
download | Scilab2C-7d13dc4707f5c4387acdb1946b955490629d2f98.tar.gz Scilab2C-7d13dc4707f5c4387acdb1946b955490629d2f98.tar.bz2 Scilab2C-7d13dc4707f5c4387acdb1946b955490629d2f98.zip |
Added support for cumprod, cumsum, triu, tril functions
Diffstat (limited to '2.3-1')
80 files changed, 2535 insertions, 146 deletions
diff --git a/2.3-1/includes/sci2clib.h b/2.3-1/includes/sci2clib.h index a13f1b4c..a6f247a9 100644 --- a/2.3-1/includes/sci2clib.h +++ b/2.3-1/includes/sci2clib.h @@ -304,12 +304,21 @@ /* interfacing zeros */ #include "zeros.h" #include "int_zeros.h" - /* interfacing diag */ #include "diag.h" #include "int_diag.h" - - +/*interfacing cumsum*/ +#include "int_cumsum.h" +#include "cumsum.h" +/*interfacing cumprod*/ +#include "int_cumprod.h" +#include "cumprod.h" +/*interfacing triu*/ +#include "int_triu.h" +#include "triu.h" +/*interfacing tril*/ +#include "int_tril.h" +#include "tril.h" /* SIGNAL PROCESSING */ /* interfacing convol */ @@ -372,6 +381,10 @@ /*include for string */ #include "str.h" +/*ODE functions*/ +//#include "ode.h" +//#include "int_ode.h" + /*Scilab-arduino toolbox*/ #ifdef Arduino1 #include "int_cmd_digital_out.h" diff --git a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin Binary files differindex 5baa2e21..27c8880b 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin +++ b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin diff --git a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci index 3a6d225a..b08ab398 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci +++ b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci @@ -196,14 +196,15 @@ global STACKDEDUG //If a function is passed as input argument, Change the scope of function name from variable to string, //as it is passed as string to C function. Also enter this function in conversion list also. if(ASTFunName == 'ode') - disp(NInArg) if NInArg == 4 InArg(4).Scope = 'String'; ODEFunName = InArg(4).Name; - disp(ODEFunName) end end [InArg,SharedInfo] = ST_GetInArgInfo(InArg,NInArg,FileInfo,SharedInfo); + if(ASTFunName == 'ode') + disp(InArg(4).Name); + end end // #RNU_RES_B @@ -356,6 +357,19 @@ global STACKDEDUG else ST_InsOutArg(OutArg,NOutArg,FileInfo,SharedInfo,'all'); end + if ASTFunName == 'ode' then + ODE_InArg(1) = InArg(3) + ODE_InArg(2) = InArg(1) + ODE_OutArg(1) = OutArg(1) + ODE_CFunName = C_GenerateFunName(ODEFunName,ODE_InArg,2,ODE_OutArg,1); + + [FunFound, FunType, FunSize, FunValue, FunFindLike, FunDimension] = ... + ST_Get(InArg(4).Name,FileInfo.GlobalVarFileName); + disp(FunFound); + //ST_Del(InArg(4).Name,FileInfo.GlobalVarFileName); + //ST_Set(ODE_CFunName, FunType, FunSize, FunValue, FunFindLike, FunDimension); + end + //#RNUREM_ME NUT: per risparmiare tempo di esecuzione puoi mettere delle if sulle funzioni che devono //#RNUREM_ME NUT: essere skippate. @@ -425,6 +439,7 @@ global STACKDEDUG //NUT: il problema della d0d0OpEqual dovrebbe essere legato al fatto che cerco di fare la opequal legata alla ins... //NUT: devo evitare di scriveral dentro la lsista delle funzioni da tradurre. //#RNU_RES_E + SharedInfo = FL_UpdateToBeConv(ASTFunName,CFunName,FunPrecSpecifier,FunTypeAnnot,FunSizeAnnot,InArg,NInArg,OutArg,NOutArg,FileInfo,SharedInfo); //#RNU_RES_B @@ -473,12 +488,15 @@ global STACKDEDUG //NUT: e' piu' ordinato. //#RNU_RES_E - //If current function being converted is 'ode', call 'scilab2c' again to convert - //function containing differential equations. It is passed as one of the input - //arguements to 'ode'. + //If current function being converted is 'ode', insert function containing + //in list of functions to be converted if ASTFunName == 'ode' then - temp = ODEFunName + '.sci' - scilab2c( '/home/siddhesh/Documents/Scilab/ODE/ODE_test/try_ode.sci', FileInfo.OutCCCodeDir, FileInfo.UserSciFilesPaths,'FunCall','make','AVR') + //ODE_InArg(1) = InArg(3) + //ODE_InArg(2) = InArg(1) + //ODE_OutArg(1) = OutArg(1) + //ODE_CFunName = C_GenerateFunName(ODEFunName,ODE_InArg,2,ODE_OutArg,1); + GenCFunDatFiles(ODEFunName,%t,FunTypeAnnot,['IN(2).SZ(1)' 'IN(2).SZ(2)'],ODE_InArg,2,ODE_OutArg,1,ODE_CFunName,LibTypeInfo,FunInfoDatDir); + SharedInfo = FL_UpdateToBeConv(ODEFunName,ODE_CFunName,%t,FunTypeAnnot,FunSizeAnnot,ODE_InArg,2,ODE_OutArg,1,FileInfo,SharedInfo); end endfunction diff --git a/2.3-1/macros/ASTManagement/AST_HandleHeader.bin b/2.3-1/macros/ASTManagement/AST_HandleHeader.bin Binary files differindex b5e33b67..67e0296a 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleHeader.bin +++ b/2.3-1/macros/ASTManagement/AST_HandleHeader.bin diff --git a/2.3-1/macros/ASTManagement/AST_HandleHeader.sci b/2.3-1/macros/ASTManagement/AST_HandleHeader.sci index 7346f321..41dcd06c 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleHeader.sci +++ b/2.3-1/macros/ASTManagement/AST_HandleHeader.sci @@ -114,8 +114,6 @@ if(SharedInfo.RunMode == "FunCall") SharedInfo.CurrentFunInfo.FunTypeAnnot = FunTypeAnnot; SharedInfo.CurrentFunInfo.FunSizeAnnot = FunSizeAnnot; end - disp(SharedInfo.CurrentFunInfo.FunSizeAnnot) - disp(SharedInfo.CurrentFunInfo.FunTypeAnnot) end //#RNU_RES_B // ----------------------------------------------------------------------------- diff --git a/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.bin b/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.bin Binary files differindex 51ec64c2..7102319d 100644 --- a/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.bin +++ b/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.bin diff --git a/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.sci b/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.sci index 5db26236..314c0f28 100644 --- a/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.sci +++ b/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.sci @@ -101,7 +101,7 @@ for counterout = 1:NOutArg // This is a dynamic memory extension of a local variable and for the moment
// we issue an error according to SCI2C specifications
// #RNU_RES_E
-
+ //disp(FunSizeAnnot)
for iterOutputPosition=1:size(FunSizeAnnot, 'c')
tmpeval = eval(FunSizeAnnot(counterout, iterOutputPosition));
if (IsNanSize(tmpeval))
diff --git a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin Binary files differindex 1db8f2be..42ad0ab3 100644 --- a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin +++ b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index 07d1127c..20db53fe 100644 --- a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -4843,8 +4843,8 @@ ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls); PrintStringInfo('NIN= 4',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(3).SZ(1)',ClassFileName,'file','y');
-PrintStringInfo('OUT(1).SZ(2)= IN(3).SZ(2)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= FA_MUL(IN(1).SZ(2),IN(3).SZ(2))',ClassFileName,'file','y');
//Arguements specified: initial value, start time, end time, ode function
PrintStringInfo('NIN= 4',ClassFileName,'file','y');
@@ -4855,10 +4855,10 @@ PrintStringInfo('OUT(1).SZ(2)= IN(3).SZ(2)',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
-PrintStringInfo('d0d0d2g2'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('d0d0d2g2'+ArgSeparator+'d2',ClassFileName,'file','y');
PrintStringInfo('d0d0d0g2'+ArgSeparator+'d0',ClassFileName,'file','y');
-PrintStringInfo('d2d0d2g2'+ArgSeparator+'d0',ClassFileName,'file','y');
-PrintStringInfo('d2d0d0g2'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('d2d0d2g2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('d2d0d0g2'+ArgSeparator+'d2',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'ode';
@@ -4866,6 +4866,130 @@ PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file', INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+//------------------------------------
+//---- Class CUMSUM ---------------------
+//------------------------------------
+ClassName = 'CUMSUM';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+//Arguements specified: initial value, start time, time vector, ode function
+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('d0'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('s0'+ArgSeparator+'s0',ClassFileName,'file','y');
+PrintStringInfo('u80'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('i80'+ArgSeparator+'i80',ClassFileName,'file','y');
+PrintStringInfo('u160'+ArgSeparator+'u160',ClassFileName,'file','y');
+PrintStringInfo('i160'+ArgSeparator+'i160',ClassFileName,'file','y');
+
+PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('u82'+ArgSeparator+'u82',ClassFileName,'file','y');
+PrintStringInfo('i82'+ArgSeparator+'i82',ClassFileName,'file','y');
+PrintStringInfo('u162'+ArgSeparator+'u162',ClassFileName,'file','y');
+PrintStringInfo('i162'+ArgSeparator+'i162',ClassFileName,'file','y');
+
+PrintStringInfo('d2g2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s2g2'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('u82g2'+ArgSeparator+'u82',ClassFileName,'file','y');
+PrintStringInfo('i82g2'+ArgSeparator+'i82',ClassFileName,'file','y');
+PrintStringInfo('u162g2'+ArgSeparator+'u162',ClassFileName,'file','y');
+PrintStringInfo('i162g2'+ArgSeparator+'i162',ClassFileName,'file','y');
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'cumsum';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+FunctionName = 'cumprod';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class TRIU ---------------------
+//------------------------------------
+ClassName = 'TRIU';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+//Arguements specified: initial value, start time, time vector, ode function
+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');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('s0'+ArgSeparator+'s0',ClassFileName,'file','y');
+PrintStringInfo('u80'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('i80'+ArgSeparator+'i80',ClassFileName,'file','y');
+PrintStringInfo('u160'+ArgSeparator+'u160',ClassFileName,'file','y');
+PrintStringInfo('i160'+ArgSeparator+'i160',ClassFileName,'file','y');
+
+PrintStringInfo('d0d0'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('s0s0'+ArgSeparator+'s0',ClassFileName,'file','y');
+PrintStringInfo('u80u80'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('i80i80'+ArgSeparator+'i80',ClassFileName,'file','y');
+PrintStringInfo('u160u160'+ArgSeparator+'u160',ClassFileName,'file','y');
+PrintStringInfo('i160i160'+ArgSeparator+'i160',ClassFileName,'file','y');
+PrintStringInfo('u80d0'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('i80d0'+ArgSeparator+'i80',ClassFileName,'file','y');
+PrintStringInfo('u160d0'+ArgSeparator+'u160',ClassFileName,'file','y');
+PrintStringInfo('i160d0'+ArgSeparator+'i160',ClassFileName,'file','y');
+
+PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s2'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('u82'+ArgSeparator+'u82',ClassFileName,'file','y');
+PrintStringInfo('i82'+ArgSeparator+'i82',ClassFileName,'file','y');
+PrintStringInfo('u162'+ArgSeparator+'u162',ClassFileName,'file','y');
+PrintStringInfo('i162'+ArgSeparator+'i162',ClassFileName,'file','y');
+
+PrintStringInfo('d2d0'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('s2s0'+ArgSeparator+'s2',ClassFileName,'file','y');
+PrintStringInfo('u82u80'+ArgSeparator+'u82',ClassFileName,'file','y');
+PrintStringInfo('i82i80'+ArgSeparator+'i82',ClassFileName,'file','y');
+PrintStringInfo('u162u160'+ArgSeparator+'u162',ClassFileName,'file','y');
+PrintStringInfo('i162i160'+ArgSeparator+'i162',ClassFileName,'file','y');
+PrintStringInfo('u82d0'+ArgSeparator+'u82',ClassFileName,'file','y');
+PrintStringInfo('i82d0'+ArgSeparator+'i82',ClassFileName,'file','y');
+PrintStringInfo('u162d0'+ArgSeparator+'u162',ClassFileName,'file','y');
+PrintStringInfo('i162d0'+ArgSeparator+'i162',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'triu';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+FunctionName = 'tril';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
// ////////////////////////////////////////////
// /////PARTE INTRODOTTA DA ALBERTO MOREA
// /////////////////////////////////////////////
diff --git a/2.3-1/macros/findDeps/getAllHeaders.bin b/2.3-1/macros/findDeps/getAllHeaders.bin Binary files differindex 3f2bf2db..c130ae70 100644 --- a/2.3-1/macros/findDeps/getAllHeaders.bin +++ b/2.3-1/macros/findDeps/getAllHeaders.bin diff --git a/2.3-1/macros/findDeps/getAllHeaders.sci b/2.3-1/macros/findDeps/getAllHeaders.sci index 6338fe22..373549e4 100644 --- a/2.3-1/macros/findDeps/getAllHeaders.sci +++ b/2.3-1/macros/findDeps/getAllHeaders.sci @@ -64,6 +64,10 @@ function allHeaders = getAllHeaders(Target) "src/c/matrixOperations/includes/determ.h" "src/c/matrixOperations/includes/matrixMultiplication.h" "src/c/matrixOperations/includes/diag.h" + "src/c/matrixOperations/includes/cumsum.h" + "src/c/matrixOperations/includes/cumprod.h" + "src/c/matrixOperations/includes/triu.h" + "src/c/matrixOperations/includes/tril.h" "src/c/elementaryFunctions/includes/cos.h" "src/c/elementaryFunctions/includes/fix.h" "src/c/elementaryFunctions/includes/exp.h" @@ -146,9 +150,9 @@ function allHeaders = getAllHeaders(Target) "src/c/scilab-arduino/includes/cmd_analog_in.h" "src/c/scilab-arduino/includes/cmd_dcmotor_setup.h" "src/c/scilab-arduino/includes/cmd_dcmotor_run.h" -// "src/c/scilab-arduino/includes/cmd_servo_attach.h" -// "src/c/scilab-arduino/includes/cmd_servo_detach.h" -// "src/c/scilab-arduino/includes/cmd_servo_move.h" + "src/c/scilab-arduino/includes/cmd_servo_attach.h" + "src/c/scilab-arduino/includes/cmd_servo_detach.h" + "src/c/scilab-arduino/includes/cmd_servo_move.h" "src/c/scilab-arduino/includes/sleep.h"]; AVR_headers = [ diff --git a/2.3-1/macros/findDeps/getAllInterfaces.bin b/2.3-1/macros/findDeps/getAllInterfaces.bin Binary files differindex 0121eb9e..65bccb12 100644 --- a/2.3-1/macros/findDeps/getAllInterfaces.bin +++ b/2.3-1/macros/findDeps/getAllInterfaces.bin diff --git a/2.3-1/macros/findDeps/getAllInterfaces.sci b/2.3-1/macros/findDeps/getAllInterfaces.sci index 5bef0c6f..436eb869 100644 --- a/2.3-1/macros/findDeps/getAllInterfaces.sci +++ b/2.3-1/macros/findDeps/getAllInterfaces.sci @@ -52,6 +52,10 @@ function allInterfaces = getAllInterfaces(Target) "src/c/matrixOperations/interfaces/int_fill.h" "src/c/matrixOperations/interfaces/int_expm.h" "src/c/matrixOperations/interfaces/int_diag.h" + "src/c/matrixOperations/interfaces/int_cumsum.h" + "src/c/matrixOperations/interfaces/int_cumprod.h" + "src/c/matrixOperations/interfaces/int_triu.h" + "src/c/matrixOperations/interfaces/int_tril.h" "src/c/elementaryFunctions/interfaces/int_asinh.h" "src/c/elementaryFunctions/interfaces/int_atanh.h" "src/c/elementaryFunctions/interfaces/int_sinh.h" @@ -139,7 +143,7 @@ function allInterfaces = getAllInterfaces(Target) "src/c/scilab-arduino/interfaces/int_cmd_analog_out.h" "src/c/scilab-arduino/interfaces/int_cmd_analog_in.h" "src/c/scilab-arduino/interfaces/int_cmd_dcmotor.h" -// "src/c/scilab-arduino/interfaces/int_cmd_servo.h" + "src/c/scilab-arduino/interfaces/int_cmd_servo.h" "src/c/scilab-arduino/interfaces/int_sleep.h"]; //Interface files required for "AVR" output diff --git a/2.3-1/macros/findDeps/getAllSources.bin b/2.3-1/macros/findDeps/getAllSources.bin Binary files differindex 0796a3bb..c014aaa6 100644 --- a/2.3-1/macros/findDeps/getAllSources.bin +++ b/2.3-1/macros/findDeps/getAllSources.bin diff --git a/2.3-1/macros/findDeps/getAllSources.sci b/2.3-1/macros/findDeps/getAllSources.sci index 631edd25..5a88eb3d 100644 --- a/2.3-1/macros/findDeps/getAllSources.sci +++ b/2.3-1/macros/findDeps/getAllSources.sci @@ -274,6 +274,54 @@ function allSources = getAllSources(Target) "src/c/matrixOperations/diag/i16diagins.c" "src/c/matrixOperations/diag/i16diagexa.c" "src/c/matrixOperations/diag/i16diagexs.c" + "src/c/matrixOperations/cumsum/dcumsuma.c" + "src/c/matrixOperations/cumsum/drowcumsuma.c" + "src/c/matrixOperations/cumsum/dcolumncumsuma.c" + "src/c/matrixOperations/cumsum/scumsuma.c" + "src/c/matrixOperations/cumsum/srowcumsuma.c" + "src/c/matrixOperations/cumsum/scolumncumsuma.c" + "src/c/matrixOperations/cumsum/u8cumsuma.c" + "src/c/matrixOperations/cumsum/u8rowcumsuma.c" + "src/c/matrixOperations/cumsum/u8columncumsuma.c" + "src/c/matrixOperations/cumsum/i8cumsuma.c" + "src/c/matrixOperations/cumsum/i8rowcumsuma.c" + "src/c/matrixOperations/cumsum/i8columncumsuma.c" + "src/c/matrixOperations/cumsum/u16cumsuma.c" + "src/c/matrixOperations/cumsum/u16rowcumsuma.c" + "src/c/matrixOperations/cumsum/u16columncumsuma.c" + "src/c/matrixOperations/cumsum/i16cumsuma.c" + "src/c/matrixOperations/cumsum/i16rowcumsuma.c" + "src/c/matrixOperations/cumsum/i16columncumsuma.c" + "src/c/matrixOperations/cumprod/dcumproda.c" + "src/c/matrixOperations/cumprod/drowcumproda.c" + "src/c/matrixOperations/cumprod/dcolumncumproda.c" + "src/c/matrixOperations/cumprod/scumproda.c" + "src/c/matrixOperations/cumprod/srowcumproda.c" + "src/c/matrixOperations/cumprod/scolumncumproda.c" + "src/c/matrixOperations/cumprod/u8cumproda.c" + "src/c/matrixOperations/cumprod/u8rowcumproda.c" + "src/c/matrixOperations/cumprod/u8columncumproda.c" + "src/c/matrixOperations/cumprod/i8cumproda.c" + "src/c/matrixOperations/cumprod/i8rowcumproda.c" + "src/c/matrixOperations/cumprod/i8columncumproda.c" + "src/c/matrixOperations/cumprod/u16cumproda.c" + "src/c/matrixOperations/cumprod/u16rowcumproda.c" + "src/c/matrixOperations/cumprod/u16columncumproda.c" + "src/c/matrixOperations/cumprod/i16cumproda.c" + "src/c/matrixOperations/cumprod/i16rowcumproda.c" + "src/c/matrixOperations/cumprod/i16columncumproda.c" + "src/c/matrixOperations/triu/dtriua.c" + "src/c/matrixOperations/triu/striua.c" + "src/c/matrixOperations/triu/u8triua.c" + "src/c/matrixOperations/triu/i8triua.c" + "src/c/matrixOperations/triu/u16triua.c" + "src/c/matrixOperations/triu/i16triua.c" + "src/c/matrixOperations/tril/dtrila.c" + "src/c/matrixOperations/tril/strila.c" + "src/c/matrixOperations/tril/u8trila.c" + "src/c/matrixOperations/tril/i8trila.c" + "src/c/matrixOperations/tril/u16trila.c" + "src/c/matrixOperations/tril/i16trila.c" "src/c/elementaryFunctions/cos/dcosa.c" "src/c/elementaryFunctions/cos/dcoss.c" "src/c/elementaryFunctions/cos/scosa.c" @@ -897,8 +945,9 @@ function allSources = getAllSources(Target) "src/c/implicitList/zimplicitLists.c" "src/c/implicitList/dimplicitLists.c" "src/c/implicitList/cimplicitLists.c" - "src/c/implicitList/simplicitLists.c"]; - //"src/c/differential_calculus/ode/ode.c"]; + "src/c/implicitList/simplicitLists.c"]; + //"src/c/differential_calculus/ode/dodes.c" + //"src/c/differential_calculus/ode/doded.c"]; //Files to be inserted only if output format selected is 'Arduino'. Arduino_files = ["src/c/scilab-arduino/cmd_digital_out/u8cmd_digital_outs.c" @@ -907,9 +956,9 @@ function allSources = getAllSources(Target) "src/c/scilab-arduino/cmd_analog_in/u8cmd_analog_ins.c" "src/c/scilab-arduino/cmd_dcmotor_setup/u8cmd_dcmotor_setups.c" "src/c/scilab-arduino/cmd_dcmotor_run/u8cmd_dcmotor_runs.c" -// "src/c/scilab-arduino/cmd_servo_attach/u8cmd_servo_attach.cpp" -// "src/c/scilab-arduino/cmd_servo_detach/u8cmd_servo_detach.cpp" -// "src/c/scilab-arduino/cmd_servo_move/u8cmd_servo_move.cpp" + "src/c/scilab-arduino/cmd_servo_attach/u8cmd_servo_attach.cpp" + "src/c/scilab-arduino/cmd_servo_detach/u8cmd_servo_detach.cpp" + "src/c/scilab-arduino/cmd_servo_move/u8cmd_servo_move.cpp" "src/c/scilab-arduino/sleep/u16sleeps.c"]; //Files to be inserted only if output format selected is 'AVR'. diff --git a/2.3-1/macros/runsci2c.bin b/2.3-1/macros/runsci2c.bin Binary files differindex b7eba521..f5b80872 100644 --- a/2.3-1/macros/runsci2c.bin +++ b/2.3-1/macros/runsci2c.bin diff --git a/2.3-1/macros/runsci2c.sci b/2.3-1/macros/runsci2c.sci index 83cf7081..206a362f 100644 --- a/2.3-1/macros/runsci2c.sci +++ b/2.3-1/macros/runsci2c.sci @@ -90,96 +90,93 @@ end // ---------------------------
// --- Copy library files. ---
// ---------------------------
-if(RunMode <> "FunCall")
-
- global SCI2CHOME
-
- allSources = SCI2CHOME + "/" + getAllSources(Target);
- allHeaders = SCI2CHOME + "/" +getAllHeaders(Target);
- allInterfaces = SCI2CHOME + "/" + getAllInterfaces(Target);
- allLibraries = SCI2CHOME + "/" + getAllLibraries(Target);
-
- mkdir(SCI2COutputPath+"/src/");
- mkdir(SCI2COutputPath+"/src/c/");
- mkdir(SCI2COutputPath+"/includes/");
- mkdir(SCI2COutputPath+"/interfaces/");
- mkdir(SCI2COutputPath+"/libraries/");
-
- // -- Sources
- PrintStepInfo('Copying sources', FileInfo.GeneralReport,'both');
- for i = 1:size(allSources, "*")
- // DEBUG only
- //disp("Copying "+allSources(i)+" in "+SCI2COutputPath+"/src/c/");
- copyfile(allSources(i), SCI2COutputPath+"/src/c/");
- end
+if (RunMode <> 'FunCall')
+global SCI2CHOME
+
+allSources = SCI2CHOME + "/" + getAllSources(Target);
+allHeaders = SCI2CHOME + "/" +getAllHeaders(Target);
+allInterfaces = SCI2CHOME + "/" + getAllInterfaces(Target);
+allLibraries = SCI2CHOME + "/" + getAllLibraries(Target);
+
+mkdir(SCI2COutputPath+"/src/");
+mkdir(SCI2COutputPath+"/src/c/");
+mkdir(SCI2COutputPath+"/includes/");
+mkdir(SCI2COutputPath+"/interfaces/");
+mkdir(SCI2COutputPath+"/libraries/");
+
+// -- Sources
+PrintStepInfo('Copying sources', FileInfo.GeneralReport,'both');
+for i = 1:size(allSources, "*")
+ // DEBUG only
+ //disp("Copying "+allSources(i)+" in "+SCI2COutputPath+"/src/c/");
+ copyfile(allSources(i), SCI2COutputPath+"/src/c/");
+end
- // -- Includes
- PrintStepInfo('Copying headers', FileInfo.GeneralReport,'both');
- for i = 1:size(allHeaders, "*")
- // DEBUG only
- //disp("Copying "+allHeaders(i)+" in "+SCI2COutputPath+"/includes/");
- copyfile(allHeaders(i), SCI2COutputPath+"/includes/");
- end
+// -- Includes
+PrintStepInfo('Copying headers', FileInfo.GeneralReport,'both');
+for i = 1:size(allHeaders, "*")
+ // DEBUG only
+ //disp("Copying "+allHeaders(i)+" in "+SCI2COutputPath+"/includes/");
+ copyfile(allHeaders(i), SCI2COutputPath+"/includes/");
+end
- // -- Interfaces
- PrintStepInfo('Copying interfaces', FileInfo.GeneralReport,'both');
- for i = 1:size(allInterfaces, "*")
- // DEBUG only
- //disp("Copying "+allInterfaces(i)+" in "+SCI2COutputPath+"/interfaces/");
- copyfile(allInterfaces(i), SCI2COutputPath+"/interfaces/");
- end
+// -- Interfaces
+PrintStepInfo('Copying interfaces', FileInfo.GeneralReport,'both');
+for i = 1:size(allInterfaces, "*")
+ // DEBUG only
+ //disp("Copying "+allInterfaces(i)+" in "+SCI2COutputPath+"/interfaces/");
+ copyfile(allInterfaces(i), SCI2COutputPath+"/interfaces/");
+end
- // -- Libraries
- PrintStepInfo('Copying libraries', FileInfo.GeneralReport,'both');
- for i = 1:size(allLibraries, "*")
- // DEBUG only
- //disp("Copying "+allInterfaces(i)+" in "+SCI2COutputPath+"/interfaces/");
- copyfile(allLibraries(i), SCI2COutputPath+"/libraries/");
- end
+// -- Libraries
+PrintStepInfo('Copying libraries', FileInfo.GeneralReport,'both');
+for i = 1:size(allLibraries, "*")
+ // DEBUG only
+ //disp("Copying "+allInterfaces(i)+" in "+SCI2COutputPath+"/interfaces/");
+ copyfile(allLibraries(i), SCI2COutputPath+"/libraries/");
+end
- // --------------------------
- // --- Generate Makefile. ---
- // --------------------------
- //If output format is chosen as 'Arduino', then copy makefile for arduino from
- //default folder, else generate makefile for standalone c code
-
- if (Target == 'Arduino')
-
- GenerateSetupFunction(FileInfo);
- mkdir(SCI2COutputPath+"/arduino/");
- mkdir(SCI2COutputPath+"/arduino/sci2c_arduino");
- //Copy arduino makefile
- arduinoFiles = SCI2CHOME + "/" + getArduinoFiles();
- PrintStepInfo('Copying arduino files', FileInfo.GeneralReport,'both');
- copyfile(arduinoFiles(1), SCI2COutputPath);
- for i = 2:size(arduinoFiles, "*")
- // DEBUG only
- //disp("Copying "+arduinoFiles(i)+" in "+SCI2COutputPath+"/arduino/sci2carduino");
- copyfile(arduinoFiles(i), SCI2COutputPath+"/arduino/sci2c_arduino/");
- end
-
- else
-
- if BuildTool == "make"
- C_GenerateMakefile(FileInfo,SharedInfo);
- copyBlasLapackLibs(FileInfo,SharedInfo); //Previously .dll files and blas,lapack library not creating for cygwin by additing this works fine
- end
- if BuildTool == "nmake"
- copyBlasLapackLibs(FileInfo,SharedInfo);
- C_GenerateMakefile_msvc(FileInfo,SharedInfo);
- end
- end
+// --------------------------
+// --- Generate Makefile. ---
+// --------------------------
+//If output format is chosen as 'Arduino', then copy makefile for arduino from
+//default folder, else generate makefile for standalone c code
+
+if (Target == 'Arduino')
+
+ GenerateSetupFunction(FileInfo);
+ mkdir(SCI2COutputPath+"/arduino/");
+ mkdir(SCI2COutputPath+"/arduino/sci2c_arduino");
+ //Copy arduino makefile
+ arduinoFiles = SCI2CHOME + "/" + getArduinoFiles();
+ PrintStepInfo('Copying arduino files', FileInfo.GeneralReport,'both');
+ copyfile(arduinoFiles(1), SCI2COutputPath);
+ for i = 2:size(arduinoFiles, "*")
+ // DEBUG only
+ //disp("Copying "+arduinoFiles(i)+" in "+SCI2COutputPath+"/arduino/sci2carduino");
+ copyfile(arduinoFiles(i), SCI2COutputPath+"/arduino/sci2c_arduino/");
+ end
+else
- // ------------------------------
- // --- Generate SCI2C Header. ---
- // ------------------------------
- // FIXME : Give the user the ability to set this prefix
- FunctionPrefix = "SCI2C";
- C_GenerateSCI2CHeader(SCI2COutputPath+"/includes/", FunctionPrefix);
+ if BuildTool == "make"
+ C_GenerateMakefile(FileInfo,SharedInfo);
+ copyBlasLapackLibs(FileInfo,SharedInfo); //Previously .dll files and blas,lapack library not creating for cygwin by additing this works fine
+ end
+ if BuildTool == "nmake"
+ copyBlasLapackLibs(FileInfo,SharedInfo);
+ C_GenerateMakefile_msvc(FileInfo,SharedInfo);
+ end
+end
-end // RunMode <> FunCall
+// ------------------------------
+// --- Generate SCI2C Header. ---
+// ------------------------------
+// FIXME : Give the user the ability to set this prefix
+FunctionPrefix = "SCI2C";
+C_GenerateSCI2CHeader(SCI2COutputPath+"/includes/", FunctionPrefix);
+end
// -----------------
// --- Epilogue. ---
// -----------------
diff --git a/2.3-1/src/c/differential_calculus/includes/ode.h b/2.3-1/src/c/differential_calculus/includes/ode.h index 46220a84..f08909ce 100644 --- a/2.3-1/src/c/differential_calculus/includes/ode.h +++ b/2.3-1/src/c/differential_calculus/includes/ode.h @@ -1,9 +1,23 @@ -// FOSSEE IIT Bombay -#ifdef __INT_ODE_H__ -#define __INT_ODE_H__ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in -double ODE(double initial_value, double start_time, double end_time, \ - char *ode_function, double nequs, double eps_abs, double eps_rel \ - double step_size) +#ifndef __ODE_H__ +#define __ODE_H__ -#endif /*__INT_ODE_H__*/
\ No newline at end of file +double dodes(double initial_value, double start_time, double end_time, \ + char *ode_function, double nequs, double eps_abs, double eps_rel, \ + double step_size); + +void doded(double *initial_value, double start_time, double end_time, \ + char *ode_function, double nequs, double eps_abs, double eps_rel, \ + double step_size, double *out); + +#endif /*__ODE_H__*/
\ No newline at end of file diff --git a/2.3-1/src/c/differential_calculus/interfaces/int_ode.h b/2.3-1/src/c/differential_calculus/interfaces/int_ode.h index 5000ed5e..a27acbad 100644 --- a/2.3-1/src/c/differential_calculus/interfaces/int_ode.h +++ b/2.3-1/src/c/differential_calculus/interfaces/int_ode.h @@ -1,9 +1,30 @@ -// FOSSEE IIT Bombay +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in -#ifdef __INT_ODE_H__ +#ifndef __INT_ODE_H__ #define __INT_ODE_H__ -#define d0d0d0g2ODEd0(in1, in2, in3, in4) ODE(in1, in2, in3, in4, 1, 1.0e-2,\ +#ifdef __cplusplus +extern "C" { +#endif + +#define d0d0d0g2oded0(in1, in2, in3, in4) dodes(in1, in2, in3, in4, 1, 1.0e-2,\ 1.0e-2, 1.0e-6) +#define d2d0d0g2oded2(in1, size1, in2, in3, func_name, strsize, out) doded(in1, in2, in3, func_name \ + 1, 1.0e-2, 1.0e-2, 1.0e-6, out) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + #endif /*__INT_ODE_H__*/
\ No newline at end of file diff --git a/2.3-1/src/c/differential_calculus/ode/doded.c b/2.3-1/src/c/differential_calculus/ode/doded.c new file mode 100644 index 00000000..b544c422 --- /dev/null +++ b/2.3-1/src/c/differential_calculus/ode/doded.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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +#include "ode.h" +#include "types.h" +#include <gsl/gsl_errno.h> +#include <gsl/gsl_matrix.h> +#include <gsl/gsl_odeiv2.h> + + +void doded(double *initial_value, double start_time, double end_time, \ + char *ode_function, double nequs, double eps_abs, double eps_rel, \ + double step_size, double *out) +{ + double t = start_time; + //Setup ODE related parameters + gsl_odeiv2_system sys = {ode_function, NULL, 2, NULL}; + + gsl_odeiv2_step *s = gsl_odeiv2_step_alloc (gsl_odeiv2_step_rkf45, nequs); + gsl_odeiv2_control *c = gsl_odeiv2_control_y_new (eps_abs, eps_rel); + gsl_odeiv2_evolve *e = gsl_odeiv2_evolve_alloc (nequs); + + while(t < end_time) + { + gsl_odeiv2_evolve_apply_fixed_step (e, c, s, &sys, &t, step_size, &out); + } + + gsl_odeiv2_evolve_free (e); + gsl_odeiv2_control_free (c); + gsl_odeiv2_step_free (s); +} diff --git a/2.3-1/src/c/differential_calculus/ode/dodes.c b/2.3-1/src/c/differential_calculus/ode/dodes.c new file mode 100644 index 00000000..ee6718bb --- /dev/null +++ b/2.3-1/src/c/differential_calculus/ode/dodes.c @@ -0,0 +1,36 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +#include "ode.h" +#include "types.h" +#include <gsl/gsl_errno.h> +#include <gsl/gsl_matrix.h> +#include <gsl/gsl_odeiv2.h> + + +double dodes(double initial_value, double start_time, double end_time, \ + char *ode_function, double nequs, double eps_abs, double eps_rel, \ + double step_size) +{ + double out = 0; + //int status; + //Setup ODE related parameters + gsl_odeiv2_system sys = {ode_function, NULL, 2, NULL}; + + gsl_odeiv2_step *s = gsl_odeiv2_step_alloc (gsl_odeiv2_step_rkf45, nequs); + gsl_odeiv2_control *c = gsl_odeiv2_control_y_new (eps_abs, eps_rel); + gsl_odeiv2_evolve *e = gsl_odeiv2_evolve_alloc (nequs); + + gsl_odeiv2_evolve_apply_fixed_step (e, c, s, &sys, &start_time, step_size, &out); + + return out; + +} diff --git a/2.3-1/src/c/differential_calculus/ode/ode.c b/2.3-1/src/c/differential_calculus/ode/ode.c deleted file mode 100644 index b815e367..00000000 --- a/2.3-1/src/c/differential_calculus/ode/ode.c +++ /dev/null @@ -1,26 +0,0 @@ -// FOSSEE IIT Bombay - -#include "ODE.h" -#include "types.h" - - -double ODE(double initial_value, double start_time, double end_time, \ - char *ode_function, double nequs, double eps_abs, double eps_rel \ - double step_size) -{ - double out = 0; - int status; - //Setup ODE related parameters - gsl_odeiv2_system sys = {ode_function, NULL, 2, NULL}; - - gsl_odeiv2_step *s = gsl_odeiv2_step_alloc (gsl_odeiv2_step_rkf45, nequs); - gsl_odeiv2_control *c = gsl_odeiv2_control_y_new (eps_abs, eps_rel); - gsl_odeiv2_evolve *e = gsl_odeiv2_evolve_alloc (nequs); - - status = gsl_odeiv2_evolve_apply_fixed_step (e, c, s, &sys, &t, stepsize, x_dot); - - if (status == GSL_SUCCESS) { - return out; - } - else return 0; -} diff --git a/2.3-1/src/c/matrixOperations/cumprod/dcolumncumproda.c b/2.3-1/src/c/matrixOperations/cumprod/dcolumncumproda.c new file mode 100644 index 00000000..7bed70b4 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumprod/dcolumncumproda.c @@ -0,0 +1,38 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumprod.h" +#include "types.h" + +void dcolumncumproda(double *in1, int row, int column, double *out) +{ + int row_cnt, col_cnt = 0; + + //Assign elements in first column as it is + for(row_cnt = 0; row_cnt < row; row_cnt++) + { + out[row_cnt] = in1[row_cnt]; + } + + //For second column onwards + for (row_cnt = 0; row_cnt < row; row_cnt++) + { + for ( col_cnt = 1; col_cnt < column; col_cnt++) + { + + out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \ + * out[(col_cnt-1)*row+row_cnt]; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumprod/dcumproda.c b/2.3-1/src/c/matrixOperations/cumprod/dcumproda.c new file mode 100644 index 00000000..0a408682 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumprod/dcumproda.c @@ -0,0 +1,30 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumprod.h" +#include "types.h" + +void dcumproda(double *in1, int row, int column, double *out) +{ + int row_cnt, col_cnt = 0; + double cumprod = 1; + for (col_cnt = 0; col_cnt < row; col_cnt++) + { + for ( row_cnt = 0; row_cnt < column; row_cnt++) + { + cumprod *= in1[col_cnt*column+row_cnt]; + out[col_cnt*column+row_cnt] = cumprod; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumprod/drowcumproda.c b/2.3-1/src/c/matrixOperations/cumprod/drowcumproda.c new file mode 100644 index 00000000..74b2bfc9 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumprod/drowcumproda.c @@ -0,0 +1,37 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumprod.h" +#include "types.h" + +void drowcumproda(double *in1, int row, int column, double *out) +{ + int row_cnt, col_cnt = 0; + + //assign elements in first row as it is + for (col_cnt = 0; col_cnt < column; col_cnt++) + { + out[col_cnt*row] = in1[col_cnt*row]; + } + //For second row onwards + for (col_cnt = 0; col_cnt < column; col_cnt++) + { + for ( row_cnt = 1; row_cnt < row; row_cnt++) + { + + out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \ + * out[col_cnt*row+row_cnt -1]; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumprod/i16columncumproda.c b/2.3-1/src/c/matrixOperations/cumprod/i16columncumproda.c new file mode 100644 index 00000000..3c644775 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumprod/i16columncumproda.c @@ -0,0 +1,38 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumprod.h" +#include "types.h" + +void i16columncumproda(int16 *in1, int row, int column, int16 *out) +{ + int row_cnt, col_cnt = 0; + + //Assign elements in first column as it is + for(row_cnt = 0; row_cnt < row; row_cnt++) + { + out[row_cnt] = in1[row_cnt]; + } + + //For second column onwards + for (row_cnt = 0; row_cnt < row; row_cnt++) + { + for ( col_cnt = 1; col_cnt < column; col_cnt++) + { + + out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \ + * out[(col_cnt-1)*row+row_cnt]; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumprod/i16cumproda.c b/2.3-1/src/c/matrixOperations/cumprod/i16cumproda.c new file mode 100644 index 00000000..8352f416 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumprod/i16cumproda.c @@ -0,0 +1,30 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumprod.h" +#include "types.h" + +void i16cumproda(int16 *in1, int row, int column, int16 *out) +{ + int row_cnt, col_cnt = 0; + int16 cumprod = 1; + for (col_cnt = 0; col_cnt < row; col_cnt++) + { + for ( row_cnt = 0; row_cnt < column; row_cnt++) + { + cumprod *= in1[col_cnt*column+row_cnt]; + out[col_cnt*column+row_cnt] = cumprod; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumprod/i16rowcumproda.c b/2.3-1/src/c/matrixOperations/cumprod/i16rowcumproda.c new file mode 100644 index 00000000..35ab6d48 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumprod/i16rowcumproda.c @@ -0,0 +1,37 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumprod.h" +#include "types.h" + +void i16rowcumproda(int16 *in1, int row, int column, int16 *out) +{ + int row_cnt, col_cnt = 0; + + //assign elements in first row as it is + for (col_cnt = 0; col_cnt < column; col_cnt++) + { + out[col_cnt*row] = in1[col_cnt*row]; + } + //For second row onwards + for (col_cnt = 0; col_cnt < column; col_cnt++) + { + for ( row_cnt = 1; row_cnt < row; row_cnt++) + { + + out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \ + * out[col_cnt*row+row_cnt -1]; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumprod/i8columncumproda.c b/2.3-1/src/c/matrixOperations/cumprod/i8columncumproda.c new file mode 100644 index 00000000..df9109d4 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumprod/i8columncumproda.c @@ -0,0 +1,38 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumprod.h" +#include "types.h" + +void i8columncumproda(int8 *in1, int row, int column, int8 *out) +{ + int row_cnt, col_cnt = 0; + + //Assign elements in first column as it is + for(row_cnt = 0; row_cnt < row; row_cnt++) + { + out[row_cnt] = in1[row_cnt]; + } + + //For second column onwards + for (row_cnt = 0; row_cnt < row; row_cnt++) + { + for ( col_cnt = 1; col_cnt < column; col_cnt++) + { + + out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \ + * out[(col_cnt-1)*row+row_cnt]; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumprod/i8cumproda.c b/2.3-1/src/c/matrixOperations/cumprod/i8cumproda.c new file mode 100644 index 00000000..ba502ba4 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumprod/i8cumproda.c @@ -0,0 +1,30 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumprod.h" +#include "types.h" + +void i8cumproda(int8 *in1, int row, int column, int8 *out) +{ + int row_cnt, col_cnt = 0; + int8 cumprod = 1; + for (col_cnt = 0; col_cnt < row; col_cnt++) + { + for ( row_cnt = 0; row_cnt < column; row_cnt++) + { + cumprod *= in1[col_cnt*column+row_cnt]; + out[col_cnt*column+row_cnt] = cumprod; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumprod/i8rowcumproda.c b/2.3-1/src/c/matrixOperations/cumprod/i8rowcumproda.c new file mode 100644 index 00000000..20b4126d --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumprod/i8rowcumproda.c @@ -0,0 +1,37 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumprod.h" +#include "types.h" + +void i8rowcumproda(int8 *in1, int row, int column, int8 *out) +{ + int row_cnt, col_cnt = 0; + + //assign elements in first row as it is + for (col_cnt = 0; col_cnt < column; col_cnt++) + { + out[col_cnt*row] = in1[col_cnt*row]; + } + //For second row onwards + for (col_cnt = 0; col_cnt < column; col_cnt++) + { + for ( row_cnt = 1; row_cnt < row; row_cnt++) + { + + out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \ + * out[col_cnt*row+row_cnt -1]; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumprod/scolumncumproda.c b/2.3-1/src/c/matrixOperations/cumprod/scolumncumproda.c new file mode 100644 index 00000000..5c2c0c3f --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumprod/scolumncumproda.c @@ -0,0 +1,38 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumprod.h" +#include "types.h" + +void scolumncumproda(float *in1, int row, int column, float *out) +{ + int row_cnt, col_cnt = 0; + + //Assign elements in first column as it is + for(row_cnt = 0; row_cnt < row; row_cnt++) + { + out[row_cnt] = in1[row_cnt]; + } + + //For second column onwards + for (row_cnt = 0; row_cnt < row; row_cnt++) + { + for ( col_cnt = 1; col_cnt < column; col_cnt++) + { + + out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \ + * out[(col_cnt-1)*row+row_cnt]; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumprod/scumproda.c b/2.3-1/src/c/matrixOperations/cumprod/scumproda.c new file mode 100644 index 00000000..b50ea63f --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumprod/scumproda.c @@ -0,0 +1,30 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumprod.h" +#include "types.h" + +void scumproda(float *in1, int row, int column, float *out) +{ + int row_cnt, col_cnt = 0; + float cumprod = 1; + for (col_cnt = 0; col_cnt < row; col_cnt++) + { + for ( row_cnt = 0; row_cnt < column; row_cnt++) + { + cumprod += in1[col_cnt*column+row_cnt]; + out[col_cnt*column+row_cnt] = cumprod; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumprod/srowcumproda.c b/2.3-1/src/c/matrixOperations/cumprod/srowcumproda.c new file mode 100644 index 00000000..e3d146a9 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumprod/srowcumproda.c @@ -0,0 +1,37 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumprod.h" +#include "types.h" + +void srowcumproda(float *in1, int row, int column, float *out) +{ + int row_cnt, col_cnt = 0; + + //assign elements in first row as it is + for (col_cnt = 0; col_cnt < column; col_cnt++) + { + out[col_cnt*row] = in1[col_cnt*row]; + } + //For second row onwards + for (col_cnt = 0; col_cnt < column; col_cnt++) + { + for ( row_cnt = 1; row_cnt < row; row_cnt++) + { + + out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \ + * out[col_cnt*row+row_cnt -1]; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumprod/u16columncumproda.c b/2.3-1/src/c/matrixOperations/cumprod/u16columncumproda.c new file mode 100644 index 00000000..a0e821f7 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumprod/u16columncumproda.c @@ -0,0 +1,38 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumprod.h" +#include "types.h" + +void u16columncumproda(uint16 *in1, int row, int column, uint16 *out) +{ + int row_cnt, col_cnt = 0; + + //Assign elements in first column as it is + for(row_cnt = 0; row_cnt < row; row_cnt++) + { + out[row_cnt] = in1[row_cnt]; + } + + //For second column onwards + for (row_cnt = 0; row_cnt < row; row_cnt++) + { + for ( col_cnt = 1; col_cnt < column; col_cnt++) + { + + out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \ + * out[(col_cnt-1)*row+row_cnt]; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumprod/u16cumproda.c b/2.3-1/src/c/matrixOperations/cumprod/u16cumproda.c new file mode 100644 index 00000000..de969fb3 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumprod/u16cumproda.c @@ -0,0 +1,30 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumprod.h" +#include "types.h" + +void u16cumproda(uint16 *in1, int row, int column, uint16 *out) +{ + int row_cnt, col_cnt = 0; + uint16 cumprod = 1; + for (col_cnt = 0; col_cnt < row; col_cnt++) + { + for ( row_cnt = 0; row_cnt < column; row_cnt++) + { + cumprod *= in1[col_cnt*column+row_cnt]; + out[col_cnt*column+row_cnt] = cumprod; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumprod/u16rowcumproda.c b/2.3-1/src/c/matrixOperations/cumprod/u16rowcumproda.c new file mode 100644 index 00000000..1ea4468a --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumprod/u16rowcumproda.c @@ -0,0 +1,37 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumprod.h" +#include "types.h" + +void u16rowcumproda(uint16 *in1, int row, int column, uint16 *out) +{ + int row_cnt, col_cnt = 0; + + //assign elements in first row as it is + for (col_cnt = 0; col_cnt < column; col_cnt++) + { + out[col_cnt*row] = in1[col_cnt*row]; + } + //For second row onwards + for (col_cnt = 0; col_cnt < column; col_cnt++) + { + for ( row_cnt = 1; row_cnt < row; row_cnt++) + { + + out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \ + * out[col_cnt*row+row_cnt -1]; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumprod/u8columncumproda.c b/2.3-1/src/c/matrixOperations/cumprod/u8columncumproda.c new file mode 100644 index 00000000..70eb0583 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumprod/u8columncumproda.c @@ -0,0 +1,38 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumprod.h" +#include "types.h" + +void u8columncumproda(uint8 *in1, int row, int column, uint8 *out) +{ + int row_cnt, col_cnt = 0; + + //Assign elements in first column as it is + for(row_cnt = 0; row_cnt < row; row_cnt++) + { + out[row_cnt] = in1[row_cnt]; + } + + //For second column onwards + for (row_cnt = 0; row_cnt < row; row_cnt++) + { + for ( col_cnt = 1; col_cnt < column; col_cnt++) + { + + out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \ + * out[(col_cnt-1)*row+row_cnt]; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumprod/u8cumproda.c b/2.3-1/src/c/matrixOperations/cumprod/u8cumproda.c new file mode 100644 index 00000000..048b26fc --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumprod/u8cumproda.c @@ -0,0 +1,30 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumprod.h" +#include "types.h" + +void u8cumproda(uint8 *in1, int row, int column, uint8 *out) +{ + int row_cnt, col_cnt = 0; + uint8 cumprod = 1; + for (col_cnt = 0; col_cnt < row; col_cnt++) + { + for ( row_cnt = 0; row_cnt < column; row_cnt++) + { + cumprod *= in1[col_cnt*column+row_cnt]; + out[col_cnt*column+row_cnt] = cumprod; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumprod/u8rowcumproda.c b/2.3-1/src/c/matrixOperations/cumprod/u8rowcumproda.c new file mode 100644 index 00000000..fb500c7b --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumprod/u8rowcumproda.c @@ -0,0 +1,37 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumprod.h" +#include "types.h" + +void u8rowcumproda(uint8 *in1, int row, int column, uint8 *out) +{ + int row_cnt, col_cnt = 0; + + //assign elements in first row as it is + for (col_cnt = 0; col_cnt < column; col_cnt++) + { + out[col_cnt*row] = in1[col_cnt*row]; + } + //For second row onwards + for (col_cnt = 0; col_cnt < column; col_cnt++) + { + for ( row_cnt = 1; row_cnt < row; row_cnt++) + { + + out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \ + * out[col_cnt*row+row_cnt -1]; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumsum/dcolumncumsuma.c b/2.3-1/src/c/matrixOperations/cumsum/dcolumncumsuma.c new file mode 100644 index 00000000..b97704e6 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumsum/dcolumncumsuma.c @@ -0,0 +1,38 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumsum.h" +#include "types.h" + +void dcolumncumsuma(double *in1, int row, int column, double *out) +{ + int row_cnt, col_cnt = 0; + + //Assign elements in first column as it is + for(row_cnt = 0; row_cnt < row; row_cnt++) + { + out[row_cnt] = in1[row_cnt]; + } + + //For second column onwards + for (row_cnt = 0; row_cnt < row; row_cnt++) + { + for ( col_cnt = 1; col_cnt < column; col_cnt++) + { + + out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \ + + out[(col_cnt-1)*row+row_cnt]; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumsum/dcumsuma.c b/2.3-1/src/c/matrixOperations/cumsum/dcumsuma.c new file mode 100644 index 00000000..6a2eb1bb --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumsum/dcumsuma.c @@ -0,0 +1,30 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumsum.h" +#include "types.h" + +void dcumsuma(double *in1, int row, int column, double *out) +{ + int row_cnt, col_cnt = 0; + double cumsum = 0; + for (col_cnt = 0; col_cnt < row; col_cnt++) + { + for ( row_cnt = 0; row_cnt < column; row_cnt++) + { + cumsum += in1[col_cnt*column+row_cnt]; + out[col_cnt*column+row_cnt] = cumsum; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumsum/drowcumsuma.c b/2.3-1/src/c/matrixOperations/cumsum/drowcumsuma.c new file mode 100644 index 00000000..5b46f16b --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumsum/drowcumsuma.c @@ -0,0 +1,37 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumsum.h" +#include "types.h" + +void drowcumsuma(double *in1, int row, int column, double *out) +{ + int row_cnt, col_cnt = 0; + + //assign elements in first row as it is + for (col_cnt = 0; col_cnt < column; col_cnt++) + { + out[col_cnt*row] = in1[col_cnt*row]; + } + //For second row onwards + for (col_cnt = 0; col_cnt < column; col_cnt++) + { + for ( row_cnt = 1; row_cnt < row; row_cnt++) + { + + out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \ + + out[col_cnt*row+row_cnt -1]; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumsum/i16columncumsuma.c b/2.3-1/src/c/matrixOperations/cumsum/i16columncumsuma.c new file mode 100644 index 00000000..5c43bbdc --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumsum/i16columncumsuma.c @@ -0,0 +1,38 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumsum.h" +#include "types.h" + +void i16columncumsuma(int16 *in1, int row, int column, int16 *out) +{ + int row_cnt, col_cnt = 0; + + //Assign elements in first column as it is + for(row_cnt = 0; row_cnt < row; row_cnt++) + { + out[row_cnt] = in1[row_cnt]; + } + + //For second column onwards + for (row_cnt = 0; row_cnt < row; row_cnt++) + { + for ( col_cnt = 1; col_cnt < column; col_cnt++) + { + + out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \ + + out[(col_cnt-1)*row+row_cnt]; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumsum/i16cumsuma.c b/2.3-1/src/c/matrixOperations/cumsum/i16cumsuma.c new file mode 100644 index 00000000..7632c589 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumsum/i16cumsuma.c @@ -0,0 +1,30 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumsum.h" +#include "types.h" + +void i16cumsuma(int16 *in1, int row, int column, int16 *out) +{ + int row_cnt, col_cnt = 0; + int16 cumsum = 0; + for (col_cnt = 0; col_cnt < row; col_cnt++) + { + for ( row_cnt = 0; row_cnt < column; row_cnt++) + { + cumsum += in1[col_cnt*column+row_cnt]; + out[col_cnt*column+row_cnt] = cumsum; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumsum/i16rowcumsuma.c b/2.3-1/src/c/matrixOperations/cumsum/i16rowcumsuma.c new file mode 100644 index 00000000..0e75f252 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumsum/i16rowcumsuma.c @@ -0,0 +1,37 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumsum.h" +#include "types.h" + +void i16rowcumsuma(int16 *in1, int row, int column, int16 *out) +{ + int row_cnt, col_cnt = 0; + + //assign elements in first row as it is + for (col_cnt = 0; col_cnt < column; col_cnt++) + { + out[col_cnt*row] = in1[col_cnt*row]; + } + //For second row onwards + for (col_cnt = 0; col_cnt < column; col_cnt++) + { + for ( row_cnt = 1; row_cnt < row; row_cnt++) + { + + out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \ + + out[col_cnt*row+row_cnt -1]; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumsum/i8columncumsuma.c b/2.3-1/src/c/matrixOperations/cumsum/i8columncumsuma.c new file mode 100644 index 00000000..27fdbded --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumsum/i8columncumsuma.c @@ -0,0 +1,38 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumsum.h" +#include "types.h" + +void i8columncumsuma(int8 *in1, int row, int column, int8 *out) +{ + int row_cnt, col_cnt = 0; + + //Assign elements in first column as it is + for(row_cnt = 0; row_cnt < row; row_cnt++) + { + out[row_cnt] = in1[row_cnt]; + } + + //For second column onwards + for (row_cnt = 0; row_cnt < row; row_cnt++) + { + for ( col_cnt = 1; col_cnt < column; col_cnt++) + { + + out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \ + + out[(col_cnt-1)*row+row_cnt]; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumsum/i8cumsuma.c b/2.3-1/src/c/matrixOperations/cumsum/i8cumsuma.c new file mode 100644 index 00000000..d8b9c329 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumsum/i8cumsuma.c @@ -0,0 +1,30 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumsum.h" +#include "types.h" + +void i8cumsuma(int8 *in1, int row, int column, int8 *out) +{ + int row_cnt, col_cnt = 0; + int8 cumsum = 0; + for (col_cnt = 0; col_cnt < row; col_cnt++) + { + for ( row_cnt = 0; row_cnt < column; row_cnt++) + { + cumsum += in1[col_cnt*column+row_cnt]; + out[col_cnt*column+row_cnt] = cumsum; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumsum/i8rowcumsuma.c b/2.3-1/src/c/matrixOperations/cumsum/i8rowcumsuma.c new file mode 100644 index 00000000..39298ce5 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumsum/i8rowcumsuma.c @@ -0,0 +1,37 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumsum.h" +#include "types.h" + +void i8rowcumsuma(int8 *in1, int row, int column, int8 *out) +{ + int row_cnt, col_cnt = 0; + + //assign elements in first row as it is + for (col_cnt = 0; col_cnt < column; col_cnt++) + { + out[col_cnt*row] = in1[col_cnt*row]; + } + //For second row onwards + for (col_cnt = 0; col_cnt < column; col_cnt++) + { + for ( row_cnt = 1; row_cnt < row; row_cnt++) + { + + out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \ + + out[col_cnt*row+row_cnt -1]; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumsum/scolumncumsuma.c b/2.3-1/src/c/matrixOperations/cumsum/scolumncumsuma.c new file mode 100644 index 00000000..befbdfe0 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumsum/scolumncumsuma.c @@ -0,0 +1,38 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumsum.h" +#include "types.h" + +void scolumncumsuma(float *in1, int row, int column, float *out) +{ + int row_cnt, col_cnt = 0; + + //Assign elements in first column as it is + for(row_cnt = 0; row_cnt < row; row_cnt++) + { + out[row_cnt] = in1[row_cnt]; + } + + //For second column onwards + for (row_cnt = 0; row_cnt < row; row_cnt++) + { + for ( col_cnt = 1; col_cnt < column; col_cnt++) + { + + out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \ + + out[(col_cnt-1)*row+row_cnt]; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumsum/scumsuma.c b/2.3-1/src/c/matrixOperations/cumsum/scumsuma.c new file mode 100644 index 00000000..83701867 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumsum/scumsuma.c @@ -0,0 +1,30 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumsum.h" +#include "types.h" + +void scumsuma(float *in1, int row, int column, float *out) +{ + int row_cnt, col_cnt = 0; + float cumsum = 0; + for (col_cnt = 0; col_cnt < row; col_cnt++) + { + for ( row_cnt = 0; row_cnt < column; row_cnt++) + { + cumsum += in1[col_cnt*column+row_cnt]; + out[col_cnt*column+row_cnt] = cumsum; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumsum/srowcumsuma.c b/2.3-1/src/c/matrixOperations/cumsum/srowcumsuma.c new file mode 100644 index 00000000..1ce17da9 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumsum/srowcumsuma.c @@ -0,0 +1,37 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumsum.h" +#include "types.h" + +void srowcumsuma(float *in1, int row, int column, float *out) +{ + int row_cnt, col_cnt = 0; + + //assign elements in first row as it is + for (col_cnt = 0; col_cnt < column; col_cnt++) + { + out[col_cnt*row] = in1[col_cnt*row]; + } + //For second row onwards + for (col_cnt = 0; col_cnt < column; col_cnt++) + { + for ( row_cnt = 1; row_cnt < row; row_cnt++) + { + + out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \ + + out[col_cnt*row+row_cnt -1]; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumsum/u16columncumsuma.c b/2.3-1/src/c/matrixOperations/cumsum/u16columncumsuma.c new file mode 100644 index 00000000..bbff8c89 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumsum/u16columncumsuma.c @@ -0,0 +1,38 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumsum.h" +#include "types.h" + +void u16columncumsuma(uint16 *in1, int row, int column, uint16 *out) +{ + int row_cnt, col_cnt = 0; + + //Assign elements in first column as it is + for(row_cnt = 0; row_cnt < row; row_cnt++) + { + out[row_cnt] = in1[row_cnt]; + } + + //For second column onwards + for (row_cnt = 0; row_cnt < row; row_cnt++) + { + for ( col_cnt = 1; col_cnt < column; col_cnt++) + { + + out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \ + + out[(col_cnt-1)*row+row_cnt]; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumsum/u16cumsuma.c b/2.3-1/src/c/matrixOperations/cumsum/u16cumsuma.c new file mode 100644 index 00000000..601a7efd --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumsum/u16cumsuma.c @@ -0,0 +1,30 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumsum.h" +#include "types.h" + +void u16cumsuma(uint16 *in1, int row, int column, uint16 *out) +{ + int row_cnt, col_cnt = 0; + uint16 cumsum = 0; + for (col_cnt = 0; col_cnt < row; col_cnt++) + { + for ( row_cnt = 0; row_cnt < column; row_cnt++) + { + cumsum += in1[col_cnt*column+row_cnt]; + out[col_cnt*column+row_cnt] = cumsum; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumsum/u16rowcumsuma.c b/2.3-1/src/c/matrixOperations/cumsum/u16rowcumsuma.c new file mode 100644 index 00000000..b27e4530 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumsum/u16rowcumsuma.c @@ -0,0 +1,37 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumsum.h" +#include "types.h" + +void u16rowcumsuma(uint16 *in1, int row, int column, uint16 *out) +{ + int row_cnt, col_cnt = 0; + + //assign elements in first row as it is + for (col_cnt = 0; col_cnt < column; col_cnt++) + { + out[col_cnt*row] = in1[col_cnt*row]; + } + //For second row onwards + for (col_cnt = 0; col_cnt < column; col_cnt++) + { + for ( row_cnt = 1; row_cnt < row; row_cnt++) + { + + out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \ + + out[col_cnt*row+row_cnt -1]; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumsum/u8columncumsuma.c b/2.3-1/src/c/matrixOperations/cumsum/u8columncumsuma.c new file mode 100644 index 00000000..598c4a6c --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumsum/u8columncumsuma.c @@ -0,0 +1,38 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumsum.h" +#include "types.h" + +void u8columncumsuma(uint8 *in1, int row, int column, uint8 *out) +{ + int row_cnt, col_cnt = 0; + + //Assign elements in first column as it is + for(row_cnt = 0; row_cnt < row; row_cnt++) + { + out[row_cnt] = in1[row_cnt]; + } + + //For second column onwards + for (row_cnt = 0; row_cnt < row; row_cnt++) + { + for ( col_cnt = 1; col_cnt < column; col_cnt++) + { + + out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \ + + out[(col_cnt-1)*row+row_cnt]; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumsum/u8cumsuma.c b/2.3-1/src/c/matrixOperations/cumsum/u8cumsuma.c new file mode 100644 index 00000000..38792e65 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumsum/u8cumsuma.c @@ -0,0 +1,30 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumsum.h" +#include "types.h" + +void u8cumsuma(uint8 *in1, int row, int column, uint8 *out) +{ + int row_cnt, col_cnt = 0; + uint8 cumsum = 0; + for (col_cnt = 0; col_cnt < row; col_cnt++) + { + for ( row_cnt = 0; row_cnt < column; row_cnt++) + { + cumsum += in1[col_cnt*column+row_cnt]; + out[col_cnt*column+row_cnt] = cumsum; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/cumsum/u8rowcumsuma.c b/2.3-1/src/c/matrixOperations/cumsum/u8rowcumsuma.c new file mode 100644 index 00000000..184cf71f --- /dev/null +++ b/2.3-1/src/c/matrixOperations/cumsum/u8rowcumsuma.c @@ -0,0 +1,37 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function returns cumulative sum of members of array/matrix + +#include "cumsum.h" +#include "types.h" + +void u8rowcumsuma(uint8 *in1, int row, int column, uint8 *out) +{ + int row_cnt, col_cnt = 0; + + //assign elements in first row as it is + for (col_cnt = 0; col_cnt < column; col_cnt++) + { + out[col_cnt*row] = in1[col_cnt*row]; + } + //For second row onwards + for (col_cnt = 0; col_cnt < column; col_cnt++) + { + for ( row_cnt = 1; row_cnt < row; row_cnt++) + { + + out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \ + + out[col_cnt*row+row_cnt -1]; + } + } + +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/includes/cumprod.h b/2.3-1/src/c/matrixOperations/includes/cumprod.h new file mode 100644 index 00000000..bc08abaa --- /dev/null +++ b/2.3-1/src/c/matrixOperations/includes/cumprod.h @@ -0,0 +1,52 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +#ifndef __CUMPROD_H__ +#define __CUMPROD_H__ + +#include "types.h" + +#ifdef __cplusplus +#extern "C" { +#endif + +void dcumproda(double *in1, int row, int column, double *out); +void drowcumproda(double *in1, int row, int column, double *out); +void dcolumncumproda(double *in1, int row, int column, double *out); + +void scumproda(float *in1, int row, int column, float *out); +void srowcumproda(float *in1, int row, int column, float *out); +void scolumncumproda(float *in1, int row, int column, float *out); + +void u8cumproda(uint8 *in1, int row, int column, uint8 *out); +void u8rowcumproda(uint8 *in1, int row, int column, uint8 *out); +void u8columncumproda(uint8 *in1, int row, int column, uint8 *out); + +void i8cumproda(int8 *in1, int row, int column, int8 *out); +void i8rowcumproda(int8 *in1, int row, int column, int8 *out); +void i8columncumproda(int8 *in1, int row, int column, int8 *out); + +void u16cumproda(uint16 *in1, int row, int column, uint16 *out); +void u16rowcumproda(uint16 *in1, int row, int column, uint16 *out); +void u16columncumproda(uint16 *in1, int row, int column, uint16 *out); + +void i16cumproda(int16 *in1, int row, int column, int16 *out); +void i16rowcumproda(int16 *in1, int row, int column, int16 *out); +void i16columncumproda(int16 *in1, int row, int column, int16 *out); + + + +#ifdef __cplusplus +#} /* extern "C" */ +#endif + +#endif /*__CUMPROD_H__*/ diff --git a/2.3-1/src/c/matrixOperations/includes/cumsum.h b/2.3-1/src/c/matrixOperations/includes/cumsum.h new file mode 100644 index 00000000..4c6a3b37 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/includes/cumsum.h @@ -0,0 +1,52 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +#ifndef __CUMSUM_H__ +#define __CUMSUM_H__ + +#include "types.h" + +#ifdef __cplusplus +#extern "C" { +#endif + +void dcumsuma(double *in1, int row, int column, double *out); +void drowcumsuma(double *in1, int row, int column, double *out); +void dcolumncumsuma(double *in1, int row, int column, double *out); + +void scumsuma(float *in1, int row, int column, float *out); +void srowcumsuma(float *in1, int row, int column, float *out); +void scolumncumsuma(float *in1, int row, int column, float *out); + +void u8cumsuma(uint8 *in1, int row, int column, uint8 *out); +void u8rowcumsuma(uint8 *in1, int row, int column, uint8 *out); +void u8columncumsuma(uint8 *in1, int row, int column, uint8 *out); + +void i8cumsuma(int8 *in1, int row, int column, int8 *out); +void i8rowcumsuma(int8 *in1, int row, int column, int8 *out); +void i8columncumsuma(int8 *in1, int row, int column, int8 *out); + +void u16cumsuma(uint16 *in1, int row, int column, uint16 *out); +void u16rowcumsuma(uint16 *in1, int row, int column, uint16 *out); +void u16columncumsuma(uint16 *in1, int row, int column, uint16 *out); + +void i16cumsuma(int16 *in1, int row, int column, int16 *out); +void i16rowcumsuma(int16 *in1, int row, int column, int16 *out); +void i16columncumsuma(int16 *in1, int row, int column, int16 *out); + + + +#ifdef __cplusplus +#} /* extern "C" */ +#endif + +#endif /*__CUMSUM_H__*/ diff --git a/2.3-1/src/c/matrixOperations/includes/tril.h b/2.3-1/src/c/matrixOperations/includes/tril.h new file mode 100644 index 00000000..e61a3b72 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/includes/tril.h @@ -0,0 +1,33 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +#ifndef __TRIL_H__ +#define __TRIL_H__ + +#include "types.h" + +#ifdef __cplusplus +#extern "C" { +#endif + +void dtrila (double *in, int row, int column, double diag, double *out); +void strila (float *in, int row, int column, double diag, float *out); +void u8trila (uint8 *in, int row, int column, double diag, uint8 *out); +void u16trila (uint16 *in, int row, int column, double diag, uint16 *out); +void i8trila (int8 *in, int row, int column, double diag, int8 *out); +void i16trila (int16 *in, int row, int column, double diag, int16 *out); + +#ifdef __cplusplus +#} /* extern "C" */ +#endif + +#endif /*__TRIL_H__*/ diff --git a/2.3-1/src/c/matrixOperations/includes/triu.h b/2.3-1/src/c/matrixOperations/includes/triu.h new file mode 100644 index 00000000..1dda2794 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/includes/triu.h @@ -0,0 +1,33 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +#ifndef __TRIU_H__ +#define __TRIU_H__ + +#include "types.h" + +#ifdef __cplusplus +#extern "C" { +#endif + +void dtriua (double *in, int row, int column, double diag, double *out); +void striua (float *in, int row, int column, double diag, float *out); +void u8triua (uint8 *in, int row, int column, double diag, uint8 *out); +void u16triua (uint16 *in, int row, int column, double diag, uint16 *out); +void i8triua (int8 *in, int row, int column, double diag, int8 *out); +void i16triua (int16 *in, int row, int column, double diag, int16 *out); + +#ifdef __cplusplus +#} /* extern "C" */ +#endif + +#endif /*__TRIU_H__*/ diff --git a/2.3-1/src/c/matrixOperations/interfaces/int_cumprod.h b/2.3-1/src/c/matrixOperations/interfaces/int_cumprod.h new file mode 100644 index 00000000..722efbba --- /dev/null +++ b/2.3-1/src/c/matrixOperations/interfaces/int_cumprod.h @@ -0,0 +1,54 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +#ifndef __INT_CUMPROD_H__ +#define __INT_CUMPROD_H__ + + +#ifdef __cplusplus +#extern "C" { +#endif + +#define d0cumprodd0(in) in +#define s0cumprods0(in) in +#define u80cumprodu80(in) in +#define u160cumprodu160(in) in +#define i80cumprodi80(in) in +#define i160cumprodi160(in) in + +#define d2cumprodd2(in1, size1, out) dcumproda(in1, size1[0], size1[1], out) +#define s2cumprods2(in1, size1, out) scumproda(in1, size1[0], size1[1], out) +#define u82cumprodu82(in1, size1, out) u8cumproda(in1, size1[0], size1[1], out) +#define u162cumprodu162(in1, size1, out) u16cumproda(in1, size1[0], size1[1], out) +#define i82cumprodi82(in1, size1, out) i8cumproda(in1, size1[0], size1[1], out) +#define i162cumprodi162(in1, size1, out) i16cumproda(in1, size1[0], size1[1], out) + +#define d2g2cumprodd2(in1, size1, in2, size2, out) (in2[0]=='r') ? \ + drowcumproda(in1,size1[0],size1[1],out) : dcolumncumproda(in1,size1[0],size1[1],out) +#define s2g2cumprods2(in1, size1, in2, size2, out) (in2[0]=='r') ? \ + srowcumproda(in1,size1[0],size1[1],out) : scolumncumproda(in1,size1[0],size1[1],out) +#define u82g2cumprodu82(in1, size1, in2, size2, out) (in2[0]=='r') ? \ + u8rowcumproda(in1,size1[0],size1[1],out) : u8columncumproda(in1,size1[0],size1[1],out) +#define i82g2cumprodi82(in1, size1, in2, size2, out) (in2[0]=='r') ? \ + i8rowcumproda(in1,size1[0],size1[1],out) : i8columncumproda(in1,size1[0],size1[1],out) +#define u162g2cumprodu162(in1, size1, in2, size2, out) (in2[0]=='r') ? \ + u16rowcumproda(in1,size1[0],size1[1],out) : u16columncumproda(in1,size1[0],size1[1],out) +#define i162g2cumprodi162(in1, size1, in2, size2, out) (in2[0]=='r') ? \ + i16rowcumproda(in1,size1[0],size1[1],out) : i16columncumproda(in1,size1[0],size1[1],out) + + + +#ifdef __cplusplus +#} /* extern "C" */ +#endif + +#endif /*__INT_CUMPROD_H__*/ diff --git a/2.3-1/src/c/matrixOperations/interfaces/int_cumsum.h b/2.3-1/src/c/matrixOperations/interfaces/int_cumsum.h new file mode 100644 index 00000000..c09a9b46 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/interfaces/int_cumsum.h @@ -0,0 +1,54 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +#ifndef __INT_CUMSUM_H__ +#define __INT_CUMSUM_H__ + + +#ifdef __cplusplus +#extern "C" { +#endif + +#define d0cumsumd0(in) in +#define s0cumsums0(in) in +#define u80cumsumu80(in) in +#define u160cumsumu160(in) in +#define i80cumsumi80(in) in +#define i160cumsumi160(in) in + +#define d2cumsumd2(in1, size1, out) dcumsuma(in1, size1[0], size1[1], out) +#define s2cumsums2(in1, size1, out) scumsuma(in1, size1[0], size1[1], out) +#define u82cumsumu82(in1, size1, out) u8cumsuma(in1, size1[0], size1[1], out) +#define u162cumsumu162(in1, size1, out) u16cumsuma(in1, size1[0], size1[1], out) +#define i82cumsumi82(in1, size1, out) i8cumsuma(in1, size1[0], size1[1], out) +#define i162cumsumi162(in1, size1, out) i16cumsuma(in1, size1[0], size1[1], out) + +#define d2g2cumsumd2(in1, size1, in2, size2, out) (in2[0]=='r') ? \ + drowcumsuma(in1,size1[0],size1[1],out) : dcolumncumsuma(in1,size1[0],size1[1],out) +#define s2g2cumsums2(in1, size1, in2, size2, out) (in2[0]=='r') ? \ + srowcumsuma(in1,size1[0],size1[1],out) : scolumncumsuma(in1,size1[0],size1[1],out) +#define u82g2cumsumu82(in1, size1, in2, size2, out) (in2[0]=='r') ? \ + u8rowcumsuma(in1,size1[0],size1[1],out) : u8columncumsuma(in1,size1[0],size1[1],out) +#define i82g2cumsumi82(in1, size1, in2, size2, out) (in2[0]=='r') ? \ + i8rowcumsuma(in1,size1[0],size1[1],out) : i8columncumsuma(in1,size1[0],size1[1],out) +#define u162g2cumsumu162(in1, size1, in2, size2, out) (in2[0]=='r') ? \ + u16rowcumsuma(in1,size1[0],size1[1],out) : u16columncumsuma(in1,size1[0],size1[1],out) +#define i162g2cumsumi162(in1, size1, in2, size2, out) (in2[0]=='r') ? \ + i16rowcumsuma(in1,size1[0],size1[1],out) : i16columncumsuma(in1,size1[0],size1[1],out) + + + +#ifdef __cplusplus +#} /* extern "C" */ +#endif + +#endif /*__INT_CUMSUM_H__*/ diff --git a/2.3-1/src/c/matrixOperations/interfaces/int_tril.h b/2.3-1/src/c/matrixOperations/interfaces/int_tril.h new file mode 100644 index 00000000..d362aabf --- /dev/null +++ b/2.3-1/src/c/matrixOperations/interfaces/int_tril.h @@ -0,0 +1,62 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +#ifndef __INT_TRIL_H__ +#define __INT_TRIL_H__ + + +#ifdef __cplusplus +#extern "C" { +#endif + +#define d0trild0(in) in +#define s0trils0(in) in +#define u80trilu80(in) in +#define u160trilu160(in) in +#define i80trili80(in) in +#define i160trili160(in) in + +#define d0d0trild0(in1, in2) (in2 == 0 ? in1 : 0) +#define s0s0trils0(in1, in2) (in2 == 0 ? in1 : 0) +#define u80u80trilu80(in1, in2) (in2 == 0 ? in1 : 0) +#define i80i80trili80(in1, in2) (in2 == 0 ? in1 : 0) +#define u160u160trilu160(in1, in2) (in2 == 0 ? in1 : 0) +#define i160i160trili160(in1, in2) (in2 == 0 ? in1 : 0) +#define u80d0trilu80(in1, in2) (in2 == 0 ? in1 : 0) +#define i80d0trili80(in1, in2) (in2 == 0 ? in1 : 0) +#define u160d0trilu160(in1, in2) (in2 == 0 ? in1 : 0) +#define i160d0trili160(in1, in2) (in2 == 0 ? in1 : 0) + +#define d2trild2(in, size, out) dtrila(in, size[0], size[1], 0, out); +#define s2trils2(in, size, out) strila(in, size[0], size[1], 0, out); +#define u82trilu82(in, size, out) u8trila(in, size[0], size[1], 0, out); +#define u162trilu162(in, size, out) u16trila(in, size[0], size[1], 0, out); +#define i82trili82(in, size, out) i8trila(in, size[0], size[1], 0, out); +#define i162trili162(in, size, out) i16trila(in, size[0], size[1], 0, out); + +#define d2d0trild2(in1, size1, in2, out) dtrila(in1, size1[0], size1[1], in2, out); +#define s2s0trils2(in1, size1, in2, out) strila(in1, size1[0], size1[1], in2, out); +#define u82u80trilu82(in1, size1, in2, out) u8trila(in1, size1[0], size1[1], (double)in2, out); +#define i82i80trili82(in1, size1, in2, out) i8trila(in1, size1[0], size1[1], (double)in2, out); +#define u162u160trilu162(in1, size1, in2, out) u16trila(in1, size1[0], size1[1], (double)in2, out); +#define i162i160trili162(in1, size1, in2, out) i16trila(in1, size1[0], size1[1], (double)in2, out); +#define u82d0trilu82(in1, size1, in2, out) u8trila(in1, size1[0], size1[1], in2, out); +#define i82d0trili82(in1, size1, in2, out) i8trila(in1, size1[0], size1[1], in2, out); +#define u162d0trilu162(in1, size1, in2, out) u16trila(in1, size1[0], size1[1], in2, out); +#define i162d0trili162(in1, size1, in2, out) i16trila(in1, size1[0], size1[1], in2, out); + + +#ifdef __cplusplus +#} /* extern "C" */ +#endif + +#endif /*__INT_TRIL_H__*/ diff --git a/2.3-1/src/c/matrixOperations/interfaces/int_triu.h b/2.3-1/src/c/matrixOperations/interfaces/int_triu.h new file mode 100644 index 00000000..fd5448ec --- /dev/null +++ b/2.3-1/src/c/matrixOperations/interfaces/int_triu.h @@ -0,0 +1,62 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +#ifndef __INT_TRIU_H__ +#define __INT_TRIU_H__ + + +#ifdef __cplusplus +#extern "C" { +#endif + +#define d0triud0(in) in +#define s0trius0(in) in +#define u80triuu80(in) in +#define u160triuu160(in) in +#define i80triui80(in) in +#define i160triui160(in) in + +#define d0d0triud0(in1, in2) (in2 == 0 ? in1 : 0) +#define s0s0trius0(in1, in2) (in2 == 0 ? in1 : 0) +#define u80u80triuu80(in1, in2) (in2 == 0 ? in1 : 0) +#define i80i80triui80(in1, in2) (in2 == 0 ? in1 : 0) +#define u160u160triuu160(in1, in2) (in2 == 0 ? in1 : 0) +#define i160i160triui160(in1, in2) (in2 == 0 ? in1 : 0) +#define u80d0triuu80(in1, in2) (in2 == 0 ? in1 : 0) +#define i80d0triui80(in1, in2) (in2 == 0 ? in1 : 0) +#define u160d0triuu160(in1, in2) (in2 == 0 ? in1 : 0) +#define i160d0triui160(in1, in2) (in2 == 0 ? in1 : 0) + +#define d2triud2(in, size, out) dtriua(in, size[0], size[1], 0, out); +#define s2trius2(in, size, out) striua(in, size[0], size[1], 0, out); +#define u82triuu82(in, size, out) u8triua(in, size[0], size[1], 0, out); +#define u162triuu162(in, size, out) u16triua(in, size[0], size[1], 0, out); +#define i82triui82(in, size, out) i8triua(in, size[0], size[1], 0, out); +#define i162triui162(in, size, out) i16triua(in, size[0], size[1], 0, out); + +#define d2d0triud2(in1, size1, in2, out) dtriua(in1, size1[0], size1[1], in2, out); +#define s2s0trius2(in1, size1, in2, out) striua(in1, size1[0], size1[1], in2, out); +#define u82u80triuu82(in1, size1, in2, out) u8triua(in1, size1[0], size1[1], (double)in2, out); +#define i82i80triui82(in1, size1, in2, out) i8triua(in1, size1[0], size1[1], (double)in2, out); +#define u162u160triuu162(in1, size1, in2, out) u16triua(in1, size1[0], size1[1], (double)in2, out); +#define i162i160triui162(in1, size1, in2, out) i16triua(in1, size1[0], size1[1], (double)in2, out); +#define u82d0triuu82(in1, size1, in2, out) u8triua(in1, size1[0], size1[1], in2, out); +#define i82d0triui82(in1, size1, in2, out) i8triua(in1, size1[0], size1[1], in2, out); +#define u162d0triuu162(in1, size1, in2, out) u16triua(in1, size1[0], size1[1], in2, out); +#define i162d0triui162(in1, size1, in2, out) i16triua(in1, size1[0], size1[1], in2, out); + + +#ifdef __cplusplus +#} /* extern "C" */ +#endif + +#endif /*__INT_TRIU_H__*/ diff --git a/2.3-1/src/c/matrixOperations/tril/dtrila.c b/2.3-1/src/c/matrixOperations/tril/dtrila.c new file mode 100644 index 00000000..b727e5c8 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/tril/dtrila.c @@ -0,0 +1,33 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function to extract lower triagular entries from given matrix +#include "triu.h" + +void dtrila (double *in, int row, int column, double diag, double *out) +{ + int row_counter, col_counter = 0; + + for(row_counter=0; row_counter < row; row_counter++) + { + for(col_counter=0; col_counter < column; col_counter++) + { + if((double)(row_counter + diag) >= (double)col_counter) + { + out[col_counter*row+row_counter] = in[col_counter*row+row_counter]; + } + else + { + out[col_counter*row+row_counter] = 0; + } + } + } +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/tril/i16trila.c b/2.3-1/src/c/matrixOperations/tril/i16trila.c new file mode 100644 index 00000000..e17b361b --- /dev/null +++ b/2.3-1/src/c/matrixOperations/tril/i16trila.c @@ -0,0 +1,34 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function to extract lower triagular entries from given matrix + +#include "triu.h" + +void i16trila (int16 *in, int row, int column, double diag, int16 *out) +{ + int row_counter, col_counter = 0; + + for(row_counter=0; row_counter < row; row_counter++) + { + for(col_counter=0; col_counter < column; col_counter++) + { + if((double)(row_counter + diag) >= (double)col_counter) + { + out[col_counter*row+row_counter] = in[col_counter*row+row_counter]; + } + else + { + out[col_counter*row+row_counter] = 0; + } + } + } +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/tril/i8trila.c b/2.3-1/src/c/matrixOperations/tril/i8trila.c new file mode 100644 index 00000000..a91594a9 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/tril/i8trila.c @@ -0,0 +1,34 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function to extract lower triagular entries from given matrix + +#include "triu.h" + +void i8trila (int8 *in, int row, int column, double diag, int8 *out) +{ + int row_counter, col_counter = 0; + + for(row_counter=0; row_counter < row; row_counter++) + { + for(col_counter=0; col_counter < column; col_counter++) + { + if((double)(row_counter + diag) >= (double)col_counter) + { + out[col_counter*row+row_counter] = in[col_counter*row+row_counter]; + } + else + { + out[col_counter*row+row_counter] = 0; + } + } + } +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/tril/strila.c b/2.3-1/src/c/matrixOperations/tril/strila.c new file mode 100644 index 00000000..f5880894 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/tril/strila.c @@ -0,0 +1,34 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function to extract lower triagular entries from given matrix + +#include "triu.h" + +void strila (float *in, int row, int column, double diag, float *out) +{ + int row_counter, col_counter = 0; + + for(row_counter=0; row_counter < row; row_counter++) + { + for(col_counter=0; col_counter < column; col_counter++) + { + if((double)(row_counter + diag) >= (double)col_counter) + { + out[col_counter*row+row_counter] = in[col_counter*row+row_counter]; + } + else + { + out[col_counter*row+row_counter] = 0; + } + } + } +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/tril/u16trila.c b/2.3-1/src/c/matrixOperations/tril/u16trila.c new file mode 100644 index 00000000..d6974183 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/tril/u16trila.c @@ -0,0 +1,33 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function to extract lower triagular entries from given matrix +#include "triu.h" + +void u16trila (uint16 *in, int row, int column, double diag, uint16 *out) +{ + int row_counter, col_counter = 0; + + for(row_counter=0; row_counter < row; row_counter++) + { + for(col_counter=0; col_counter < column; col_counter++) + { + if((double)(row_counter + diag) >= (double)col_counter) + { + out[col_counter*row+row_counter] = in[col_counter*row+row_counter]; + } + else + { + out[col_counter*row+row_counter] = 0; + } + } + } +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/tril/u8trila.c b/2.3-1/src/c/matrixOperations/tril/u8trila.c new file mode 100644 index 00000000..ebc4d726 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/tril/u8trila.c @@ -0,0 +1,34 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function to extract lower triagular entries from given matrix + +#include "triu.h" + +void u8trila (uint8 *in, int row, int column, double diag, uint8 *out) +{ + int row_counter, col_counter = 0; + + for(row_counter=0; row_counter < row; row_counter++) + { + for(col_counter=0; col_counter < column; col_counter++) + { + if((double)(row_counter + diag) >= (double)col_counter) + { + out[col_counter*row+row_counter] = in[col_counter*row+row_counter]; + } + else + { + out[col_counter*row+row_counter] = 0; + } + } + } +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/triu/.fuse_hidden0000338200000001 b/2.3-1/src/c/matrixOperations/triu/.fuse_hidden0000338200000001 new file mode 100644 index 00000000..887b5b66 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/triu/.fuse_hidden0000338200000001 @@ -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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function to extract lower triagular entries from given matrix + +void dtriu (double *in, int row, int column, double *out) +{ + int row_counter, col_counter = 0; + + for(row_counter=0; row_counter< row; row_counter++) + { + for(col_counter=0; col_counter < column; col_counter++) + { + if(row_counter < col_counter) + { + out[col_counter*row+col_counter] = in[col_counter*row+col_counter]; + } + else + { + out[col_counter*row+col_counter] = 0; + } + } + } +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/triu/dtriua.c b/2.3-1/src/c/matrixOperations/triu/dtriua.c new file mode 100644 index 00000000..3a3cc0e5 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/triu/dtriua.c @@ -0,0 +1,33 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function to extract lower triagular entries from given matrix +#include "triu.h" + +void dtriua (double *in, int row, int column, double diag, double *out) +{ + int row_counter, col_counter = 0; + + for(row_counter=0; row_counter < row; row_counter++) + { + for(col_counter=0; col_counter < column; col_counter++) + { + if((double)(row_counter + diag) <= (double)col_counter) + { + out[col_counter*row+row_counter] = in[col_counter*row+row_counter]; + } + else + { + out[col_counter*row+row_counter] = 0; + } + } + } +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/triu/i16triua.c b/2.3-1/src/c/matrixOperations/triu/i16triua.c new file mode 100644 index 00000000..c4b397f5 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/triu/i16triua.c @@ -0,0 +1,34 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function to extract lower triagular entries from given matrix + +#include "triu.h" + +void i16triua (int16 *in, int row, int column, double diag, int16 *out) +{ + int row_counter, col_counter = 0; + + for(row_counter=0; row_counter < row; row_counter++) + { + for(col_counter=0; col_counter < column; col_counter++) + { + if((double)(row_counter + diag) <= (double)col_counter) + { + out[col_counter*row+row_counter] = in[col_counter*row+row_counter]; + } + else + { + out[col_counter*row+row_counter] = 0; + } + } + } +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/triu/i8triua.c b/2.3-1/src/c/matrixOperations/triu/i8triua.c new file mode 100644 index 00000000..6493ad17 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/triu/i8triua.c @@ -0,0 +1,34 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function to extract lower triagular entries from given matrix + +#include "triu.h" + +void i8triua (int8 *in, int row, int column, double diag, int8 *out) +{ + int row_counter, col_counter = 0; + + for(row_counter=0; row_counter < row; row_counter++) + { + for(col_counter=0; col_counter < column; col_counter++) + { + if((double)(row_counter + diag) <= (double)col_counter) + { + out[col_counter*row+row_counter] = in[col_counter*row+row_counter]; + } + else + { + out[col_counter*row+row_counter] = 0; + } + } + } +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/triu/striua.c b/2.3-1/src/c/matrixOperations/triu/striua.c new file mode 100644 index 00000000..95305efd --- /dev/null +++ b/2.3-1/src/c/matrixOperations/triu/striua.c @@ -0,0 +1,34 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function to extract lower triagular entries from given matrix + +#include "triu.h" + +void striua (float *in, int row, int column, double diag, float *out) +{ + int row_counter, col_counter = 0; + + for(row_counter=0; row_counter < row; row_counter++) + { + for(col_counter=0; col_counter < column; col_counter++) + { + if((double)(row_counter + diag) <= (double)col_counter) + { + out[col_counter*row+row_counter] = in[col_counter*row+row_counter]; + } + else + { + out[col_counter*row+row_counter] = 0; + } + } + } +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/triu/u16triua.c b/2.3-1/src/c/matrixOperations/triu/u16triua.c new file mode 100644 index 00000000..2786c041 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/triu/u16triua.c @@ -0,0 +1,33 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function to extract lower triagular entries from given matrix +#include "triu.h" + +void u16triua (uint16 *in, int row, int column, double diag, uint16 *out) +{ + int row_counter, col_counter = 0; + + for(row_counter=0; row_counter < row; row_counter++) + { + for(col_counter=0; col_counter < column; col_counter++) + { + if((double)(row_counter + diag) <= (double)col_counter) + { + out[col_counter*row+row_counter] = in[col_counter*row+row_counter]; + } + else + { + out[col_counter*row+row_counter] = 0; + } + } + } +}
\ No newline at end of file diff --git a/2.3-1/src/c/matrixOperations/triu/u8triua.c b/2.3-1/src/c/matrixOperations/triu/u8triua.c new file mode 100644 index 00000000..8ab3cb17 --- /dev/null +++ b/2.3-1/src/c/matrixOperations/triu/u8triua.c @@ -0,0 +1,34 @@ +// 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: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//Function to extract lower triagular entries from given matrix + +#include "triu.h" + +void u8triua (uint8 *in, int row, int column, double diag, uint8 *out) +{ + int row_counter, col_counter = 0; + + for(row_counter=0; row_counter < row; row_counter++) + { + for(col_counter=0; col_counter < column; col_counter++) + { + if((double)(row_counter + diag) <= (double)col_counter) + { + out[col_counter*row+row_counter] = in[col_counter*row+row_counter]; + } + else + { + out[col_counter*row+row_counter] = 0; + } + } + } +}
\ No newline at end of file diff --git a/2.3-1/src/c/scilab-arduino/includes/cmd_analog_in.h b/2.3-1/src/c/scilab-arduino/includes/cmd_analog_in.h index 5361fe80..1ab9f3ae 100644 --- a/2.3-1/src/c/scilab-arduino/includes/cmd_analog_in.h +++ b/2.3-1/src/c/scilab-arduino/includes/cmd_analog_in.h @@ -26,4 +26,4 @@ uint16 u8cmd_analog_ins(uint8 board_no, uint8 pin); } /* extern "C" */ #endif -#endif /* __CMD_DIGITAL_IN_H__ */ +#endif /* __CMD_ANALOG_IN_H__ */ |