summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--2.3-1/includes/sci2clib.h13
-rw-r--r--2.3-1/macros/ASTManagement/AST2Ccode.binbin31992 -> 31996 bytes
-rw-r--r--2.3-1/macros/ASTManagement/AST2Ccode.sci1
-rw-r--r--2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci5
-rw-r--r--2.3-1/macros/ASTManagement/libbin1680 -> 1676 bytes
-rw-r--r--2.3-1/macros/CCodeGeneration/libbin1184 -> 1180 bytes
-rw-r--r--2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.binbin16712 -> 16720 bytes
-rw-r--r--2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.sci2
-rw-r--r--2.3-1/macros/FunctionAnnotation/FA_SZ_1.binbin2604 -> 2608 bytes
-rw-r--r--2.3-1/macros/FunctionAnnotation/FA_SZ_1.sci1
-rw-r--r--2.3-1/macros/FunctionAnnotation/FA_SZ_2.binbin2612 -> 2616 bytes
-rw-r--r--2.3-1/macros/FunctionAnnotation/FA_SZ_2.sci1
-rw-r--r--2.3-1/macros/FunctionAnnotation/FA_SZ_COLUMN_DIAG.binbin0 -> 3116 bytes
-rw-r--r--2.3-1/macros/FunctionAnnotation/FA_SZ_COLUMN_DIAG.sci28
-rw-r--r--2.3-1/macros/FunctionAnnotation/FA_SZ_COLUMN_DIAG_INS_EXT.binbin0 -> 3364 bytes
-rw-r--r--2.3-1/macros/FunctionAnnotation/FA_SZ_COL_DIAG_IN_EX.binbin0 -> 5068 bytes
-rw-r--r--2.3-1/macros/FunctionAnnotation/FA_SZ_COL_DIAG_IN_EX.sci30
-rw-r--r--2.3-1/macros/FunctionAnnotation/FA_SZ_FROM_VAL.binbin3448 -> 3448 bytes
-rw-r--r--2.3-1/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci22
-rw-r--r--2.3-1/macros/FunctionAnnotation/FA_SZ_LINSPACE_ROW.sci4
-rw-r--r--2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN.binbin0 -> 10920 bytes
-rw-r--r--2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN.sci85
-rw-r--r--2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_DIAG.binbin0 -> 3164 bytes
-rw-r--r--2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_DIAG.sci26
-rw-r--r--2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_DIAG_INS_EXT.binbin0 -> 16296 bytes
-rw-r--r--2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_DIAG_INS_EXT.sci72
-rw-r--r--2.3-1/macros/FunctionList/libbin764 -> 760 bytes
-rw-r--r--2.3-1/macros/GeneralFunctions/SCI2COpenFileRead.binbin3424 -> 3424 bytes
-rw-r--r--2.3-1/macros/GeneralFunctions/SCI2COpenFileRead.sci2
-rw-r--r--2.3-1/macros/GeneralFunctions/libbin1308 -> 1304 bytes
-rw-r--r--2.3-1/macros/Scilab-Arduino/GetArduinoFunctions.binbin1832 -> 2100 bytes
-rw-r--r--2.3-1/macros/Scilab-Arduino/GetArduinoFunctions.sci15
-rw-r--r--2.3-1/macros/Scilab-Arduino/GetArduinoSetupFunctions.binbin1456 -> 1640 bytes
-rw-r--r--2.3-1/macros/Scilab-Arduino/GetArduinoSetupFunctions.sci4
-rw-r--r--2.3-1/macros/Scilab-Arduino/InsertSetupInList.binbin6068 -> 6320 bytes
-rw-r--r--2.3-1/macros/Scilab-Arduino/InsertSetupInList.sci118
-rw-r--r--2.3-1/macros/Scilab-Arduino/libbin772 -> 768 bytes
-rw-r--r--2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci117
-rw-r--r--2.3-1/macros/ToolInitialization/INIT_SCI2C.sci2
-rw-r--r--2.3-1/macros/ToolInitialization/SCI2CInputParameters.bkp87
-rw-r--r--2.3-1/macros/ToolInitialization/libbin980 -> 976 bytes
-rw-r--r--2.3-1/macros/findDeps/getAllHeaders.sci3
-rw-r--r--2.3-1/macros/findDeps/getAllInterfaces.sci3
-rw-r--r--2.3-1/macros/findDeps/getAllLibraries.sci1
-rw-r--r--2.3-1/macros/findDeps/getAllSources.sci34
-rw-r--r--2.3-1/macros/libbin712 -> 708 bytes
-rw-r--r--2.3-1/src/c/auxiliaryFunctions/rand/dranda.c2
-rw-r--r--2.3-1/src/c/auxiliaryFunctions/rand/drands.c43
-rw-r--r--2.3-1/src/c/elementaryFunctions/includes/linspace.h36
-rw-r--r--2.3-1/src/c/elementaryFunctions/includes/logspace.h24
-rw-r--r--2.3-1/src/c/elementaryFunctions/interfaces/int_linspace.h10
-rw-r--r--2.3-1/src/c/elementaryFunctions/interfaces/int_logspace.h10
-rw-r--r--2.3-1/src/c/elementaryFunctions/linspace/dlinspacea.c39
-rw-r--r--2.3-1/src/c/elementaryFunctions/linspace/dlinspacea.c~39
-rw-r--r--2.3-1/src/c/elementaryFunctions/linspace/dlinspaces.c25
-rw-r--r--2.3-1/src/c/elementaryFunctions/linspace/dlinspaces.c~25
-rw-r--r--2.3-1/src/c/elementaryFunctions/linspace/u8linspacea.c~39
-rw-r--r--2.3-1/src/c/elementaryFunctions/linspace/u8linspaces.c~25
-rw-r--r--2.3-1/src/c/elementaryFunctions/logspace/dlogspacea.c40
-rw-r--r--2.3-1/src/c/elementaryFunctions/logspace/dlogspaces.c26
-rw-r--r--2.3-1/src/c/matrixOperations/determ/i16determa.c92
-rw-r--r--2.3-1/src/c/matrixOperations/determ/i8determa.c92
-rw-r--r--2.3-1/src/c/matrixOperations/determ/u16determa.c92
-rw-r--r--2.3-1/src/c/matrixOperations/determ/u8determa.c92
-rw-r--r--2.3-1/src/c/matrixOperations/diag/ddiaga.c40
-rw-r--r--2.3-1/src/c/matrixOperations/diag/ddiagexa.c130
-rw-r--r--2.3-1/src/c/matrixOperations/diag/ddiagexs.c53
-rw-r--r--2.3-1/src/c/matrixOperations/diag/ddiagina.c59
-rw-r--r--2.3-1/src/c/matrixOperations/diag/ddiagins.c37
-rw-r--r--2.3-1/src/c/matrixOperations/diag/ddiags.c20
-rw-r--r--2.3-1/src/c/matrixOperations/diag/i16diaga.c40
-rw-r--r--2.3-1/src/c/matrixOperations/diag/i16diagexa.c130
-rw-r--r--2.3-1/src/c/matrixOperations/diag/i16diagexs.c53
-rw-r--r--2.3-1/src/c/matrixOperations/diag/i16diagina.c58
-rw-r--r--2.3-1/src/c/matrixOperations/diag/i16diagins.c37
-rw-r--r--2.3-1/src/c/matrixOperations/diag/i16diags.c20
-rw-r--r--2.3-1/src/c/matrixOperations/diag/i8diaga.c40
-rw-r--r--2.3-1/src/c/matrixOperations/diag/i8diagexa.c130
-rw-r--r--2.3-1/src/c/matrixOperations/diag/i8diagexs.c53
-rw-r--r--2.3-1/src/c/matrixOperations/diag/i8diagina.c58
-rw-r--r--2.3-1/src/c/matrixOperations/diag/i8diagins.c37
-rw-r--r--2.3-1/src/c/matrixOperations/diag/i8diags.c20
-rw-r--r--2.3-1/src/c/matrixOperations/diag/u16diaga.c40
-rw-r--r--2.3-1/src/c/matrixOperations/diag/u16diagexa.c130
-rw-r--r--2.3-1/src/c/matrixOperations/diag/u16diagexs.c53
-rw-r--r--2.3-1/src/c/matrixOperations/diag/u16diagina.c58
-rw-r--r--2.3-1/src/c/matrixOperations/diag/u16diagins.c37
-rw-r--r--2.3-1/src/c/matrixOperations/diag/u16diags.c20
-rw-r--r--2.3-1/src/c/matrixOperations/diag/u8diaga.c40
-rw-r--r--2.3-1/src/c/matrixOperations/diag/u8diagexa.c130
-rw-r--r--2.3-1/src/c/matrixOperations/diag/u8diagexs.c53
-rw-r--r--2.3-1/src/c/matrixOperations/diag/u8diagina.c58
-rw-r--r--2.3-1/src/c/matrixOperations/diag/u8diagins.c37
-rw-r--r--2.3-1/src/c/matrixOperations/diag/u8diags.c20
-rw-r--r--2.3-1/src/c/matrixOperations/division/i16ldivma.c111
-rw-r--r--2.3-1/src/c/matrixOperations/division/i16rdivma.c129
-rw-r--r--2.3-1/src/c/matrixOperations/division/i16rdivv.c24
-rw-r--r--2.3-1/src/c/matrixOperations/division/i8ldivma.c111
-rw-r--r--2.3-1/src/c/matrixOperations/division/i8rdivma.c129
-rw-r--r--2.3-1/src/c/matrixOperations/division/i8rdivv.c24
-rw-r--r--2.3-1/src/c/matrixOperations/division/u16ldivma.c111
-rw-r--r--2.3-1/src/c/matrixOperations/division/u16rdivma.c129
-rw-r--r--2.3-1/src/c/matrixOperations/division/u16rdivv.c24
-rw-r--r--2.3-1/src/c/matrixOperations/division/u8ldivma.c111
-rw-r--r--2.3-1/src/c/matrixOperations/division/u8rdivma.c129
-rw-r--r--2.3-1/src/c/matrixOperations/division/u8rdivv.c24
-rw-r--r--2.3-1/src/c/matrixOperations/includes/diag.h96
-rw-r--r--2.3-1/src/c/matrixOperations/interfaces/int_diag.h87
-rw-r--r--2.3-1/src/c/operations/interfaces/int_OpLogOr.h32
-rw-r--r--2.3-1/src/c/scilab-arduino/cmd_analog_in/u8cmd_analog_ins.c1
-rw-r--r--2.3-1/src/c/scilab-arduino/cmd_analog_out/u8cmd_analog_outs.c1
-rw-r--r--2.3-1/src/c/scilab-arduino/cmd_dcmotor_run/u8cmd_dcmotor_runs.c1
-rw-r--r--2.3-1/src/c/scilab-arduino/cmd_dcmotor_setup/u8cmd_dcmotor_setups.c3
-rw-r--r--2.3-1/src/c/scilab-arduino/cmd_digital_in/u8cmd_digital_ins.c1
-rw-r--r--2.3-1/src/c/scilab-arduino/cmd_servo_attach/u8cmd_servo_attach.cpp26
-rw-r--r--2.3-1/src/c/scilab-arduino/cmd_servo_detach/u8cmd_servo_detach.cpp24
-rw-r--r--2.3-1/src/c/scilab-arduino/cmd_servo_move/u8cmd_servo_move.cpp27
-rw-r--r--2.3-1/src/c/scilab-arduino/includes/cmd_analog_in.h1
-rw-r--r--2.3-1/src/c/scilab-arduino/includes/cmd_analog_out.h2
-rw-r--r--2.3-1/src/c/scilab-arduino/includes/cmd_dcmotor_run.h1
-rw-r--r--2.3-1/src/c/scilab-arduino/includes/cmd_dcmotor_setup.h1
-rw-r--r--2.3-1/src/c/scilab-arduino/includes/cmd_digital_in.h1
-rw-r--r--2.3-1/src/c/scilab-arduino/includes/cmd_digital_out.h1
-rw-r--r--2.3-1/src/c/scilab-arduino/includes/cmd_servo_attach.h23
-rw-r--r--2.3-1/src/c/scilab-arduino/includes/cmd_servo_detach.h24
-rw-r--r--2.3-1/src/c/scilab-arduino/includes/cmd_servo_move.h24
-rw-r--r--2.3-1/src/c/scilab-arduino/includes/sleep.h2
-rw-r--r--2.3-1/src/c/scilab-arduino/interfaces/int_cmd_analog_out.h3
-rw-r--r--2.3-1/src/c/scilab-arduino/interfaces/int_cmd_servo.h27
-rw-r--r--2.3-1/src/c/string/interfaces/int_string.h32
-rw-r--r--README.md22
131 files changed, 4421 insertions, 216 deletions
diff --git a/2.3-1/includes/sci2clib.h b/2.3-1/includes/sci2clib.h
index 5f019308..a13f1b4c 100644
--- a/2.3-1/includes/sci2clib.h
+++ b/2.3-1/includes/sci2clib.h
@@ -212,6 +212,15 @@
#include "int_bitget.h"
+/*interfacing linspace */
+#include "linspace.h"
+#include "int_linspace.h"
+
+/*interfacing logspace */
+#include "logspace.h"
+#include "int_logspace.h"
+
+
/* IMPLICIT LISTS */
/* interfacing implicitList/OpColon */
#include "implicitList.h"
@@ -296,6 +305,10 @@
#include "zeros.h"
#include "int_zeros.h"
+/* interfacing diag */
+#include "diag.h"
+#include "int_diag.h"
+
/* SIGNAL PROCESSING */
diff --git a/2.3-1/macros/ASTManagement/AST2Ccode.bin b/2.3-1/macros/ASTManagement/AST2Ccode.bin
index 8a4fc960..5f8c96b5 100644
--- a/2.3-1/macros/ASTManagement/AST2Ccode.bin
+++ b/2.3-1/macros/ASTManagement/AST2Ccode.bin
Binary files differ
diff --git a/2.3-1/macros/ASTManagement/AST2Ccode.sci b/2.3-1/macros/ASTManagement/AST2Ccode.sci
index 7c95572e..275aadf4 100644
--- a/2.3-1/macros/ASTManagement/AST2Ccode.sci
+++ b/2.3-1/macros/ASTManagement/AST2Ccode.sci
@@ -60,6 +60,7 @@ STACKDEDUG = 0; // 1 -> Every Pop and Push operation on the stack, the stack con
ASTFileName = FileInfo.Funct(nxtscifunnumber).ASTFileName;
+
// -----------------------
// --- Initialization. ---
// -----------------------
diff --git a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci
index 57f5f930..696846e2 100644
--- a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci
+++ b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci
@@ -209,7 +209,7 @@ global STACKDEDUG
if ((InArg(cntin).Dimension > 0))
// if ((InArg(cntin).Dimension > 0) & (InArg(cntin).Scope ~= 'Global'))
InArg(cntin).Size(1) = '__'+InArg(cntin).Name+'Size[0]';
- InArg(cntin).Size(2) = '__'+InArg(cntin).Name+'Size[1]';
+ InArg(cntin).Size(2) = '__'+InArg(cntin).Name+'Size[1]';s
end
//#RNUREM_MERNU vedi se la seguente fa casino l'ho aggiunta in modo che agia=ones(1,3) sia generata come realloc ma non ho verificato.
tmpscope = InArg(cntin).Scope;
@@ -356,7 +356,8 @@ global STACKDEDUG
//#RNU_RES_E
CFunName = C_GenerateFunName(ASTFunName,InArg,NInArg,OutArg,NOutArg);
- //#RNU_RES_B
+
+ //#RNU_RES_B
PrintStringInfo(' C Function Name: '+CFunName,ReportFileName,'file','y');
if(IsArduinoFunction(ASTFunName))
if(IsArduinoSetupFunction(ASTFunName))
diff --git a/2.3-1/macros/ASTManagement/lib b/2.3-1/macros/ASTManagement/lib
index 36d91dec..06ca43d1 100644
--- a/2.3-1/macros/ASTManagement/lib
+++ b/2.3-1/macros/ASTManagement/lib
Binary files differ
diff --git a/2.3-1/macros/CCodeGeneration/lib b/2.3-1/macros/CCodeGeneration/lib
index 9007df7e..f91bc268 100644
--- a/2.3-1/macros/CCodeGeneration/lib
+++ b/2.3-1/macros/CCodeGeneration/lib
Binary files differ
diff --git a/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.bin b/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.bin
index 1deaff60..39d97b24 100644
--- a/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.bin
+++ b/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.bin
Binary files differ
diff --git a/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.sci b/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.sci
index 84640dfc..37e6d091 100644
--- a/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.sci
+++ b/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.sci
@@ -27,6 +27,8 @@ SCI2CNInArgCheck(argn(2),9,9);
// -----------------------
// --- Initialization. ---
// -----------------------
+
+
UpdatedOutArg = OutArg;
for cntin = 1:NInArg
IN(cntin).TP = InArg(cntin).Type;
diff --git a/2.3-1/macros/FunctionAnnotation/FA_SZ_1.bin b/2.3-1/macros/FunctionAnnotation/FA_SZ_1.bin
index 91cd951d..c01ff59d 100644
--- a/2.3-1/macros/FunctionAnnotation/FA_SZ_1.bin
+++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_1.bin
Binary files differ
diff --git a/2.3-1/macros/FunctionAnnotation/FA_SZ_1.sci b/2.3-1/macros/FunctionAnnotation/FA_SZ_1.sci
index d9a481ce..3d20b992 100644
--- a/2.3-1/macros/FunctionAnnotation/FA_SZ_1.sci
+++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_1.sci
@@ -17,4 +17,5 @@ function outsize = FA_SZ_1(insize)
// -----------------------------------------------------------------
outsize = insize(1);
+
endfunction
diff --git a/2.3-1/macros/FunctionAnnotation/FA_SZ_2.bin b/2.3-1/macros/FunctionAnnotation/FA_SZ_2.bin
index 099f1d66..00834df4 100644
--- a/2.3-1/macros/FunctionAnnotation/FA_SZ_2.bin
+++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_2.bin
Binary files differ
diff --git a/2.3-1/macros/FunctionAnnotation/FA_SZ_2.sci b/2.3-1/macros/FunctionAnnotation/FA_SZ_2.sci
index 64fdac10..164cab3f 100644
--- a/2.3-1/macros/FunctionAnnotation/FA_SZ_2.sci
+++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_2.sci
@@ -17,4 +17,5 @@ function outsize = FA_SZ_2(insize)
// -----------------------------------------------------------------
outsize = insize(2);
+
endfunction
diff --git a/2.3-1/macros/FunctionAnnotation/FA_SZ_COLUMN_DIAG.bin b/2.3-1/macros/FunctionAnnotation/FA_SZ_COLUMN_DIAG.bin
new file mode 100644
index 00000000..68d6a37c
--- /dev/null
+++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_COLUMN_DIAG.bin
Binary files differ
diff --git a/2.3-1/macros/FunctionAnnotation/FA_SZ_COLUMN_DIAG.sci b/2.3-1/macros/FunctionAnnotation/FA_SZ_COLUMN_DIAG.sci
new file mode 100644
index 00000000..df129f97
--- /dev/null
+++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_COLUMN_DIAG.sci
@@ -0,0 +1,28 @@
+function outsize = FA_SZ_COLUMN_DIAG(insize)
+ // function outsize = FA_SZ_1(insize)
+ // -----------------------------------------------------------------
+ // Returns the first element of the size array.
+ //
+ // Input data:
+ // insize: size of input argument. It is an array of 2 strings.
+ // The first string specifies the number of rows.
+ // The second string specifies the number of columns.
+ //
+ // Output data:
+ // outsize: first element of the insize array.
+ //
+ // Status:
+ // 08-Dec-2007 -- Raffaele Nutricato: Author.
+ // 08-Dec-2007 -- Alberto Morea: Test Ok.
+ // -----------------------------------------------------------------
+
+ if(insize(2)=='1') then
+ outsize = insize(1);
+
+ elseif(insize(1) == insize(2))
+ outsize = '1';
+ else
+ outsize = insize(2);
+
+ end
+endfunction
diff --git a/2.3-1/macros/FunctionAnnotation/FA_SZ_COLUMN_DIAG_INS_EXT.bin b/2.3-1/macros/FunctionAnnotation/FA_SZ_COLUMN_DIAG_INS_EXT.bin
new file mode 100644
index 00000000..6d883096
--- /dev/null
+++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_COLUMN_DIAG_INS_EXT.bin
Binary files differ
diff --git a/2.3-1/macros/FunctionAnnotation/FA_SZ_COL_DIAG_IN_EX.bin b/2.3-1/macros/FunctionAnnotation/FA_SZ_COL_DIAG_IN_EX.bin
new file mode 100644
index 00000000..e39a0be3
--- /dev/null
+++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_COL_DIAG_IN_EX.bin
Binary files differ
diff --git a/2.3-1/macros/FunctionAnnotation/FA_SZ_COL_DIAG_IN_EX.sci b/2.3-1/macros/FunctionAnnotation/FA_SZ_COL_DIAG_IN_EX.sci
new file mode 100644
index 00000000..45d74c3a
--- /dev/null
+++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_COL_DIAG_IN_EX.sci
@@ -0,0 +1,30 @@
+function outsize =FA_SZ_COL_DIAG_IN_EX(insize,val)
+
+///////////////////////////////COLUMN SIZE FOR INSERT POSITION//////////////////
+
+
+
+ if((insize(1) == '1')) // If ROW size is 1
+ if(val == '0') then //For Oth position
+ outsize = insize(2); //COLUMN size is equal to COLUMN size
+ else // For ...-2,-1,1,2... position
+ outsize = string(eval(insize(2))+abs(eval(val)));// COLUMN size is equal to COLUMN size + absolute value of position(for 1*3 matrix and 2nd postion COLUMN size is (3+2)=5
+ end
+ elseif((insize(2) == '1')) // If COLUMN size is 1
+ if(val == '0') then //For Oth position
+ outsize = insize(1); //COLUMNS size is equal to ROW size
+ else // For ...-2,-1,1,2.... position
+ outsize = string(eval(insize(1))+abs(eval(val)));// COLUMN size is equal to ROW size + absolute value of position(for 3*1 matrix and 1st postion COLUMN size is (3+1)=4
+ end
+////////////////////////////////////////////////////////////////////////////////
+
+
+////////////////////////////COLUMN SIZE FOR EXTRACT POSITION////////////////////
+
+ else
+ outsize = '1'; // For extract condition COLUMN size is always ONE.
+ end
+
+////////////////////////////////////////////////////////////////////////////////
+
+endfunction
diff --git a/2.3-1/macros/FunctionAnnotation/FA_SZ_FROM_VAL.bin b/2.3-1/macros/FunctionAnnotation/FA_SZ_FROM_VAL.bin
index 9a39d12a..a06f3b16 100644
--- a/2.3-1/macros/FunctionAnnotation/FA_SZ_FROM_VAL.bin
+++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_FROM_VAL.bin
Binary files differ
diff --git a/2.3-1/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci b/2.3-1/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci
index c3cae536..bb02b985 100644
--- a/2.3-1/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci
+++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci
@@ -15,20 +15,20 @@ SCI2CNInArgCheck(argn(2),2,2);
if (isnum(in1))
- in1num = eval(in1) ;
- if isnan(in1num)
- opout = '__SCI2CNANSIZE';
- elseif ( in1num < 0 )
- opout= '0' ;
- else
- opout = string ( floor (abs(in1num))) ;
-
- end
+ in1num = eval(in1) ;
+ if isnan(in1num)
+ opout = '__SCI2CNANSIZE';
+ elseif ( in1num < 0 )
+ opout= '0' ;
+ else
+ opout = string ( floor (abs(in1num))) ;
+ end
else
- opout = in2+"0floor"+in2+"0"+"("+in1+")";
- opout = in2+"0abs"+in2+"0"+"("+opout+")";
+ opout = in2+"0floor"+in2+"0"+"("+in1+")";
+ opout = in2+"0abs"+in2+"0"+"("+opout+")";
+
end
diff --git a/2.3-1/macros/FunctionAnnotation/FA_SZ_LINSPACE_ROW.sci b/2.3-1/macros/FunctionAnnotation/FA_SZ_LINSPACE_ROW.sci
new file mode 100644
index 00000000..986b5291
--- /dev/null
+++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_LINSPACE_ROW.sci
@@ -0,0 +1,4 @@
+function outsize = FA_SZ_LINSPACE_ROW(insize)
+ in1num = string(eval(insize(1)));
+ outsize = in1num;
+endfunction:
diff --git a/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN.bin b/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN.bin
new file mode 100644
index 00000000..edba674a
--- /dev/null
+++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN.bin
Binary files differ
diff --git a/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN.sci b/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN.sci
new file mode 100644
index 00000000..ca1d2627
--- /dev/null
+++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN.sci
@@ -0,0 +1,85 @@
+function opoutsize = FA_SZ_ROW_COLUMN(in1size,in2size)
+// function opoutsize = FA_SZ_OPPLUSA(in1size,in2size)
+// -----------------------------------------------------------------
+// Returns the size of the output computed by OPPLUS operator
+// restricted to arithmetic operations (string operations not supported.)
+//
+// Assuming:
+// size(in1) = [in1r,in1c]
+// size(in2) = [in2r,in2c]
+// size(out) = [outr,outc]
+//
+// we have the following combinations:
+// in1 in2 outr outc
+// -----------------------
+// S S in2r in2c
+// S M in2r in2c
+// M S in1r in1c
+// M M in1r in1c
+//
+// Where S means that the input is a scalar
+// and M means that the input is a matrix.
+// There is also the case related to the string catenation!
+// This is the main difference between - and + operators.
+//
+// Input data:
+// in1size: size of input number 1. It is an array of 2 strings.
+// The first string specifies the number of rows.
+// The second string specifies the number of columns.
+//
+// in2size: size of input number 2. It is an array of 2 strings.
+// The first string specifies the number of rows.
+// The second string specifies the number of columns.
+//
+// Output data:
+// opoutsize: size of output. It is an array of 2 strings.
+// The first string specifies the number of rows.
+// The second string specifies the number of columns.
+//
+// Status:
+// 18-Mar-2008 -- Raffaele Nutricato: Author.
+// 18-Mar-2008 -- Alberto Morea: Test Ok.
+//
+// Copyright 2008 Raffaele Nutricato & Alberto Morea.
+// Contact: raffaele.nutricato@tiscali.it
+// -----------------------------------------------------------------
+
+// ------------------------------
+// --- Check input arguments. ---
+// ------------------------------
+SCI2CNInArgCheck(argn(2),2,2);
+
+// ------------------------
+// --- Generate Output. ---
+// ------------------------
+// --- Get dimensions of input arguments. ---
+in1size = string(in1size);
+in2size = string(in2size);
+in1type = string(in1type);
+in2type = string(in2type);
+in1dim = GetSymbolDimension(in1size);
+in2dim = GetSymbolDimension(in2size);
+if (isnum(in2size(2))) then
+ if(in2size(2) == '3') then
+ in1num_c = eval(in1size(2));
+ in1num_r = eval(in2size(1));
+ opoutsize(1) = string(in1num_r);
+ opoutsize(2) = string(in1num_c);
+ else
+
+ in2num_r = eval(in1size(1));
+ in2num_c = eval(in2size(1));
+ opoutsize(1) = string(in2num_r);
+ opoutsize(2) = string(in2num_c);
+ end
+else
+ if(in2size(2) == 3)
+ opoutsize(2) = '('+string(in1size(2))+')';
+
+ else
+ opoutsize(1) = '('+string(in1size(1))+')';
+
+ end
+end
+
+endfunction
diff --git a/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_DIAG.bin b/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_DIAG.bin
new file mode 100644
index 00000000..7fc7dcc8
--- /dev/null
+++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_DIAG.bin
Binary files differ
diff --git a/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_DIAG.sci b/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_DIAG.sci
new file mode 100644
index 00000000..687a89e4
--- /dev/null
+++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_DIAG.sci
@@ -0,0 +1,26 @@
+function outsize = FA_SZ_ROW_DIAG(insize)
+// function outsize = FA_SZ_1(insize)
+// -----------------------------------------------------------------
+// Returns the first element of the size array.
+//
+// Input data:
+// insize: size of input argument. It is an array of 2 strings.
+// The first string specifies the number of rows.
+// The second string specifies the number of columns.
+//
+// Output data:
+// outsize: first element of the insize array.
+//
+// Status:
+// 08-Dec-2007 -- Raffaele Nutricato: Author.
+// 08-Dec-2007 -- Alberto Morea: Test Ok.
+// -----------------------------------------------------------------
+
+if(insize(1)=='1') then
+ outsize = insize(2);
+elseif(insize(1) == insize(2))
+ outsize = insize(1);
+else
+ outsize = insize(1);
+end
+endfunction
diff --git a/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_DIAG_INS_EXT.bin b/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_DIAG_INS_EXT.bin
new file mode 100644
index 00000000..046b4b78
--- /dev/null
+++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_DIAG_INS_EXT.bin
Binary files differ
diff --git a/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_DIAG_INS_EXT.sci b/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_DIAG_INS_EXT.sci
new file mode 100644
index 00000000..1ec720a9
--- /dev/null
+++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_DIAG_INS_EXT.sci
@@ -0,0 +1,72 @@
+function outsize = FA_SZ_ROW_DIAG_INS_EXT(insize,val)
+
+ // val ==> Position value ...,-2,-1,0,1,2....
+ //insize ==> insize(1) will give ROW size and insize(2) will give COLUMN size.
+ insize = string(insize);
+ row_num = eval(insize(1));
+ col_num = eval(insize(2));
+ val_num = eval(val);
+ /////////////////////////////////////////////// FOR INSERT CONDITION ////////////////////////////////////////////
+
+
+
+ if(row_num == 1)
+ if(val_num == 0) then // For 0th position
+ outsize = string(col_num);// ROW size is equal to COLUMN size
+
+ else // For ....-2,-1,1,2... positions
+ outsize = string(col_num+abs(val_num)); //ROW is equal to COLUMN SIZE + position value (i.e for 1*4 matrix and insert position 1 then ROW size is 4+1 = 5 )
+
+ end
+ elseif(col_num == 1) // if Column size is one
+ if(val_num == 0) then // For Oth position
+ outsize = string(row_num); // ROW size is equal to ROW size
+
+ else // ....-2,-1,1,2... positions.
+ outsize = string(row_num + abs(val_num));//ROW is equal to ROW SIZE + position value (i.e for 4*1 matrix and insert position 1 then ROW size is 4+1 = 5 )
+
+ end
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+
+ ///////////////////////////////////////// FOR EXTRACT CONDITION /////////////////////////////////////////////////
+
+ elseif(row_num == col_num) // For no. of rows equal to no. of column (R == C)
+ if(val_num == 0) then //For 0th position
+ outsize = string(col_num); // No. of row is equal to column size
+ else //For ....-2,-1,1,2... Positions
+ outsize = string(col_num-abs(val_num)); //row value is equal to subtraction of column size and absolute value of position (i.e +ve and -ve both position values)
+ end
+ elseif(row_num > col_num) // for no. of rows greater than no. of column (R > C)
+ if(val_num == 0) then // if 0th position
+ outsize = string(col_num); // No. of row is equal to column size
+ elseif(val_num > 0) then // For +ve positions i.e 1,2,3.....
+ outsize = string(col_num-abs(val_num)); // No. of row is equal to subtraction of column size and absolute value of +ve postion
+
+ elseif(val_num < 0 ) then // For -ve positions i.e -1,-2,-3
+ temp_outsize1 = row_num-abs(val_num); //In this row values are varying for 4*3 matrix there is no repetition of same row values,for 5*3 matrix there is (5-3 = 2) two same row size(i.e 3 and 3) for -1,-2 position and for 6*3 matrix there is (6-3 = 3) three same row size(i.e 3 ,3,3) for -1,-2,-3 position
+ if(temp_outsize1 >= col_num) // if temp_outsize1 is greater than equal to column size then
+ outsize = string(col_num); // row size is equal to column
+ else
+ outsize = string(row_num-abs(val_num)); // else row size is substractio of row and abosulte value of position(i.e -1,-2,-3)
+ end
+ end
+ elseif(row_num < col_num) // for no. of rows less than no. of column size
+ if(val_num == 0) then // if 0th position
+ outsize = string(row_num); // No. of row is equal to row size
+ elseif(val_num > 0) then // for +ve positions i.e 1,2 3.....
+ temp_outsize2 = col_num-abs(val_num);// In this column values are varying for 3*4 matrix there is no repetition of same row values,for 3*5 matrix there is (5-3 =2) two same row size (i.e 3, 3 ) for 1 ,2 position and for 3*6 matrix there is (6-3 = 3) three row size (i.e 3 ,3 ,3) for 1,2 3 position
+ if(temp_outsize2 >= row_num) // if temp_outsize2 is greater than equal to row size then
+ outsize = string(row_num); // row size is equal to row size
+ else
+ outsize = string(col_num-abs(val_num)); // else row size substractio of column and absolute value
+ end
+ elseif(val_num < 0) then // for -ve positions i.e -1,-2,-3 .. positions
+ outsize = string(row_num-abs(val_num)); // row size is substraction of row size and absolute value of position values(-1,-2,-3)
+ end
+
+ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ end
+
+endfunction
diff --git a/2.3-1/macros/FunctionList/lib b/2.3-1/macros/FunctionList/lib
index 32c92be8..74542a2a 100644
--- a/2.3-1/macros/FunctionList/lib
+++ b/2.3-1/macros/FunctionList/lib
Binary files differ
diff --git a/2.3-1/macros/GeneralFunctions/SCI2COpenFileRead.bin b/2.3-1/macros/GeneralFunctions/SCI2COpenFileRead.bin
index 7d5f101b..f3f6a5e3 100644
--- a/2.3-1/macros/GeneralFunctions/SCI2COpenFileRead.bin
+++ b/2.3-1/macros/GeneralFunctions/SCI2COpenFileRead.bin
Binary files differ
diff --git a/2.3-1/macros/GeneralFunctions/SCI2COpenFileRead.sci b/2.3-1/macros/GeneralFunctions/SCI2COpenFileRead.sci
index 1ad60ce5..8e54738c 100644
--- a/2.3-1/macros/GeneralFunctions/SCI2COpenFileRead.sci
+++ b/2.3-1/macros/GeneralFunctions/SCI2COpenFileRead.sci
@@ -24,7 +24,7 @@ SCI2CNInArgCheck(argn(2),1,1);
// --- Open the .sci file (read only). ---
[fidnumber,fiderror] = mopen(filename,'r');
if (fiderror < 0)
- SCI2Cerror(['Cannot open (in read mode): '+filename]);
+ error(['Cannot open (in read mode): '+filename]);
end
endfunction
diff --git a/2.3-1/macros/GeneralFunctions/lib b/2.3-1/macros/GeneralFunctions/lib
index a3af87e6..8367688a 100644
--- a/2.3-1/macros/GeneralFunctions/lib
+++ b/2.3-1/macros/GeneralFunctions/lib
Binary files differ
diff --git a/2.3-1/macros/Scilab-Arduino/GetArduinoFunctions.bin b/2.3-1/macros/Scilab-Arduino/GetArduinoFunctions.bin
index 82b0d456..fe9e2040 100644
--- a/2.3-1/macros/Scilab-Arduino/GetArduinoFunctions.bin
+++ b/2.3-1/macros/Scilab-Arduino/GetArduinoFunctions.bin
Binary files differ
diff --git a/2.3-1/macros/Scilab-Arduino/GetArduinoFunctions.sci b/2.3-1/macros/Scilab-Arduino/GetArduinoFunctions.sci
index 19d59ca4..1af351b6 100644
--- a/2.3-1/macros/Scilab-Arduino/GetArduinoFunctions.sci
+++ b/2.3-1/macros/Scilab-Arduino/GetArduinoFunctions.sci
@@ -12,11 +12,14 @@ function ArduinoFunctions = GetArduinoFunctions()
// -----------------------------------------------------------------
ArduinoFunctions = [
- "cmd_digital_out"
- "cmd_digital_in"
- "cmd_analog_out"
- "cmd_analog_in"
- "cmd_dcmotor_setup"
- "cmd_dcmotor_run"];
+ "cmd_digital_out"
+ "cmd_digital_in"
+ "cmd_analog_out"
+ "cmd_analog_in"
+ "cmd_dcmotor_setup"
+ "cmd_dcmotor_run"
+ "cmd_servo_attach"
+ "cmd_servo_detach"
+ "cmd_servo_move"];
endfunction
diff --git a/2.3-1/macros/Scilab-Arduino/GetArduinoSetupFunctions.bin b/2.3-1/macros/Scilab-Arduino/GetArduinoSetupFunctions.bin
index 048da7d7..67f9fada 100644
--- a/2.3-1/macros/Scilab-Arduino/GetArduinoSetupFunctions.bin
+++ b/2.3-1/macros/Scilab-Arduino/GetArduinoSetupFunctions.bin
Binary files differ
diff --git a/2.3-1/macros/Scilab-Arduino/GetArduinoSetupFunctions.sci b/2.3-1/macros/Scilab-Arduino/GetArduinoSetupFunctions.sci
index f377d385..c992057b 100644
--- a/2.3-1/macros/Scilab-Arduino/GetArduinoSetupFunctions.sci
+++ b/2.3-1/macros/Scilab-Arduino/GetArduinoSetupFunctions.sci
@@ -12,6 +12,8 @@ function ArduinoSetupFunctions = GetArduinoSetupFunctions()
// -----------------------------------------------------------------
ArduinoSetupFunctions = [
- "cmd_dcmotor_setup"];
+ "cmd_dcmotor_setup"
+ "cmd_servo_attach"
+ "cmd_servo_detach"];
endfunction
diff --git a/2.3-1/macros/Scilab-Arduino/InsertSetupInList.bin b/2.3-1/macros/Scilab-Arduino/InsertSetupInList.bin
index 41c1a3fe..44e688c6 100644
--- a/2.3-1/macros/Scilab-Arduino/InsertSetupInList.bin
+++ b/2.3-1/macros/Scilab-Arduino/InsertSetupInList.bin
Binary files differ
diff --git a/2.3-1/macros/Scilab-Arduino/InsertSetupInList.sci b/2.3-1/macros/Scilab-Arduino/InsertSetupInList.sci
index 5c6be8bb..b73910f2 100644
--- a/2.3-1/macros/Scilab-Arduino/InsertSetupInList.sci
+++ b/2.3-1/macros/Scilab-Arduino/InsertSetupInList.sci
@@ -1,58 +1,66 @@
function InsertSetupInList(FunName,InArg,NInArg,SetupListFile,FunType)
-load(SetupListFile,'SetupList');
-
-//Check first if current input function already exists in the list
-nelements = size(SetupList);
-found=%F;
-
-if(FunType=='Setup')
- for i=1:nelements
- if(SetupList(i)(1) == FunName)
- for j=1:NInArg
- if(SetupList(i)(j+1) ~= InArg(j).Name)
- found = %F
- break;
- else
- found = %T;
- end
- end
- end
- if (found == %T)
- break; //One match found. No need to check further.
- end
- end
-
- if(found == %F)
- temp = list(FunName);
- for i=1:NInArg
- temp($+1) = InArg(i).Name;
- end
- end
- SetupList($+1) = temp;
-elseif((FunType=='Init')&((FunName=='cmd_digital_out')|(FunName=='cmd_analog_out')|(FunName=='cmd_digital_in')))
- for i=1:nelements
- if(SetupList(i)(1) == FunName)
- if(SetupList(i)(2) == InArg(2).Name)
- found = %T
- break;
- else
- found = %F;
- end
- end
- end
-
- if(found == %F)
- temp = list('pinMode');
- temp($+1) = InArg(2).Name;
- if ((FunName=='cmd_digital_out')|(FunName=='cmd_analog_out'))
- temp($+1) = 'OUTPUT';
- elseif (FunName == 'cmd_digital_in')
- temp($+1) = 'INPUT';
- end
- end
- SetupList($+1) = temp;
-end
-
-save(SetupListFile,'SetupList');
+ load(SetupListFile,'SetupList');
+
+ //Check first if current input function already exists in the list
+ nelements = size(SetupList);
+
+ found=%F;
+ if(FunType=='Setup')
+ for i=1:nelements
+ if(SetupList(i)(1) == FunName)
+ for j=1:NInArg
+ if(SetupList(i)(j+1) ~= InArg(j).Name)
+ found = %F
+ break;
+ else
+ found = %T;
+ end
+ end
+ end
+ if (found == %T)
+ break; //One match found. No need to check further.
+ end
+ end
+
+ if(found == %F)
+ temp = list(FunName);
+ for i=1:NInArg
+ temp($+1) = InArg(i).Name;
+ end
+ end
+ SetupList($+1) = temp;
+ elseif((FunType=='Init')&((FunName=='cmd_digital_out')|(FunName=='cmd_analog_out')|(FunName=='cmd_digital_in')))
+ for i=1:nelements
+ if(SetupList(i)(1) == "pinMode")
+ if(SetupList(i)(2) == InArg(2).Name)
+ found = %T
+ break;
+ else
+ found = %F;
+ end
+ else
+
+ found = %F;
+
+ end
+
+ end
+
+ if(found == %F)
+ temp = list('pinMode');
+ temp($+1) = InArg(2).Name;
+ if ((FunName=='cmd_digital_out')|(FunName=='cmd_analog_out'))
+ temp($+1) = 'OUTPUT';
+ elseif ((FunName == 'cmd_digital_in') | (FunName=='cmd_analog_in'))
+ temp($+1) = 'INPUT';
+ end
+ SetupList($+1) = temp;
+
+ end
+
+
+ end
+ save(SetupListFile,'SetupList');
+
endfunction
diff --git a/2.3-1/macros/Scilab-Arduino/lib b/2.3-1/macros/Scilab-Arduino/lib
index bd0cb707..824ce45a 100644
--- a/2.3-1/macros/Scilab-Arduino/lib
+++ b/2.3-1/macros/Scilab-Arduino/lib
Binary files differ
diff --git a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
index f95f39c4..3fd2ae76 100644
--- a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
+++ b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
@@ -1009,6 +1009,110 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,Ex
+// --------------------
+// --- Class Diag. ---
+// --------------------
+ClassName = 'diag';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= FA_SZ_ROW_DIAG(IN(1).SZ)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= FA_SZ_COLUMN_DIAG(IN(1).SZ)',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)= FA_SZ_ROW_DIAG_INS_EXT(IN(1).SZ,IN(2).VAL)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= FA_SZ_COL_DIAG_IN_EX(IN(1).SZ,IN(2).VAL)',ClassFileName,'file','y');
+
+// ---Function List Class.----
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+
+PrintStringInfo('d0'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('d0d0'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('d0d0'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('d2'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('d2d0'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('d2d0'+ArgSeparator+'d0',ClassFileName,'file','y');
+PrintStringInfo('u80'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('u80d0'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('u80d0'+ArgSeparator+'u82',ClassFileName,'file','y');
+PrintStringInfo('u82'+ArgSeparator+'u82',ClassFileName,'file','y');
+PrintStringInfo('u82d0'+ArgSeparator+'u82',ClassFileName,'file','y');
+PrintStringInfo('u82d0'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('u160'+ArgSeparator+'u160',ClassFileName,'file','y');
+PrintStringInfo('u160d0'+ArgSeparator+'u160',ClassFileName,'file','y');
+PrintStringInfo('u160d0'+ArgSeparator+'u162',ClassFileName,'file','y');
+PrintStringInfo('u162'+ArgSeparator+'u162',ClassFileName,'file','y');
+PrintStringInfo('u162d0'+ArgSeparator+'u162',ClassFileName,'file','y');
+PrintStringInfo('u162d0'+ArgSeparator+'u160',ClassFileName,'file','y');
+PrintStringInfo('i80'+ArgSeparator+'i80',ClassFileName,'file','y');
+PrintStringInfo('i80d0'+ArgSeparator+'i80',ClassFileName,'file','y');
+PrintStringInfo('i80d0'+ArgSeparator+'i82',ClassFileName,'file','y');
+PrintStringInfo('i82'+ArgSeparator+'i82',ClassFileName,'file','y');
+PrintStringInfo('i82d0'+ArgSeparator+'i82',ClassFileName,'file','y');
+PrintStringInfo('i82d0'+ArgSeparator+'i80',ClassFileName,'file','y');
+PrintStringInfo('i160'+ArgSeparator+'i160',ClassFileName,'file','y');
+PrintStringInfo('i160d0'+ArgSeparator+'i160',ClassFileName,'file','y');
+PrintStringInfo('i160d0'+ArgSeparator+'i162',ClassFileName,'file','y');
+PrintStringInfo('i162'+ArgSeparator+'i162',ClassFileName,'file','y');
+PrintStringInfo('i162d0'+ArgSeparator+'i162',ClassFileName,'file','y');
+PrintStringInfo('i162d0'+ArgSeparator+'i160',ClassFileName,'file','y');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'diag'; // BJ : Done AS : Float_Done
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+// --------------------
+// --- Class linspace & logspace ---
+// --------------------
+ClassName = 'linspace';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 3',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+
+PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
+//PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= FA_SZ_LINSPACE_ROW(IN(1).SZ)',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= IN(3).VAL',ClassFileName,'file','y');
+
+
+// ---Function List Class.----
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+
+
+PrintStringInfo('d0d0d0'+ArgSeparator+'d2',ClassFileName,'file','y');
+PrintStringInfo('d2d2d0'+ArgSeparator+'d2',ClassFileName,'file','y');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'linspace'; // BJ : Done AS : Float_Done
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+FunctionName = 'logspace'; // BJ : Done AS : Float_Done
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
//---------------------
//-----Class Rand.------
//---------------------
@@ -1160,6 +1264,7 @@ PrintStringInfo('s2g2'+ArgSeparator+'s2',ClassFileName,'file','y');
PrintStringInfo('d2g2'+ArgSeparator+'d2',ClassFileName,'file','y');
PrintStringInfo('c2g2'+ArgSeparator+'c2',ClassFileName,'file','y');
PrintStringInfo('z2g2'+ArgSeparator+'z2',ClassFileName,'file','y');
+
PrintStringInfo('u80g2'+ArgSeparator+'u80',ClassFileName,'file','y');
PrintStringInfo('u82g2'+ArgSeparator+'u80',ClassFileName,'file','y');
PrintStringInfo('u82g2'+ArgSeparator+'u82',ClassFileName,'file','y');
@@ -1831,6 +1936,7 @@ PrintStringInfo('i162i162'+ArgSeparator+'i160',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'OpStar'; // BJ : Done AS : Float_Done
+
PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
@@ -2678,6 +2784,8 @@ PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
PrintStringInfo('OUT(1).TP= FA_TP_MIN_REAL(IN(1).TP,IN(2).TP)',ClassFileName,'file','y');
PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+
+
PrintStringInfo('OUT(1).SZ(2)= FA_SZ_FROM_VAL(FA_ADD(FA_SUB(FA_REAL(IN(2).VAL,IN(2).TP),FA_REAL(IN(1).VAL,IN(1).TP)),''1''),FA_TP_REAL(IN(2).TP))',ClassFileName,'file','y');
PrintStringInfo('NIN= 3',ClassFileName,'file','y');
PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
@@ -2828,6 +2936,7 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,Ex
//NUT det is a little bit complex but for the moment we assume that
//NUT that det works as trace function.
FunctionName = 'det'; // AS : Done AS : Float_Done
+
PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
@@ -3110,6 +3219,7 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,Ex
// --- Class OpEqual. ---
// ----------------------
ClassName = 'OpEqual';
+
// --- Class Annotation. ---
PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
@@ -3630,6 +3740,7 @@ ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
PrintStringInfo('s0'+ArgSeparator+'s0',ClassFileName,'file','y');
PrintStringInfo('d0'+ArgSeparator+'d0',ClassFileName,'file','y');
PrintStringInfo('c0'+ArgSeparator+'c0',ClassFileName,'file','y');
+
PrintStringInfo('z0'+ArgSeparator+'z0',ClassFileName,'file','y');
PrintStringInfo('s2'+ArgSeparator+'s2',ClassFileName,'file','y');
@@ -3775,6 +3886,7 @@ PrintStringInfo('OUT(1).TP= FA_TP_MAX(IN(1).TP,IN(2).TP)',ClassFileName,'file
PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
PrintStringInfo('OUT(1).SZ(2)= IN(2).VAL',ClassFileName,'file','y');
PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+
PrintStringInfo('NOUT= 2',ClassFileName,'file','y');
PrintStringInfo('OUT(1).TP= FA_TP_MAX(IN(1).TP,IN(2).TP)',ClassFileName,'file','y');
PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
@@ -3834,6 +3946,7 @@ ClassName = 'Lev';
PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+
PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y');
PrintStringInfo('OUT(1).SZ(1)= FA_SUB(FA_ADD(IN(1).SZ(1),IN(1).SZ(2)),''2'')',ClassFileName,'file','y');
@@ -3964,6 +4077,7 @@ PrintStringInfo('d2z2'+ArgSeparator+'z2',ClassFileName,'file','y');
PrintStringInfo('z2d2'+ArgSeparator+'z2',ClassFileName,'file','y');
PrintStringInfo('z2z2'+ArgSeparator+'z2',ClassFileName,'file','y');
+
// --- Annotation Function And Function List Function. ---
FunctionName = 'OpBackSlash';
PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
@@ -4400,6 +4514,7 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,Ex
//------------------------------------
//---- Class Sleep -------------------
+
//------------------------------------
ClassName = 'sleep';
@@ -4469,6 +4584,7 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
// --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+
PrintStringInfo('d0d0d0'+ArgSeparator+'u80',ClassFileName,'file','y');
PrintStringInfo('d0d0u80'+ArgSeparator+'u80',ClassFileName,'file','y');
@@ -4731,6 +4847,7 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,Ex
// // For every sci2c function library class we reported
// // the domains , annotations only for the class-leader
+
// // Example [y1,y2]=Fun(x1,x2,x3) : scilab library function call
// // Domain RxNxSel->{R,R} :the first input element is real number ,the second is integer ,
diff --git a/2.3-1/macros/ToolInitialization/INIT_SCI2C.sci b/2.3-1/macros/ToolInitialization/INIT_SCI2C.sci
index e5ee9758..82533022 100644
--- a/2.3-1/macros/ToolInitialization/INIT_SCI2C.sci
+++ b/2.3-1/macros/ToolInitialization/INIT_SCI2C.sci
@@ -74,6 +74,8 @@ SharedInfo = INIT_GenSharedInfo(RunMode,UserScilabMainFile, ...
// --- Initialize FileInfo. ---
// ----------------------------
FileInfo = INIT_GenFileInfo(WorkingDir,OutCCCodeDir,UserSciFilesPaths);
+
+
PrintStepInfo('SCI2C hArtes/POLIBA Tool!!!',FileInfo.GeneralReport,'stdout');
// ----------------------------------------------------
diff --git a/2.3-1/macros/ToolInitialization/SCI2CInputParameters.bkp b/2.3-1/macros/ToolInitialization/SCI2CInputParameters.bkp
deleted file mode 100644
index 7af3343c..00000000
--- a/2.3-1/macros/ToolInitialization/SCI2CInputParameters.bkp
+++ /dev/null
@@ -1,87 +0,0 @@
-// -----------------------------------------------------------------
-// === hArtes/PoliBa/GAP SCI2C tool ===
-// === Authors: ===
-// === Raffaele Nutricato ===
-// === raffaele.nutricato@tiscali.it ===
-// === Alberto Morea ===
-// === ===
-// === *************** ===
-// === USER PARAMETERS ===
-// === *************** ===
-// === ===
-//
-// Copyright 2007 Raffaele Nutricato.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-
-// ------------------------------------------
-// --- Specify Paths of User Scilab code. ---
-// ------------------------------------------
-UserSciCodeMainDir = 'C:\SCI2CTests\RegressionTests\test999';
-
-// --- Path + filename of the .sci main file of the code to be translated. ---
-// It is the entry point.
-UserScilabMainFile = fullfile(UserSciCodeMainDir,'scilabcode\mainfun.sci');
-
-// --- List of the paths containing the .sci files written by the user. ---
-UserSciFilesPaths = ...
- [...
- fullfile(UserSciCodeMainDir,'scilabcode');...
- ];
-
-// --------------------------
-// --- End Specify paths. ---
-// --------------------------
-
-
-// ----------------------------
-// --- Select the run mode. ---
-// ----------------------------
-//RunMode = 'GenLibraryStructure';
-//RunMode = 'Translate';
-RunMode = 'All';
-
-// --- Select one of the following options. ---
-
-// 'GenLibraryStructure';
-// Generates the library structure and exits. It is very
-// useful when the user wants to manually change the files stored in that structure
-// before running the translation. 'GenLibraryStructure' option forces SCI2C to remove
-// the already existing WorkingDir and OutCCCodeDir directories.
-
-// 'Translate';
-// Performs the translation without generating the library structure. It means that the library
-// structure must be already existing. This is useful when the user doesn't want to spend time
-// to generate again that structure or when he wants to force the SCI2C tool to access to
-// a manually-changed library structure. 'Translate' option forces SCI2C to don't remove
-// the already existing WorkingDir. Only OutCCCodeDir directory will be removed.
-
-// 'All';
-// Performs all the actions listed above.
-
-// --------------------------------
-// --- End Select the run mode. ---
-// --------------------------------
-
-
-// ----------------------------
-// --- Translation Options. ---
-// ----------------------------
-// --- Enable (1) / Disable (0) copy of Scilab code into C code. ---
-// If 1 the Scilab code will be copied into the C code in order to show
-// how each Scilab code line has been translated into C code.
-CopySciCodeIntoCCode = 1;
-
-// --- Select the path style for the C code. ---
-// It can be:
-// windows
-// unix
-// cygwin
-CCompilerPathStyle = 'cygwin';
-
-// --- Path + File name of the main SCI2C library header file.
-Sci2CLibMainHeaderFName = 'C:\Nutricato\OpenProjects\FP6_hArtes\WP2_SCI2C\Software\Scilab2C\CFiles\sci2cincludes\sci2clib.h';
-// --------------------------------
-// --- End Translation Options. ---
-// --------------------------------
diff --git a/2.3-1/macros/ToolInitialization/lib b/2.3-1/macros/ToolInitialization/lib
index 6240d3dd..0b3bb8ea 100644
--- a/2.3-1/macros/ToolInitialization/lib
+++ b/2.3-1/macros/ToolInitialization/lib
Binary files differ
diff --git a/2.3-1/macros/findDeps/getAllHeaders.sci b/2.3-1/macros/findDeps/getAllHeaders.sci
index 4709a15c..f7147662 100644
--- a/2.3-1/macros/findDeps/getAllHeaders.sci
+++ b/2.3-1/macros/findDeps/getAllHeaders.sci
@@ -63,6 +63,7 @@ function allHeaders = getAllHeaders(Target)
"src/c/matrixOperations/includes/matrixTranspose.h"
"src/c/matrixOperations/includes/determ.h"
"src/c/matrixOperations/includes/matrixMultiplication.h"
+ "src/c/matrixOperations/includes/diag.h"
"src/c/elementaryFunctions/includes/cos.h"
"src/c/elementaryFunctions/includes/fix.h"
"src/c/elementaryFunctions/includes/exp.h"
@@ -93,6 +94,8 @@ function allHeaders = getAllHeaders(Target)
"src/c/elementaryFunctions/includes/bitcmp.h"
"src/c/elementaryFunctions/includes/bitset.h"
"src/c/elementaryFunctions/includes/bitget.h"
+ "src/c/elementaryFunctions/includes/linspace.h"
+ "src/c/elementaryFunctions/includes/logspace.h"
"src/c/elementaryFunctions/includes/asinh.h"
"src/c/elementaryFunctions/includes/atan2.h"
"src/c/elementaryFunctions/includes/atanh.h"
diff --git a/2.3-1/macros/findDeps/getAllInterfaces.sci b/2.3-1/macros/findDeps/getAllInterfaces.sci
index ae6d8692..9d29bdbb 100644
--- a/2.3-1/macros/findDeps/getAllInterfaces.sci
+++ b/2.3-1/macros/findDeps/getAllInterfaces.sci
@@ -51,6 +51,7 @@ function allInterfaces = getAllInterfaces(Target)
"src/c/matrixOperations/interfaces/int_dist.h"
"src/c/matrixOperations/interfaces/int_fill.h"
"src/c/matrixOperations/interfaces/int_expm.h"
+ "src/c/matrixOperations/interfaces/int_diag.h"
"src/c/elementaryFunctions/interfaces/int_asinh.h"
"src/c/elementaryFunctions/interfaces/int_atanh.h"
"src/c/elementaryFunctions/interfaces/int_sinh.h"
@@ -83,6 +84,8 @@ function allInterfaces = getAllInterfaces(Target)
"src/c/elementaryFunctions/interfaces/int_bitcmp.h"
"src/c/elementaryFunctions/interfaces/int_bitset.h"
"src/c/elementaryFunctions/interfaces/int_bitget.h"
+ "src/c/elementaryFunctions/interfaces/int_linspace.h"
+ "src/c/elementaryFunctions/interfaces/int_logspace.h"
"src/c/elementaryFunctions/interfaces/int_cosh.h"
"src/c/elementaryFunctions/interfaces/int_uint8.h"
"src/c/elementaryFunctions/interfaces/int_int8.h"
diff --git a/2.3-1/macros/findDeps/getAllLibraries.sci b/2.3-1/macros/findDeps/getAllLibraries.sci
index f309f0bf..7a8ce276 100644
--- a/2.3-1/macros/findDeps/getAllLibraries.sci
+++ b/2.3-1/macros/findDeps/getAllLibraries.sci
@@ -16,4 +16,5 @@ function allLibraries = getAllLibraries(Target)
allLibraries = [];
end
+
endfunction
diff --git a/2.3-1/macros/findDeps/getAllSources.sci b/2.3-1/macros/findDeps/getAllSources.sci
index a0d88c79..d03ab17a 100644
--- a/2.3-1/macros/findDeps/getAllSources.sci
+++ b/2.3-1/macros/findDeps/getAllSources.sci
@@ -244,6 +244,36 @@ function allSources = getAllSources(Target)
"src/c/matrixOperations/squaredMagnitude/zsquMagns.c"
"src/c/matrixOperations/squaredMagnitude/csquMagna.c"
"src/c/matrixOperations/squaredMagnitude/csquMagns.c"
+ "src/c/matrixOperations/diag/ddiags.c"
+ "src/c/matrixOperations/diag/ddiaga.c"
+ "src/c/matrixOperations/diag/ddiagina.c"
+ "src/c/matrixOperations/diag/ddiagins.c"
+ "src/c/matrixOperations/diag/ddiagexa.c"
+ "src/c/matrixOperations/diag/ddiagexs.c"
+ "src/c/matrixOperations/diag/u8diags.c"
+ "src/c/matrixOperations/diag/u8diaga.c"
+ "src/c/matrixOperations/diag/u8diagina.c"
+ "src/c/matrixOperations/diag/u8diagins.c"
+ "src/c/matrixOperations/diag/u8diagexa.c"
+ "src/c/matrixOperations/diag/u8diagexs.c"
+ "src/c/matrixOperations/diag/u16diags.c"
+ "src/c/matrixOperations/diag/u16diaga.c"
+ "src/c/matrixOperations/diag/u16diagina.c"
+ "src/c/matrixOperations/diag/u16diagins.c"
+ "src/c/matrixOperations/diag/u16diagexa.c"
+ "src/c/matrixOperations/diag/u16diagexs.c"
+ "src/c/matrixOperations/diag/i8diags.c"
+ "src/c/matrixOperations/diag/i8diaga.c"
+ "src/c/matrixOperations/diag/i8diagina.c"
+ "src/c/matrixOperations/diag/i8diagins.c"
+ "src/c/matrixOperations/diag/i8diagexa.c"
+ "src/c/matrixOperations/diag/i8diagexs.c"
+ "src/c/matrixOperations/diag/i16diags.c"
+ "src/c/matrixOperations/diag/i16diaga.c"
+ "src/c/matrixOperations/diag/i16diagina.c"
+ "src/c/matrixOperations/diag/i16diagins.c"
+ "src/c/matrixOperations/diag/i16diagexa.c"
+ "src/c/matrixOperations/diag/i16diagexs.c"
"src/c/elementaryFunctions/cos/dcosa.c"
"src/c/elementaryFunctions/cos/dcoss.c"
"src/c/elementaryFunctions/cos/scosa.c"
@@ -590,6 +620,10 @@ function allSources = getAllSources(Target)
"src/c/elementaryFunctions/bitset/u16bitsets.c"
"src/c/elementaryFunctions/bitget/u8bitgets.c"
"src/c/elementaryFunctions/bitget/u16bitgets.c"
+ "src/c/elementaryFunctions/linspace/dlinspaces.c"
+ "src/c/elementaryFunctions/linspace/dlinspacea.c"
+ "src/c/elementaryFunctions/logspace/dlogspaces.c"
+ "src/c/elementaryFunctions/logspace/dlogspacea.c"
"src/c/statisticsFunctions/max/dmaxa.c"
"src/c/statisticsFunctions/max/smaxa.c"
"src/c/statisticsFunctions/max/srowmaxa.c"
diff --git a/2.3-1/macros/lib b/2.3-1/macros/lib
index 1b718c75..f3cab7db 100644
--- a/2.3-1/macros/lib
+++ b/2.3-1/macros/lib
Binary files differ
diff --git a/2.3-1/src/c/auxiliaryFunctions/rand/dranda.c b/2.3-1/src/c/auxiliaryFunctions/rand/dranda.c
index f4678279..3defc264 100644
--- a/2.3-1/src/c/auxiliaryFunctions/rand/dranda.c
+++ b/2.3-1/src/c/auxiliaryFunctions/rand/dranda.c
@@ -16,5 +16,5 @@ void dranda(double *out, int size) {
int i = 0;
for (i = 0 ; i < size ; ++i) {
out[i] = drands();
- }
+ }
}
diff --git a/2.3-1/src/c/auxiliaryFunctions/rand/drands.c b/2.3-1/src/c/auxiliaryFunctions/rand/drands.c
index 9b7c4cf4..658cd0b0 100644
--- a/2.3-1/src/c/auxiliaryFunctions/rand/drands.c
+++ b/2.3-1/src/c/auxiliaryFunctions/rand/drands.c
@@ -34,37 +34,60 @@ double drands(void) {
if (m2==0){
/* if first entry, compute machine integer word length */
- while (m>m2){
+ while (m>m2){
m2=m;
m=itwo*m2;
+
}
+
halfm = m2;
-
- /* compute multiplier and increment for linear congruential method */
+
+ /* compute multiplier and increment for linear congruential method */
ia = 8*(int)(halfm*atan(1.0)/8.0) + 5;
- ic = 2*(int)(halfm*(0.5-sqrt(3.0)/6.0)) + 1;
- mic = (m2 - ic) + m2;
-
- /* s is the scale factor for converting to floating point */
+
+ ic = 2*(int)(halfm*(0.5-sqrt(3.0)/6.0)) + 1;
+
+ mic = (m2 - ic) + m2;
+
+ /* s is the scale factor for converting to floating point */
s = 0.5/halfm;
+
+
}
/* compute next random number */
iy = iy*ia;
+
+
/* the following statement is for computers which do not allow
integer overflow on addition */
- if (iy > mic) iy = (iy - m2) - m2;
+ if (iy > mic)
+ {
+ iy = (iy - m2) - m2;
+
+ }
iy = iy + ic;
/* the following statement is for computers where the
word length for addition is greater than for multiplication */
- if (iy/2 > m2) iy = (iy - m2) - m2;
+ if (iy/2 > m2)
+ {
+ iy = (iy - m2) - m2;
+
+ }
/* the following statement is for computers where integer
overflow affects the sign bit */
- if (iy < 0) iy = (iy + m2) + m2;
+ if (iy < 0)
+ {
+ iy = (iy + m2) + m2;
+
+
+ }
+
+
return (double)iy*s;
}
diff --git a/2.3-1/src/c/elementaryFunctions/includes/linspace.h b/2.3-1/src/c/elementaryFunctions/includes/linspace.h
new file mode 100644
index 00000000..837d839d
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/includes/linspace.h
@@ -0,0 +1,36 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET
+ *
+ * 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
+ *
+ */
+
+#ifndef __LINSPACE_H__
+#define __LINSPACE_H__
+
+#include "dynlib_elementaryfunctions.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+EXTERN_ELEMFUNCT void dlinspaces(double low_limit,double up_limit,double range_num, double* out);
+
+EXTERN_ELEMFUNCT void dlinspacea(double *low_limit,int row,double *up_limit,double range_num, double* out);
+
+
+
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+
+#endif /* !__LINSPACE_H__ */
+
diff --git a/2.3-1/src/c/elementaryFunctions/includes/logspace.h b/2.3-1/src/c/elementaryFunctions/includes/logspace.h
new file mode 100644
index 00000000..1f73402b
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/includes/logspace.h
@@ -0,0 +1,24 @@
+/*
+SCilab2C FOSSEE IIT Bombay
+ */
+
+#ifndef __LOGSPACE_H__
+#define __LOGSPACE_H__
+
+#include "dynlib_elementaryfunctions.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+EXTERN_ELEMFUNCT void dlogspaces(double low_limit,double up_limit,double range_num, double* out);
+
+EXTERN_ELEMFUNCT void dlogspacea(double *low_limit,int row,double *up_limit,double range_num, double* out);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+
+#endif /* !__LOGSPACE_H__ */
+
diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_linspace.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_linspace.h
new file mode 100644
index 00000000..4e60b15b
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_linspace.h
@@ -0,0 +1,10 @@
+/* Scilab2C FOSSEE IITB */
+
+#ifndef __INT_LINSPACE_H__
+#define __INT_LINSPACE_H__
+
+#define d0d0d0linspaced2(in1,in2,in3,out) dlinspaces(in1,in2,in3,out)
+
+#define d2d2d0linspaced2(in1,size1,in2,size2,in3,out) dlinspacea(in1,size1[0],in2,in3,out)
+
+#endif
diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_logspace.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_logspace.h
new file mode 100644
index 00000000..34e325ac
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_logspace.h
@@ -0,0 +1,10 @@
+/* Scilab2C FOSSEE IITB */
+
+#ifndef __INT_LOGSPACE_H__
+#define __INT_LOGSPACE_H__
+
+#define d0d0d0logspaced2(in1,in2,in3,out) dlogspaces(in1,in2,in3,out)
+
+#define d2d2d0logspaced2(in1,size1,in2,size2,in3,out) dlogspacea(in1,size1[0],in2,in3,out)
+
+#endif
diff --git a/2.3-1/src/c/elementaryFunctions/linspace/dlinspacea.c b/2.3-1/src/c/elementaryFunctions/linspace/dlinspacea.c
new file mode 100644
index 00000000..f67968d6
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/linspace/dlinspacea.c
@@ -0,0 +1,39 @@
+/*
+ Scilab2C FOSSEE IIT Bombay
+ */
+
+#include "linspace.h"
+void dlinspacea(double *low_limit,int _row,double *up_limit,double range_num,double *out)
+{
+ int i,j,k;
+ double temp;
+ float step_iterate[_row]; // for each row the spacing between two values is different.
+ for(i=0;i<_row;i++)
+ {
+
+ step_iterate[i] = (up_limit[i]-low_limit[i])/(range_num-1);
+
+ }
+ for(j=0;j < _row;j++)
+ {
+ out[j] = low_limit[j]; // For every row first element is the first value of low_limit array
+ temp = low_limit[j];
+ for(k=1;k < (double)range_num;k++ )
+ {
+ out[(_row*k)+j] = temp + step_iterate[j]; /* Output matrix positions for 3 X 5 matrix are [0 3 6 9 12;1 4 7 10 13;2 5 8 11 14] so (_row*k)+j) used*/
+ temp = out[(_row*k)+j];
+ if(k == (double)range_num-1 )
+ {
+ out[(_row*k)+j] = (double)up_limit[j]; // Last value of output is equal to first value of up_limit array
+ }
+
+ }
+
+
+ }
+
+
+
+
+}
+
diff --git a/2.3-1/src/c/elementaryFunctions/linspace/dlinspacea.c~ b/2.3-1/src/c/elementaryFunctions/linspace/dlinspacea.c~
new file mode 100644
index 00000000..f67968d6
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/linspace/dlinspacea.c~
@@ -0,0 +1,39 @@
+/*
+ Scilab2C FOSSEE IIT Bombay
+ */
+
+#include "linspace.h"
+void dlinspacea(double *low_limit,int _row,double *up_limit,double range_num,double *out)
+{
+ int i,j,k;
+ double temp;
+ float step_iterate[_row]; // for each row the spacing between two values is different.
+ for(i=0;i<_row;i++)
+ {
+
+ step_iterate[i] = (up_limit[i]-low_limit[i])/(range_num-1);
+
+ }
+ for(j=0;j < _row;j++)
+ {
+ out[j] = low_limit[j]; // For every row first element is the first value of low_limit array
+ temp = low_limit[j];
+ for(k=1;k < (double)range_num;k++ )
+ {
+ out[(_row*k)+j] = temp + step_iterate[j]; /* Output matrix positions for 3 X 5 matrix are [0 3 6 9 12;1 4 7 10 13;2 5 8 11 14] so (_row*k)+j) used*/
+ temp = out[(_row*k)+j];
+ if(k == (double)range_num-1 )
+ {
+ out[(_row*k)+j] = (double)up_limit[j]; // Last value of output is equal to first value of up_limit array
+ }
+
+ }
+
+
+ }
+
+
+
+
+}
+
diff --git a/2.3-1/src/c/elementaryFunctions/linspace/dlinspaces.c b/2.3-1/src/c/elementaryFunctions/linspace/dlinspaces.c
new file mode 100644
index 00000000..82b88e34
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/linspace/dlinspaces.c
@@ -0,0 +1,25 @@
+/*
+ Scilab2C FOSSEE IIT Bombay
+ */
+
+#include "linspace.h"
+void dlinspaces(double low_limit,double up_limit,double range_num,double *out)
+{
+ int j;
+ double temp = low_limit;
+ float step_iterate = (up_limit-low_limit)/(range_num-1);
+ out[0] = low_limit; //First value of output is equal to low_limit value
+ for(j=1; j<(double)range_num; j++)
+ {
+ out[j] = temp + step_iterate;
+ temp = out[j];
+ if(j == (double)range_num-1 )
+ {
+ out[j] = (double)up_limit; // Last value of output is equal to up_limit value
+ }
+ }
+
+
+
+}
+
diff --git a/2.3-1/src/c/elementaryFunctions/linspace/dlinspaces.c~ b/2.3-1/src/c/elementaryFunctions/linspace/dlinspaces.c~
new file mode 100644
index 00000000..82b88e34
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/linspace/dlinspaces.c~
@@ -0,0 +1,25 @@
+/*
+ Scilab2C FOSSEE IIT Bombay
+ */
+
+#include "linspace.h"
+void dlinspaces(double low_limit,double up_limit,double range_num,double *out)
+{
+ int j;
+ double temp = low_limit;
+ float step_iterate = (up_limit-low_limit)/(range_num-1);
+ out[0] = low_limit; //First value of output is equal to low_limit value
+ for(j=1; j<(double)range_num; j++)
+ {
+ out[j] = temp + step_iterate;
+ temp = out[j];
+ if(j == (double)range_num-1 )
+ {
+ out[j] = (double)up_limit; // Last value of output is equal to up_limit value
+ }
+ }
+
+
+
+}
+
diff --git a/2.3-1/src/c/elementaryFunctions/linspace/u8linspacea.c~ b/2.3-1/src/c/elementaryFunctions/linspace/u8linspacea.c~
new file mode 100644
index 00000000..2e623fa6
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/linspace/u8linspacea.c~
@@ -0,0 +1,39 @@
+/*
+ Scilab2C FOSSEE IIT Bombay
+ */
+
+#include "linspace.h"
+void u8linspacea(uint8 *low_limit,int _row,uint8 *up_limit,double range_num,uint8 *out)
+{
+ int i,j,k;
+ uint8 temp;
+ float step_iterate[_row]; // for each row the spacing between two values is different.
+ for(i=0;i<_row;i++)
+ {
+
+ step_iterate[i] = (up_limit[i]-low_limit[i])/(range_num-1);
+
+ }
+ for(j=0;j < _row;j++)
+ {
+ out[j] = low_limit[j]; // For every row first element is the first value of low_limit array
+ temp = low_limit[j];
+ for(k=1;k < (double)range_num;k++ )
+ {
+ out[(_row*k)+j] = temp + step_iterate[j]; /* Output matrix positions for 3 X 5 matrix are [0 3 6 9 12;1 4 7 10 13;2 5 8 11 14] so (_row*k)+j) used*/
+ temp = out[(_row*k)+j];
+ if(k == (double)range_num-1 )
+ {
+ out[(_row*k)+j] = (uint8)up_limit[j]; // Last value of output is equal to first value of up_limit array
+ }
+
+ }
+
+
+ }
+
+
+
+
+}
+
diff --git a/2.3-1/src/c/elementaryFunctions/linspace/u8linspaces.c~ b/2.3-1/src/c/elementaryFunctions/linspace/u8linspaces.c~
new file mode 100644
index 00000000..0320a276
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/linspace/u8linspaces.c~
@@ -0,0 +1,25 @@
+/*
+ Scilab2C FOSSEE IIT Bombay
+ */
+
+#include "linspace.h"
+void u8linspaces(uint8 low_limit,uint8 up_limit,double range_num,uint8 *out)
+{
+ int j;
+ uint8 temp = low_limit;
+ float step_iterate = (up_limit-low_limit)/(range_num-1);
+ out[0] = low_limit; //First value of output is equal to low_limit value
+ for(j=1; j<(double)range_num; j++)
+ {
+ out[j] = temp + step_iterate;
+ temp = out[j];
+ if(j == (double)range_num-1 )
+ {
+ out[j] = (uint8)up_limit; // Last value of output is equal to up_limit value
+ }
+ }
+
+
+
+}
+
diff --git a/2.3-1/src/c/elementaryFunctions/logspace/dlogspacea.c b/2.3-1/src/c/elementaryFunctions/logspace/dlogspacea.c
new file mode 100644
index 00000000..f8b283c6
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/logspace/dlogspacea.c
@@ -0,0 +1,40 @@
+/*
+ Scilab2C FOSSEE IIT Bombay
+ */
+
+#include "logspace.h"
+#include<math.h>
+void dlogspacea(double *low_limit,int _row,double *up_limit,double range_num,double *out)
+{
+ int i,j,k;
+ double temp;
+ double step_iterate[_row]; // for each row the spacing between two values is different.
+ for(i=0;i<_row;i++)
+ {
+ step_iterate[i] = pow(10,((up_limit[i]-low_limit[i])/(range_num-1)));
+
+
+ }
+ for(j=0;j < _row;j++)
+ {
+ out[j] = pow(10,low_limit[j]); // For every row first element is equal to 10 raise to the first value of low_limit array
+ temp = out[j];
+ for(k=1;k < (double)range_num;k++ )
+ {
+ out[(_row*k)+j] = temp*step_iterate[j]; /* Output matrix positions for 3 X 5 matrix are [0 3 6 9 12;1 4 7 10 13;2 5 8 11 14] so (_row*k)+j) used*/
+ temp = out[(_row*k)+j];
+ if(k == (double)range_num-1 )
+ {
+ out[(_row*k)+j] = pow(10,((double)up_limit[j])); // For every row Last value of output is equal to 10 raise to first value of up_limit array
+ }
+
+ }
+
+
+ }
+
+
+
+
+}
+
diff --git a/2.3-1/src/c/elementaryFunctions/logspace/dlogspaces.c b/2.3-1/src/c/elementaryFunctions/logspace/dlogspaces.c
new file mode 100644
index 00000000..7970321b
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/logspace/dlogspaces.c
@@ -0,0 +1,26 @@
+/*
+ Scilab2C FOSSEE IIT Bombay
+ */
+
+#include "logspace.h"
+#include<math.h>
+void dlogspaces(double low_limit,double up_limit,double range_num,double *out)
+{
+ int j;
+ double temp = pow(10,low_limit);
+ double step_iterate = pow(10,((up_limit-low_limit)/(range_num-1)));
+ out[0] = pow(10,low_limit); //First value of output is equal to low_limit value
+ for(j=1; j<(double)range_num; j++)
+ {
+ out[j] = temp*step_iterate;
+ temp = out[j];
+ if(j == (double)range_num-1 )
+ {
+ out[j] = pow(10,((double)up_limit)); // Last value of output is equal to up_limit value
+ }
+ }
+
+
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/determ/i16determa.c b/2.3-1/src/c/matrixOperations/determ/i16determa.c
new file mode 100644
index 00000000..a1184553
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/determ/i16determa.c
@@ -0,0 +1,92 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA - Arnaud TORSET
+ *
+ * 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
+ *
+ */
+
+#include <stdlib.h>
+#ifndef WITHOUT_LAPACK
+#include "lapack.h"
+#endif
+#include "determ.h"
+#include "lapack.h"
+
+int16 i16determa(int16 * in, int size){
+#ifndef WITHOUT_LAPACK
+ int i=0, info=0;
+ int16 out=0;
+ int16 *inCopy=NULL;
+ int* tmp=NULL;
+
+ /*Calculation of the determinant*/
+ switch (size){
+ case 2 : out = in[0]*in[3]-in[1]*in[2];
+ break;
+ case 3 : /*regle de Sarrus*/
+ out = in[0]*in[4]*in[8]+in[1]*in[5]*in[6]+in[2]*in[3]*in[7]
+ -in[0]*in[5]*in[7]-in[1]*in[3]*in[8]-in[2]*in[4]*in[6];
+ break;
+ default :
+
+ /*Copy the input matrix*/
+ inCopy=(int16*)malloc((unsigned int)(size*size)*sizeof(int16));
+ for (i=0;i<size*size;i++) inCopy[i]=in[i];
+
+ tmp=(int*)malloc((unsigned int)size*sizeof(int));
+ dgetrf_(&size, &size, inCopy, &size, tmp, &info);
+ out=1;
+ for (i=0;i<size;i++){
+ if (tmp[i]!=i+1) out=-out;
+ out=inCopy[i*(size+1)]*out;
+ }
+ free(tmp);
+ free(inCopy);
+ break;
+ }
+
+#else
+ int i=0, j=0, k=0;
+ int16 out=0, pivot=0;
+ int16 *inCopy=NULL;
+
+ /*Calculation of the determinant*/
+ switch (size){
+ case 2 : out = in[0]*in[3]-in[1]*in[2];
+ break;
+ case 3 : /*regle de Sarrus*/
+ out = in[0]*in[4]*in[8]+in[1]*in[5]*in[6]+in[2]*in[3]*in[7]
+ -in[0]*in[5]*in[7]-in[1]*in[3]*in[8]-in[2]*in[4]*in[6];
+ break;
+ default :
+
+ /*Copy the input matrix*/
+ inCopy=malloc((unsigned int)(size*size)*sizeof(int16));
+ for (i=0;i<size*size;i++) inCopy[i]=in[i];
+
+ for (i=0;i<size;i++){
+ for (j=i+1;j<size;j++){
+ pivot = inCopy[i*size+j]/inCopy[i*size+i];
+ for (k=0;k<size-i;k++){
+ inCopy[i*size+j+k*size]-=pivot*inCopy[i*size+i+k*size];
+ }
+ }
+ }
+ out=1;
+ for (i=0;i<size;i++){
+ out *= inCopy[i*size+i];
+ }
+ free(inCopy);
+ break;
+
+ }
+#endif
+
+
+ return out;
+}
diff --git a/2.3-1/src/c/matrixOperations/determ/i8determa.c b/2.3-1/src/c/matrixOperations/determ/i8determa.c
new file mode 100644
index 00000000..9693fe67
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/determ/i8determa.c
@@ -0,0 +1,92 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA - Arnaud TORSET
+ *
+ * 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
+ *
+ */
+
+#include <stdlib.h>
+#ifndef WITHOUT_LAPACK
+#include "lapack.h"
+#endif
+#include "determ.h"
+#include "lapack.h"
+
+int8 i8determa(int8 * in, int size){
+#ifndef WITHOUT_LAPACK
+ int i=0, info=0;
+ int8 out=0;
+ int8 *inCopy=NULL;
+ int* tmp=NULL;
+
+ /*Calculation of the determinant*/
+ switch (size){
+ case 2 : out = in[0]*in[3]-in[1]*in[2];
+ break;
+ case 3 : /*regle de Sarrus*/
+ out = in[0]*in[4]*in[8]+in[1]*in[5]*in[6]+in[2]*in[3]*in[7]
+ -in[0]*in[5]*in[7]-in[1]*in[3]*in[8]-in[2]*in[4]*in[6];
+ break;
+ default :
+
+ /*Copy the input matrix*/
+ inCopy=(int8*)malloc((unsigned int)(size*size)*sizeof(int8));
+ for (i=0;i<size*size;i++) inCopy[i]=in[i];
+
+ tmp=(int*)malloc((unsigned int)size*sizeof(int));
+ dgetrf_(&size, &size, inCopy, &size, tmp, &info);
+ out=1;
+ for (i=0;i<size;i++){
+ if (tmp[i]!=i+1) out=-out;
+ out=inCopy[i*(size+1)]*out;
+ }
+ free(tmp);
+ free(inCopy);
+ break;
+ }
+
+#else
+ int i=0, j=0, k=0;
+ int8 out=0, pivot=0;
+ int8 *inCopy=NULL;
+
+ /*Calculation of the determinant*/
+ switch (size){
+ case 2 : out = in[0]*in[3]-in[1]*in[2];
+ break;
+ case 3 : /*regle de Sarrus*/
+ out = in[0]*in[4]*in[8]+in[1]*in[5]*in[6]+in[2]*in[3]*in[7]
+ -in[0]*in[5]*in[7]-in[1]*in[3]*in[8]-in[2]*in[4]*in[6];
+ break;
+ default :
+
+ /*Copy the input matrix*/
+ inCopy=malloc((unsigned int)(size*size)*sizeof(int8));
+ for (i=0;i<size*size;i++) inCopy[i]=in[i];
+
+ for (i=0;i<size;i++){
+ for (j=i+1;j<size;j++){
+ pivot = inCopy[i*size+j]/inCopy[i*size+i];
+ for (k=0;k<size-i;k++){
+ inCopy[i*size+j+k*size]-=pivot*inCopy[i*size+i+k*size];
+ }
+ }
+ }
+ out=1;
+ for (i=0;i<size;i++){
+ out *= inCopy[i*size+i];
+ }
+ free(inCopy);
+ break;
+
+ }
+#endif
+
+
+ return out;
+}
diff --git a/2.3-1/src/c/matrixOperations/determ/u16determa.c b/2.3-1/src/c/matrixOperations/determ/u16determa.c
new file mode 100644
index 00000000..480d1ed3
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/determ/u16determa.c
@@ -0,0 +1,92 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA - Arnaud TORSET
+ *
+ * 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
+ *
+ */
+
+#include <stdlib.h>
+#ifndef WITHOUT_LAPACK
+#include "lapack.h"
+#endif
+#include "determ.h"
+#include "lapack.h"
+
+uint16 u16determa(uint16 * in, int size){
+#ifndef WITHOUT_LAPACK
+ int i=0, info=0;
+ uint16 out=0;
+ uint16 *inCopy=NULL;
+ int* tmp=NULL;
+
+ /*Calculation of the determinant*/
+ switch (size){
+ case 2 : out = in[0]*in[3]-in[1]*in[2];
+ break;
+ case 3 : /*regle de Sarrus*/
+ out = in[0]*in[4]*in[8]+in[1]*in[5]*in[6]+in[2]*in[3]*in[7]
+ -in[0]*in[5]*in[7]-in[1]*in[3]*in[8]-in[2]*in[4]*in[6];
+ break;
+ default :
+
+ /*Copy the input matrix*/
+ inCopy=(uint16*)malloc((unsigned int)(size*size)*sizeof(uint16));
+ for (i=0;i<size*size;i++) inCopy[i]=in[i];
+
+ tmp=(int*)malloc((unsigned int)size*sizeof(int));
+ dgetrf_(&size, &size, inCopy, &size, tmp, &info);
+ out=1;
+ for (i=0;i<size;i++){
+ if (tmp[i]!=i+1) out=-out;
+ out=inCopy[i*(size+1)]*out;
+ }
+ free(tmp);
+ free(inCopy);
+ break;
+ }
+
+#else
+ int i=0, j=0, k=0;
+ uint16 out=0, pivot=0;
+ uint16 *inCopy=NULL;
+
+ /*Calculation of the determinant*/
+ switch (size){
+ case 2 : out = in[0]*in[3]-in[1]*in[2];
+ break;
+ case 3 : /*regle de Sarrus*/
+ out = in[0]*in[4]*in[8]+in[1]*in[5]*in[6]+in[2]*in[3]*in[7]
+ -in[0]*in[5]*in[7]-in[1]*in[3]*in[8]-in[2]*in[4]*in[6];
+ break;
+ default :
+
+ /*Copy the input matrix*/
+ inCopy=malloc((unsigned int)(size*size)*sizeof(uint16));
+ for (i=0;i<size*size;i++) inCopy[i]=in[i];
+
+ for (i=0;i<size;i++){
+ for (j=i+1;j<size;j++){
+ pivot = inCopy[i*size+j]/inCopy[i*size+i];
+ for (k=0;k<size-i;k++){
+ inCopy[i*size+j+k*size]-=pivot*inCopy[i*size+i+k*size];
+ }
+ }
+ }
+ out=1;
+ for (i=0;i<size;i++){
+ out *= inCopy[i*size+i];
+ }
+ free(inCopy);
+ break;
+
+ }
+#endif
+
+
+ return out;
+}
diff --git a/2.3-1/src/c/matrixOperations/determ/u8determa.c b/2.3-1/src/c/matrixOperations/determ/u8determa.c
new file mode 100644
index 00000000..3fb18d54
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/determ/u8determa.c
@@ -0,0 +1,92 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA - Arnaud TORSET
+ *
+ * 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
+ *
+ */
+
+#include <stdlib.h>
+#ifndef WITHOUT_LAPACK
+#include "lapack.h"
+#endif
+#include "determ.h"
+#include "lapack.h"
+
+uint8 u8determa(uint8 * in, int size){
+#ifndef WITHOUT_LAPACK
+ int i=0, info=0;
+ uint8 out=0;
+ uint8 *inCopy=NULL;
+ int* tmp=NULL;
+
+ /*Calculation of the determinant*/
+ switch (size){
+ case 2 : out = in[0]*in[3]-in[1]*in[2];
+ break;
+ case 3 : /*regle de Sarrus*/
+ out = in[0]*in[4]*in[8]+in[1]*in[5]*in[6]+in[2]*in[3]*in[7]
+ -in[0]*in[5]*in[7]-in[1]*in[3]*in[8]-in[2]*in[4]*in[6];
+ break;
+ default :
+
+ /*Copy the input matrix*/
+ inCopy=(uint8*)malloc((unsigned int)(size*size)*sizeof(uint8));
+ for (i=0;i<size*size;i++) inCopy[i]=in[i];
+
+ tmp=(int*)malloc((unsigned int)size*sizeof(int));
+ dgetrf_(&size, &size, inCopy, &size, tmp, &info);
+ out=1;
+ for (i=0;i<size;i++){
+ if (tmp[i]!=i+1) out=-out;
+ out=inCopy[i*(size+1)]*out;
+ }
+ free(tmp);
+ free(inCopy);
+ break;
+ }
+
+#else
+ int i=0, j=0, k=0;
+ uint8 out=0, pivot=0;
+ uint8 *inCopy=NULL;
+
+ /*Calculation of the determinant*/
+ switch (size){
+ case 2 : out = in[0]*in[3]-in[1]*in[2];
+ break;
+ case 3 : /*regle de Sarrus*/
+ out = in[0]*in[4]*in[8]+in[1]*in[5]*in[6]+in[2]*in[3]*in[7]
+ -in[0]*in[5]*in[7]-in[1]*in[3]*in[8]-in[2]*in[4]*in[6];
+ break;
+ default :
+
+ /*Copy the input matrix*/
+ inCopy=malloc((unsigned int)(size*size)*sizeof(uint8));
+ for (i=0;i<size*size;i++) inCopy[i]=in[i];
+
+ for (i=0;i<size;i++){
+ for (j=i+1;j<size;j++){
+ pivot = inCopy[i*size+j]/inCopy[i*size+i];
+ for (k=0;k<size-i;k++){
+ inCopy[i*size+j+k*size]-=pivot*inCopy[i*size+i+k*size];
+ }
+ }
+ }
+ out=1;
+ for (i=0;i<size;i++){
+ out *= inCopy[i*size+i];
+ }
+ free(inCopy);
+ break;
+
+ }
+#endif
+
+
+ return out;
+}
diff --git a/2.3-1/src/c/matrixOperations/diag/ddiaga.c b/2.3-1/src/c/matrixOperations/diag/ddiaga.c
new file mode 100644
index 00000000..26363ef9
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/ddiaga.c
@@ -0,0 +1,40 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+#include<stdlib.h> // Used for Absolute value of insert_post
+void ddiaga(double in, int size,int insert_post,double *out)
+{
+
+ int i;
+
+ for(i=0;i < ((size+abs(insert_post))*(size+abs(insert_post)));i++)
+ {
+ out[i] = 0;
+
+ }
+
+ if(insert_post < 0)
+ {
+
+ out[abs(insert_post)] = in;
+
+ }
+ else
+ {
+
+ out[(size + insert_post)*insert_post] = in;
+
+ }
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/ddiagexa.c b/2.3-1/src/c/matrixOperations/diag/ddiagexa.c
new file mode 100644
index 00000000..191c1311
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/ddiagexa.c
@@ -0,0 +1,130 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+void ddiagexa(double *in, int _row,int _column,int extract_post,double *out)
+{
+
+
+ int j;
+ if(_row == _column)
+ {
+ if(extract_post <= 0)
+ {
+ for ( j = 0 ; j < _column ; j++ )
+ {
+
+
+ out[j] = in[((_column+1)*j)-extract_post] ;
+
+ }
+ }
+ else
+ {
+ for ( j = extract_post ; j < _column ; j++ )
+ {
+
+
+ out[j-extract_post] = in[((_column+1)*j)-extract_post] ;
+
+ }
+ }
+
+ }
+ else if(_row > _column)
+ {
+
+ if(extract_post >=0)
+ {
+
+ for(j = extract_post; j < _column;j++)
+ {
+
+ out[j-extract_post] = in[((_row+1)*j)-extract_post];
+ }
+
+
+ }
+ else
+ {
+
+ if((abs(extract_post) <= (_row - _column)))
+ {
+ for(j = 0; j < _column ; j++)
+ {
+ out[j] = in[((_row+1)*j)-extract_post];
+
+ }
+ }
+ else
+ {
+
+ for(j=0; j < (_row + extract_post);j++)
+ {
+
+ out[j] = in[((_row+1)*j)-extract_post];
+
+ }
+
+
+
+ }
+
+ }
+
+ }
+ else if (_row < _column)
+ {
+
+ if(extract_post > 0)
+ {
+ if((extract_post <= (_column - _row)))
+ {
+ for(j=extract_post;j < _column;j++)
+ {
+ out[j-extract_post] = in[((_row+1)*j)-extract_post];
+ }
+
+ }
+ else
+ {
+ for(j=extract_post;j < _column;j++)
+ {
+ out[j-extract_post] = in[((_row+1)*j)-extract_post];
+ }
+
+ }
+
+ }
+ else
+ {
+
+
+ for(j=0;j < (_row+extract_post);j++)
+ {
+
+ out[j] = in[((_row+1)*j)-extract_post];
+
+
+
+ }
+
+
+
+ }
+
+
+ }
+
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/ddiagexs.c b/2.3-1/src/c/matrixOperations/diag/ddiagexs.c
new file mode 100644
index 00000000..fb007b52
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/ddiagexs.c
@@ -0,0 +1,53 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+double ddiagexs(double *in, int _row,int _column,int extract_post)
+{
+
+ if(_row == _column)
+ {
+
+ if(extract_post < 0)
+ {
+
+ return in[_row-1] ;
+ }
+ else
+ {
+
+ return in[(_row)*(_row-1)] ;
+
+ }
+ }
+
+ else
+ {
+
+ if(extract_post < 0)
+ {
+
+ return in[_row-1];
+
+ }
+ else
+ {
+ return in[(_row)*(_column-1)];
+
+ }
+
+
+
+ }
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/ddiagina.c b/2.3-1/src/c/matrixOperations/diag/ddiagina.c
new file mode 100644
index 00000000..c4093b2d
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/ddiagina.c
@@ -0,0 +1,59 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+#include<stdlib.h> // Used for Absolute value of insert_post
+void ddiagina(double *in, int _row,int _column,int insert_post,double *out)
+{
+
+ int i, j;
+ if(_row == 1)
+ {
+ _column = _column;
+
+ }
+ else
+ {
+ _column = _row;
+
+ }
+
+ for(i=0;i < ((_column+abs(insert_post))*(_column+abs(insert_post)));i++)
+ {
+ out[i] = 0;
+
+ }
+
+ if(insert_post < 0)
+ {
+ for ( j = 0 ; j < _column ; j++ )
+ {
+
+
+
+ out[((_column+abs(insert_post))*j)+abs(insert_post)+j] = in[j];
+ }
+
+ }
+ else
+ {
+ for ( j = insert_post ; j < _column+insert_post ; j++ )
+ {
+
+
+ out[((_column+insert_post)*j)-insert_post+j] = in[j-insert_post] ;
+
+ }
+ }
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/ddiagins.c b/2.3-1/src/c/matrixOperations/diag/ddiagins.c
new file mode 100644
index 00000000..d1fc527a
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/ddiagins.c
@@ -0,0 +1,37 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+void ddiagins(double *in, int size,double *out)
+{
+
+ int i, j;
+ for ( i = 0 ; i < size ; i++ )
+ {
+ for ( j = 0 ; j < size ; j++ )
+ {
+ if(i==j)
+ {
+ out[(size+1)*i] = in[i] ;
+ /* Because to replace the diagonal element with input matrix, (_coulmn+1)*i gives the diagonal postion for m*n matrix
+ i.e if 3*3 matrix then diagonal postion will be 0,4,6 and for 4*4 matrix diagonal postion will be 0,5,10,15 */
+
+
+ }
+
+ }
+ }
+
+
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/ddiags.c b/2.3-1/src/c/matrixOperations/diag/ddiags.c
new file mode 100644
index 00000000..b43e5d63
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/ddiags.c
@@ -0,0 +1,20 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+double ddiags(double in)
+{
+
+ return in;
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/i16diaga.c b/2.3-1/src/c/matrixOperations/diag/i16diaga.c
new file mode 100644
index 00000000..29f92907
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/i16diaga.c
@@ -0,0 +1,40 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+#include<stdlib.h> // Used for Absolute value of insert_post
+void i16diaga(int16 in, int size,int insert_post,int16 *out)
+{
+
+ int i;
+
+ for(i=0;i < ((size+abs(insert_post))*(size+abs(insert_post)));i++)
+ {
+ out[i] = 0;
+
+ }
+
+ if(insert_post < 0)
+ {
+
+ out[abs(insert_post)] = in;
+
+ }
+ else
+ {
+
+ out[(size + insert_post)*insert_post] = in;
+
+ }
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/i16diagexa.c b/2.3-1/src/c/matrixOperations/diag/i16diagexa.c
new file mode 100644
index 00000000..7e85c916
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/i16diagexa.c
@@ -0,0 +1,130 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+void i16diagexa(int16 *in, int _row,int _column,int extract_post,int16 *out)
+{
+
+
+ int j;
+ if(_row == _column)
+ {
+ if(extract_post <= 0)
+ {
+ for ( j = 0 ; j < _column ; j++ )
+ {
+
+
+ out[j] = in[((_column+1)*j)-extract_post] ;
+
+ }
+ }
+ else
+ {
+ for ( j = extract_post ; j < _column ; j++ )
+ {
+
+
+ out[j-extract_post] = in[((_column+1)*j)-extract_post] ;
+
+ }
+ }
+
+ }
+ else if(_row > _column)
+ {
+
+ if(extract_post >=0)
+ {
+
+ for(j = extract_post; j < _column;j++)
+ {
+
+ out[j-extract_post] = in[((_row+1)*j)-extract_post];
+ }
+
+
+ }
+ else
+ {
+
+ if((abs(extract_post) <= (_row - _column)))
+ {
+ for(j = 0; j < _column ; j++)
+ {
+ out[j] = in[((_row+1)*j)-extract_post];
+
+ }
+ }
+ else
+ {
+
+ for(j=0; j < (_row + extract_post);j++)
+ {
+
+ out[j] = in[((_row+1)*j)-extract_post];
+
+ }
+
+
+
+ }
+
+ }
+
+ }
+ else if (_row < _column)
+ {
+
+ if(extract_post > 0)
+ {
+ if((extract_post <= (_column - _row)))
+ {
+ for(j=extract_post;j < _column;j++)
+ {
+ out[j-extract_post] = in[((_row+1)*j)-extract_post];
+ }
+
+ }
+ else
+ {
+ for(j=extract_post;j < _column;j++)
+ {
+ out[j-extract_post] = in[((_row+1)*j)-extract_post];
+ }
+
+ }
+
+ }
+ else
+ {
+
+
+ for(j=0;j < (_row+extract_post);j++)
+ {
+
+ out[j] = in[((_row+1)*j)-extract_post];
+
+
+
+ }
+
+
+
+ }
+
+
+ }
+
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/i16diagexs.c b/2.3-1/src/c/matrixOperations/diag/i16diagexs.c
new file mode 100644
index 00000000..87536ce1
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/i16diagexs.c
@@ -0,0 +1,53 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+int16 i16diagexs(int16 *in, int _row,int _column,int extract_post)
+{
+
+ if(_row == _column)
+ {
+
+ if(extract_post < 0)
+ {
+
+ return in[_row-1] ;
+ }
+ else
+ {
+
+ return in[(_row)*(_row-1)] ;
+
+ }
+ }
+
+ else
+ {
+
+ if(extract_post < 0)
+ {
+
+ return in[_row-1];
+
+ }
+ else
+ {
+ return in[(_row)*(_column-1)];
+
+ }
+
+
+
+ }
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/i16diagina.c b/2.3-1/src/c/matrixOperations/diag/i16diagina.c
new file mode 100644
index 00000000..518f627c
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/i16diagina.c
@@ -0,0 +1,58 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+#include<stdlib.h> // Used for Absolute value of insert_post
+void i16diagina(int16 *in, int _row,int _column,int insert_post,int16 *out)
+{
+ int i, j;
+ if(_row == 1)
+ {
+ _column = _column;
+
+ }
+ else
+ {
+ _column = _row;
+
+ }
+
+ for(i=0;i < ((_column+abs(insert_post))*(_column+abs(insert_post)));i++)
+ {
+ out[i] = 0;
+
+ }
+
+ if(insert_post < 0)
+ {
+ for ( j = 0 ; j < _column ; j++ )
+ {
+
+
+
+ out[((_column+abs(insert_post))*j)+abs(insert_post)+j] = in[j];
+ }
+
+ }
+ else
+ {
+ for ( j = insert_post ; j < _column+insert_post ; j++ )
+ {
+
+
+ out[((_column+insert_post)*j)-insert_post+j] = in[j-insert_post] ;
+
+ }
+ }
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/i16diagins.c b/2.3-1/src/c/matrixOperations/diag/i16diagins.c
new file mode 100644
index 00000000..f0d46eb9
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/i16diagins.c
@@ -0,0 +1,37 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+void i16diagins(int16 *in, int size,int16 *out)
+{
+
+ int i, j;
+ for ( i = 0 ; i < size ; i++ )
+ {
+ for ( j = 0 ; j < size ; j++ )
+ {
+ if(i==j)
+ {
+ out[(size+1)*i] = in[i] ;
+ /* Because to replace the diagonal element with input matrix, (_coulmn+1)*i gives the diagonal postion for m*n matrix
+ i.e if 3*3 matrix then diagonal postion will be 0,4,6 and for 4*4 matrix diagonal postion will be 0,5,10,15 */
+
+
+ }
+
+ }
+ }
+
+
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/i16diags.c b/2.3-1/src/c/matrixOperations/diag/i16diags.c
new file mode 100644
index 00000000..b08657f5
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/i16diags.c
@@ -0,0 +1,20 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+int16 i16diags(int16 in)
+{
+
+ return in;
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/i8diaga.c b/2.3-1/src/c/matrixOperations/diag/i8diaga.c
new file mode 100644
index 00000000..c41ec9df
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/i8diaga.c
@@ -0,0 +1,40 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+#include<stdlib.h> // Used for Absolute value of insert_post
+void i8diaga(int8 in, int size,int insert_post,int8 *out)
+{
+
+ int i;
+
+ for(i=0;i < ((size+abs(insert_post))*(size+abs(insert_post)));i++)
+ {
+ out[i] = 0;
+
+ }
+
+ if(insert_post < 0)
+ {
+
+ out[abs(insert_post)] = in;
+
+ }
+ else
+ {
+
+ out[(size + insert_post)*insert_post] = in;
+
+ }
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/i8diagexa.c b/2.3-1/src/c/matrixOperations/diag/i8diagexa.c
new file mode 100644
index 00000000..56fab854
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/i8diagexa.c
@@ -0,0 +1,130 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+void i8diagexa(int8 *in, int _row,int _column,int extract_post,int8 *out)
+{
+
+
+ int j;
+ if(_row == _column)
+ {
+ if(extract_post <= 0)
+ {
+ for ( j = 0 ; j < _column ; j++ )
+ {
+
+
+ out[j] = in[((_column+1)*j)-extract_post] ;
+
+ }
+ }
+ else
+ {
+ for ( j = extract_post ; j < _column ; j++ )
+ {
+
+
+ out[j-extract_post] = in[((_column+1)*j)-extract_post] ;
+
+ }
+ }
+
+ }
+ else if(_row > _column)
+ {
+
+ if(extract_post >=0)
+ {
+
+ for(j = extract_post; j < _column;j++)
+ {
+
+ out[j-extract_post] = in[((_row+1)*j)-extract_post];
+ }
+
+
+ }
+ else
+ {
+
+ if((abs(extract_post) <= (_row - _column)))
+ {
+ for(j = 0; j < _column ; j++)
+ {
+ out[j] = in[((_row+1)*j)-extract_post];
+
+ }
+ }
+ else
+ {
+
+ for(j=0; j < (_row + extract_post);j++)
+ {
+
+ out[j] = in[((_row+1)*j)-extract_post];
+
+ }
+
+
+
+ }
+
+ }
+
+ }
+ else if (_row < _column)
+ {
+
+ if(extract_post > 0)
+ {
+ if((extract_post <= (_column - _row)))
+ {
+ for(j=extract_post;j < _column;j++)
+ {
+ out[j-extract_post] = in[((_row+1)*j)-extract_post];
+ }
+
+ }
+ else
+ {
+ for(j=extract_post;j < _column;j++)
+ {
+ out[j-extract_post] = in[((_row+1)*j)-extract_post];
+ }
+
+ }
+
+ }
+ else
+ {
+
+
+ for(j=0;j < (_row+extract_post);j++)
+ {
+
+ out[j] = in[((_row+1)*j)-extract_post];
+
+
+
+ }
+
+
+
+ }
+
+
+ }
+
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/i8diagexs.c b/2.3-1/src/c/matrixOperations/diag/i8diagexs.c
new file mode 100644
index 00000000..6aa76049
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/i8diagexs.c
@@ -0,0 +1,53 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+int8 i8diagexs(int8 *in, int _row,int _column,int extract_post)
+{
+
+ if(_row == _column)
+ {
+
+ if(extract_post < 0)
+ {
+
+ return in[_row-1] ;
+ }
+ else
+ {
+
+ return in[(_row)*(_row-1)] ;
+
+ }
+ }
+
+ else
+ {
+
+ if(extract_post < 0)
+ {
+
+ return in[_row-1];
+
+ }
+ else
+ {
+ return in[(_row)*(_column-1)];
+
+ }
+
+
+
+ }
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/i8diagina.c b/2.3-1/src/c/matrixOperations/diag/i8diagina.c
new file mode 100644
index 00000000..77a7e074
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/i8diagina.c
@@ -0,0 +1,58 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+#include<stdlib.h> // Used for Absolute value of insert_post
+void i8diagina(int8 *in, int _row,int _column,int insert_post,int8 *out)
+{
+ int i, j;
+ if(_row == 1)
+ {
+ _column = _column;
+
+ }
+ else
+ {
+ _column = _row;
+
+ }
+
+ for(i=0;i < ((_column+abs(insert_post))*(_column+abs(insert_post)));i++)
+ {
+ out[i] = 0;
+
+ }
+
+ if(insert_post < 0)
+ {
+ for ( j = 0 ; j < _column ; j++ )
+ {
+
+
+
+ out[((_column+abs(insert_post))*j)+abs(insert_post)+j] = in[j];
+ }
+
+ }
+ else
+ {
+ for ( j = insert_post ; j < _column+insert_post ; j++ )
+ {
+
+
+ out[((_column+insert_post)*j)-insert_post+j] = in[j-insert_post] ;
+
+ }
+ }
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/i8diagins.c b/2.3-1/src/c/matrixOperations/diag/i8diagins.c
new file mode 100644
index 00000000..adb7eb96
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/i8diagins.c
@@ -0,0 +1,37 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+void i8diagins(int8 *in, int size,int8 *out)
+{
+
+ int i, j;
+ for ( i = 0 ; i < size ; i++ )
+ {
+ for ( j = 0 ; j < size ; j++ )
+ {
+ if(i==j)
+ {
+ out[(size+1)*i] = in[i] ;
+ /* Because to replace the diagonal element with input matrix, (_coulmn+1)*i gives the diagonal postion for m*n matrix
+ i.e if 3*3 matrix then diagonal postion will be 0,4,6 and for 4*4 matrix diagonal postion will be 0,5,10,15 */
+
+
+ }
+
+ }
+ }
+
+
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/i8diags.c b/2.3-1/src/c/matrixOperations/diag/i8diags.c
new file mode 100644
index 00000000..d4e44894
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/i8diags.c
@@ -0,0 +1,20 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+int8 i8diags(int8 in)
+{
+
+ return in;
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/u16diaga.c b/2.3-1/src/c/matrixOperations/diag/u16diaga.c
new file mode 100644
index 00000000..90a10536
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/u16diaga.c
@@ -0,0 +1,40 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+#include<stdlib.h> // Used for Absolute value of insert_post
+void u16diaga(uint16 in, int size,int insert_post,uint16 *out)
+{
+
+ int i;
+
+ for(i=0;i < ((size+abs(insert_post))*(size+abs(insert_post)));i++)
+ {
+ out[i] = 0;
+
+ }
+
+ if(insert_post < 0)
+ {
+
+ out[abs(insert_post)] = in;
+
+ }
+ else
+ {
+
+ out[(size + insert_post)*insert_post] = in;
+
+ }
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/u16diagexa.c b/2.3-1/src/c/matrixOperations/diag/u16diagexa.c
new file mode 100644
index 00000000..da2088c5
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/u16diagexa.c
@@ -0,0 +1,130 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+void u16diagexa(uint16 *in, int _row,int _column,int extract_post,uint16 *out)
+{
+
+
+ int j;
+ if(_row == _column)
+ {
+ if(extract_post <= 0)
+ {
+ for ( j = 0 ; j < _column ; j++ )
+ {
+
+
+ out[j] = in[((_column+1)*j)-extract_post] ;
+
+ }
+ }
+ else
+ {
+ for ( j = extract_post ; j < _column ; j++ )
+ {
+
+
+ out[j-extract_post] = in[((_column+1)*j)-extract_post] ;
+
+ }
+ }
+
+ }
+ else if(_row > _column)
+ {
+
+ if(extract_post >=0)
+ {
+
+ for(j = extract_post; j < _column;j++)
+ {
+
+ out[j-extract_post] = in[((_row+1)*j)-extract_post];
+ }
+
+
+ }
+ else
+ {
+
+ if((abs(extract_post) <= (_row - _column)))
+ {
+ for(j = 0; j < _column ; j++)
+ {
+ out[j] = in[((_row+1)*j)-extract_post];
+
+ }
+ }
+ else
+ {
+
+ for(j=0; j < (_row + extract_post);j++)
+ {
+
+ out[j] = in[((_row+1)*j)-extract_post];
+
+ }
+
+
+
+ }
+
+ }
+
+ }
+ else if (_row < _column)
+ {
+
+ if(extract_post > 0)
+ {
+ if((extract_post <= (_column - _row)))
+ {
+ for(j=extract_post;j < _column;j++)
+ {
+ out[j-extract_post] = in[((_row+1)*j)-extract_post];
+ }
+
+ }
+ else
+ {
+ for(j=extract_post;j < _column;j++)
+ {
+ out[j-extract_post] = in[((_row+1)*j)-extract_post];
+ }
+
+ }
+
+ }
+ else
+ {
+
+
+ for(j=0;j < (_row+extract_post);j++)
+ {
+
+ out[j] = in[((_row+1)*j)-extract_post];
+
+
+
+ }
+
+
+
+ }
+
+
+ }
+
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/u16diagexs.c b/2.3-1/src/c/matrixOperations/diag/u16diagexs.c
new file mode 100644
index 00000000..c32849e6
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/u16diagexs.c
@@ -0,0 +1,53 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+uint16 u16diagexs(uint16 *in, int _row,int _column,int extract_post)
+{
+
+ if(_row == _column)
+ {
+
+ if(extract_post < 0)
+ {
+
+ return in[_row-1] ;
+ }
+ else
+ {
+
+ return in[(_row)*(_row-1)] ;
+
+ }
+ }
+
+ else
+ {
+
+ if(extract_post < 0)
+ {
+
+ return in[_row-1];
+
+ }
+ else
+ {
+ return in[(_row)*(_column-1)];
+
+ }
+
+
+
+ }
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/u16diagina.c b/2.3-1/src/c/matrixOperations/diag/u16diagina.c
new file mode 100644
index 00000000..f5dc6f99
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/u16diagina.c
@@ -0,0 +1,58 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+#include<stdlib.h> // Used for Absolute value of insert_post
+void u16diagina(uint16 *in, int _row,int _column,int insert_post,uint16 *out)
+{
+ int i, j;
+ if(_row == 1)
+ {
+ _column = _column;
+
+ }
+ else
+ {
+ _column = _row;
+
+ }
+
+ for(i=0;i < ((_column+abs(insert_post))*(_column+abs(insert_post)));i++)
+ {
+ out[i] = 0;
+
+ }
+
+ if(insert_post < 0)
+ {
+ for ( j = 0 ; j < _column ; j++ )
+ {
+
+
+
+ out[((_column+abs(insert_post))*j)+abs(insert_post)+j] = in[j];
+ }
+
+ }
+ else
+ {
+ for ( j = insert_post ; j < _column+insert_post ; j++ )
+ {
+
+
+ out[((_column+insert_post)*j)-insert_post+j] = in[j-insert_post] ;
+
+ }
+ }
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/u16diagins.c b/2.3-1/src/c/matrixOperations/diag/u16diagins.c
new file mode 100644
index 00000000..84cfcb29
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/u16diagins.c
@@ -0,0 +1,37 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+void u16diagins(uint16 *in, int size,uint16 *out)
+{
+
+ int i, j;
+ for ( i = 0 ; i < size ; i++ )
+ {
+ for ( j = 0 ; j < size ; j++ )
+ {
+ if(i==j)
+ {
+ out[(size+1)*i] = in[i] ;
+ /* Because to replace the diagonal element with input matrix, (_coulmn+1)*i gives the diagonal postion for m*n matrix
+ i.e if 3*3 matrix then diagonal postion will be 0,4,6 and for 4*4 matrix diagonal postion will be 0,5,10,15 */
+
+
+ }
+
+ }
+ }
+
+
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/u16diags.c b/2.3-1/src/c/matrixOperations/diag/u16diags.c
new file mode 100644
index 00000000..0f463b09
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/u16diags.c
@@ -0,0 +1,20 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+uint16 u16diags(uint16 in)
+{
+
+ return in;
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/u8diaga.c b/2.3-1/src/c/matrixOperations/diag/u8diaga.c
new file mode 100644
index 00000000..05a03ba2
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/u8diaga.c
@@ -0,0 +1,40 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+#include<stdlib.h> // Used for Absolute value of insert_post
+void u8diaga(uint8 in, int size,int insert_post,uint8 *out)
+{
+
+ int i;
+
+ for(i=0;i < ((size+abs(insert_post))*(size+abs(insert_post)));i++)
+ {
+ out[i] = 0;
+
+ }
+
+ if(insert_post < 0)
+ {
+
+ out[abs(insert_post)] = in;
+
+ }
+ else
+ {
+
+ out[(size + insert_post)*insert_post] = in;
+
+ }
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/u8diagexa.c b/2.3-1/src/c/matrixOperations/diag/u8diagexa.c
new file mode 100644
index 00000000..258e10b0
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/u8diagexa.c
@@ -0,0 +1,130 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+void u8diagexa(uint8 *in, int _row,int _column,int extract_post,uint8 *out)
+{
+
+
+ int j;
+ if(_row == _column)
+ {
+ if(extract_post <= 0)
+ {
+ for ( j = 0 ; j < _column ; j++ )
+ {
+
+
+ out[j] = in[((_column+1)*j)-extract_post] ;
+
+ }
+ }
+ else
+ {
+ for ( j = extract_post ; j < _column ; j++ )
+ {
+
+
+ out[j-extract_post] = in[((_column+1)*j)-extract_post] ;
+
+ }
+ }
+
+ }
+ else if(_row > _column)
+ {
+
+ if(extract_post >=0)
+ {
+
+ for(j = extract_post; j < _column;j++)
+ {
+
+ out[j-extract_post] = in[((_row+1)*j)-extract_post];
+ }
+
+
+ }
+ else
+ {
+
+ if((abs(extract_post) <= (_row - _column)))
+ {
+ for(j = 0; j < _column ; j++)
+ {
+ out[j] = in[((_row+1)*j)-extract_post];
+
+ }
+ }
+ else
+ {
+
+ for(j=0; j < (_row + extract_post);j++)
+ {
+
+ out[j] = in[((_row+1)*j)-extract_post];
+
+ }
+
+
+
+ }
+
+ }
+
+ }
+ else if (_row < _column)
+ {
+
+ if(extract_post > 0)
+ {
+ if((extract_post <= (_column - _row)))
+ {
+ for(j=extract_post;j < _column;j++)
+ {
+ out[j-extract_post] = in[((_row+1)*j)-extract_post];
+ }
+
+ }
+ else
+ {
+ for(j=extract_post;j < _column;j++)
+ {
+ out[j-extract_post] = in[((_row+1)*j)-extract_post];
+ }
+
+ }
+
+ }
+ else
+ {
+
+
+ for(j=0;j < (_row+extract_post);j++)
+ {
+
+ out[j] = in[((_row+1)*j)-extract_post];
+
+
+
+ }
+
+
+
+ }
+
+
+ }
+
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/u8diagexs.c b/2.3-1/src/c/matrixOperations/diag/u8diagexs.c
new file mode 100644
index 00000000..fbb2ef3f
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/u8diagexs.c
@@ -0,0 +1,53 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+uint8 u8diagexs(uint8 *in, int _row,int _column,int extract_post)
+{
+
+ if(_row == _column)
+ {
+
+ if(extract_post < 0)
+ {
+
+ return in[_row-1] ;
+ }
+ else
+ {
+
+ return in[(_row)*(_row-1)] ;
+
+ }
+ }
+
+ else
+ {
+
+ if(extract_post < 0)
+ {
+
+ return in[_row-1];
+
+ }
+ else
+ {
+ return in[(_row)*(_column-1)];
+
+ }
+
+
+
+ }
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/u8diagina.c b/2.3-1/src/c/matrixOperations/diag/u8diagina.c
new file mode 100644
index 00000000..bea24655
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/u8diagina.c
@@ -0,0 +1,58 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+#include<stdlib.h> // Used for Absolute value of insert_post
+void u8diagina(uint8 *in, int _row,int _column,int insert_post,uint8 *out)
+{
+ int i, j;
+ if(_row == 1)
+ {
+ _column = _column;
+
+ }
+ else
+ {
+ _column = _row;
+
+ }
+
+ for(i=0;i < ((_column+abs(insert_post))*(_column+abs(insert_post)));i++)
+ {
+ out[i] = 0;
+
+ }
+
+ if(insert_post < 0)
+ {
+ for ( j = 0 ; j < _column ; j++ )
+ {
+
+
+
+ out[((_column+abs(insert_post))*j)+abs(insert_post)+j] = in[j];
+ }
+
+ }
+ else
+ {
+ for ( j = insert_post ; j < _column+insert_post ; j++ )
+ {
+
+
+ out[((_column+insert_post)*j)-insert_post+j] = in[j-insert_post] ;
+
+ }
+ }
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/u8diagins.c b/2.3-1/src/c/matrixOperations/diag/u8diagins.c
new file mode 100644
index 00000000..f2765952
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/u8diagins.c
@@ -0,0 +1,37 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+void u8diagins(uint8 *in, int size,uint8 *out)
+{
+
+ int i, j;
+ for ( i = 0 ; i < size ; i++ )
+ {
+ for ( j = 0 ; j < size ; j++ )
+ {
+ if(i==j)
+ {
+ out[(size+1)*i] = in[i] ;
+ /* Because to replace the diagonal element with input matrix, (_coulmn+1)*i gives the diagonal postion for m*n matrix
+ i.e if 3*3 matrix then diagonal postion will be 0,4,6 and for 4*4 matrix diagonal postion will be 0,5,10,15 */
+
+
+ }
+
+ }
+ }
+
+
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/diag/u8diags.c b/2.3-1/src/c/matrixOperations/diag/u8diags.c
new file mode 100644
index 00000000..97d2e515
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/diag/u8diags.c
@@ -0,0 +1,20 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include "diag.h"
+uint8 u8diags(uint8 in)
+{
+
+ return in;
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/division/i16ldivma.c b/2.3-1/src/c/matrixOperations/division/i16ldivma.c
new file mode 100644
index 00000000..e5a134d0
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/division/i16ldivma.c
@@ -0,0 +1,111 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include "matrixDivision.h"
+#include "lapack.h"
+
+void i16ldivma (int16* in1, int lines1, int columns1 ,
+ int16* in2, int lines2, int columns2 ,
+ int16* out ){
+
+
+ char cNorm = 0;
+ int iExit = 0;
+
+ /*temporary variables*/
+ int iWork = 0;
+ int iInfo = 0;
+ int iMax = 0;
+ int16 dblRcond = 0;
+
+ int16 dblEps = 0;
+ int16 dblAnorm = 0;
+
+ int16 *pAf = NULL;
+ int16 *pXb = NULL;
+ int16 *pDwork = NULL;
+
+ int *pRank = NULL;
+ int *pIpiv = NULL;
+ int *pJpvt = NULL;
+ int *pIwork = NULL;
+
+ iWork = max(4 * columns1, max(min(lines1, columns1) + 3 * lines1 + 1, 2 * min(lines1, columns1) + columns2));
+
+
+ lines2 = 0 ;
+
+ /* Array allocations*/
+ pAf = (int16*)malloc(sizeof(int16) * (unsigned int) lines1 * (unsigned int) columns1);
+ pXb = (int16*)malloc(sizeof(int16) * (unsigned int) max(lines1,columns1) * (unsigned int) columns2);
+
+ pRank = (int*)malloc(sizeof(int));
+ pIpiv = (int*)malloc(sizeof(int) *(unsigned int) columns1);
+ pJpvt = (int*)malloc(sizeof(int) *(unsigned int) columns1);
+ pIwork = (int*)malloc(sizeof(int) *(unsigned int) columns1);
+
+
+
+ cNorm = '1';
+ pDwork = (int16*)malloc(sizeof(int16) *(unsigned int)iWork);
+ dblEps = getRelativeMachinePrecision() ;
+
+ dblAnorm = dlange_(&cNorm, &lines1, &columns1, in1, &lines1, pDwork);
+ if(lines1 == columns1)
+ {
+ cNorm = 'F';
+ dlacpy_(&cNorm, &columns1, &columns1, in1, &columns1, pAf, &columns1);
+ dgetrf_(&columns1, &columns1, pAf, &columns1, pIpiv, &iInfo);
+ if(iInfo == 0)
+ {
+ cNorm = '1';
+ C2F(dgecon)(&cNorm, &columns1, pAf, &columns1, &dblAnorm, &dblRcond, pDwork, pIwork, &iInfo);
+ if(dblRcond > sqrt(dblEps))
+ {
+ cNorm = 'N';
+ C2F(dgetrs)(&cNorm, &columns1, &columns2, pAf, &columns1, pIpiv, in2, &columns1, &iInfo);
+ cNorm = 'F';
+ C2F(dlacpy)(&cNorm, &columns1, &columns2, in2, &columns1, out, &columns1);
+ iExit = 1;
+ }
+ }
+
+ }
+
+ if(iExit == 0)
+ {
+ dblRcond = sqrt(dblEps);
+ cNorm = 'F';
+ iMax = max(lines1, columns1);
+ C2F(dlacpy)(&cNorm, &lines1, &columns2, in2, &lines1, pXb, &iMax);
+ memset(pJpvt, 0x00,(unsigned int) sizeof(int) * (unsigned int) columns1);
+ C2F(dgelsy)( &lines1, &columns1, &columns2, in1, &lines1, pXb, &iMax,
+ pJpvt, &dblRcond, &pRank[0], pDwork, &iWork, &iInfo);
+
+ if(iInfo == 0)
+ {
+
+ cNorm = 'F';
+ C2F(dlacpy)(&cNorm, &columns1, &columns2, pXb, &iMax, out, &columns1);
+ }
+ }
+
+ free(pAf);
+ free(pXb);
+ free(pRank);
+ free(pIpiv);
+ free(pJpvt);
+ free(pIwork);
+ free(pDwork);
+}
diff --git a/2.3-1/src/c/matrixOperations/division/i16rdivma.c b/2.3-1/src/c/matrixOperations/division/i16rdivma.c
new file mode 100644
index 00000000..21f6cc94
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/division/i16rdivma.c
@@ -0,0 +1,129 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+#include <stdlib.h>
+#include <string.h>
+#include "matrixDivision.h"
+#include "lapack.h"
+
+void i16rdivma ( int16 * in1, int lines1, int columns1,
+ int16 * in2, int lines2, int columns2,
+ int16 * out){
+
+ char cNorm = 0;
+ int iExit = 0;
+
+ /*temporary variables*/
+ int iWork = 0;
+ int iInfo = 0;
+ int iMax = 0;
+ int16 dblRcond = 0;
+
+ int16 dblEps = 0;
+ int16 dblAnorm = 0;
+
+ int16 *pAf = NULL;
+ int16 *pAt = NULL;
+ int16 *pBt = NULL;
+ int16 *pDwork = NULL;
+
+ int *pRank = NULL;
+ int *pIpiv = NULL;
+ int *pJpvt = NULL;
+ int *pIwork = NULL;
+
+ iWork = max(4 * columns2, max(min(lines2, columns2) + 3 * lines2 + 1, 2 * min(lines2, columns2) + lines1));
+
+
+ /* Array allocations*/
+ pAf = (int16*)malloc(sizeof(int16) * (unsigned int)columns2 * (unsigned int)lines2);
+ pAt = (int16*)malloc(sizeof(int16) * (unsigned int)columns2 *(unsigned int) lines2);
+ pBt = (int16*)malloc(sizeof(int16) * (unsigned int)max(lines2,columns2) * (unsigned int)lines1);
+
+ pRank = (int*)malloc(sizeof(int));
+ pIpiv = (int*)malloc(sizeof(int) * (unsigned int)columns2);
+ pJpvt = (int*)malloc(sizeof(int) * (unsigned int)lines2);
+ pIwork = (int*)malloc(sizeof(int) * (unsigned int)columns2);
+
+
+ cNorm = '1';
+ pDwork = (int16*)malloc(sizeof(int16) * (unsigned int)iWork);
+ dblEps = getRelativeMachinePrecision() ;
+ dblAnorm = dlange_(&cNorm, &lines2, &columns1, in2, &lines2, pDwork);
+
+ /*tranpose A and B*/
+
+ dtransposea(in2, lines2, columns2, pAt);
+ dtransposea(in1, lines1, columns2, pBt);
+
+ if(lines2 == columns2)
+ {
+ cNorm = 'F';
+ dlacpy_(&cNorm, &columns2, &columns2, pAt, &columns2, pAf, &columns2);
+ dgetrf_(&columns2, &columns2, pAf, &columns2, pIpiv, &iInfo);
+ if(iInfo == 0)
+ {
+ cNorm = '1';
+ dgecon_(&cNorm, &columns2, pAf, &columns2, &dblAnorm, &dblRcond, pDwork, pIwork, &iInfo);
+ if(dblRcond > sqrt(dblEps))
+ {
+ cNorm = 'N';
+ dgetrs_(&cNorm, &columns2, &lines1, pAf, &columns2, pIpiv, pBt, &columns2, &iInfo);
+ dtransposea(pBt, columns2, lines1, out);
+ iExit = 1;
+ }
+ }
+
+ }
+
+ if(iExit == 0)
+ {
+ dblRcond = sqrt(dblEps);
+ cNorm = 'F';
+ iMax = max(lines2, columns2);
+ memset(pJpvt, 0x00, (unsigned int)sizeof(int) * (unsigned int)lines2);
+ dgelsy_(&columns2, &lines2, &lines1, pAt, &columns2, pBt, &iMax,
+ pJpvt, &dblRcond, &pRank[0], pDwork, &iWork, &iInfo);
+
+ if(iInfo == 0)
+ {
+
+
+ /* TransposeRealMatrix(pBt, lines1, lines2, out, Max(lines1,columns1), lines2);*/
+
+ /*Mega caca de la mort qui tue des ours a mains nues
+ mais je ne sais pas comment le rendre "beau" :(*/
+ {
+ int i,j,ij,ji;
+ for(j = 0 ; j < lines2 ; j++)
+ {
+ for(i = 0 ; i < lines1 ; i++)
+ {
+ ij = i + j * lines1;
+ ji = j + i * max(lines2, columns2);
+ out[ij] = pBt[ji];
+ }
+ }
+ }
+ }
+ }
+
+ free(pAf);
+ free(pAt);
+ free(pBt);
+ free(pRank);
+ free(pIpiv);
+ free(pJpvt);
+ free(pIwork);
+ free(pDwork);
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/division/i16rdivv.c b/2.3-1/src/c/matrixOperations/division/i16rdivv.c
new file mode 100644
index 00000000..72d3bd60
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/division/i16rdivv.c
@@ -0,0 +1,24 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2009 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+
+#include "matrixDivision.h"
+
+int16 i16rdivv(int16 *in1, int16 *in2, int size){
+
+ int16 out[1] = { 0.0} ;
+ i16rdivma ( in1,1 ,size ,in2 , 1 , size , out );
+
+ return out[0] ;
+}
+
+
diff --git a/2.3-1/src/c/matrixOperations/division/i8ldivma.c b/2.3-1/src/c/matrixOperations/division/i8ldivma.c
new file mode 100644
index 00000000..85271c6b
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/division/i8ldivma.c
@@ -0,0 +1,111 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include "matrixDivision.h"
+#include "lapack.h"
+
+void i8ldivma (int8* in1, int lines1, int columns1 ,
+ int8* in2, int lines2, int columns2 ,
+ int8* out ){
+
+
+ char cNorm = 0;
+ int iExit = 0;
+
+ /*temporary variables*/
+ int iWork = 0;
+ int iInfo = 0;
+ int iMax = 0;
+ int8 dblRcond = 0;
+
+ int8 dblEps = 0;
+ int8 dblAnorm = 0;
+
+ int8 *pAf = NULL;
+ int8 *pXb = NULL;
+ int8 *pDwork = NULL;
+
+ int *pRank = NULL;
+ int *pIpiv = NULL;
+ int *pJpvt = NULL;
+ int *pIwork = NULL;
+
+ iWork = max(4 * columns1, max(min(lines1, columns1) + 3 * lines1 + 1, 2 * min(lines1, columns1) + columns2));
+
+
+ lines2 = 0 ;
+
+ /* Array allocations*/
+ pAf = (int8*)malloc(sizeof(int8) * (unsigned int) lines1 * (unsigned int) columns1);
+ pXb = (int8*)malloc(sizeof(int8) * (unsigned int) max(lines1,columns1) * (unsigned int) columns2);
+
+ pRank = (int*)malloc(sizeof(int));
+ pIpiv = (int*)malloc(sizeof(int) *(unsigned int) columns1);
+ pJpvt = (int*)malloc(sizeof(int) *(unsigned int) columns1);
+ pIwork = (int*)malloc(sizeof(int) *(unsigned int) columns1);
+
+
+
+ cNorm = '1';
+ pDwork = (int8*)malloc(sizeof(int8) *(unsigned int)iWork);
+ dblEps = getRelativeMachinePrecision() ;
+
+ dblAnorm = dlange_(&cNorm, &lines1, &columns1, in1, &lines1, pDwork);
+ if(lines1 == columns1)
+ {
+ cNorm = 'F';
+ dlacpy_(&cNorm, &columns1, &columns1, in1, &columns1, pAf, &columns1);
+ dgetrf_(&columns1, &columns1, pAf, &columns1, pIpiv, &iInfo);
+ if(iInfo == 0)
+ {
+ cNorm = '1';
+ C2F(dgecon)(&cNorm, &columns1, pAf, &columns1, &dblAnorm, &dblRcond, pDwork, pIwork, &iInfo);
+ if(dblRcond > sqrt(dblEps))
+ {
+ cNorm = 'N';
+ C2F(dgetrs)(&cNorm, &columns1, &columns2, pAf, &columns1, pIpiv, in2, &columns1, &iInfo);
+ cNorm = 'F';
+ C2F(dlacpy)(&cNorm, &columns1, &columns2, in2, &columns1, out, &columns1);
+ iExit = 1;
+ }
+ }
+
+ }
+
+ if(iExit == 0)
+ {
+ dblRcond = sqrt(dblEps);
+ cNorm = 'F';
+ iMax = max(lines1, columns1);
+ C2F(dlacpy)(&cNorm, &lines1, &columns2, in2, &lines1, pXb, &iMax);
+ memset(pJpvt, 0x00,(unsigned int) sizeof(int) * (unsigned int) columns1);
+ C2F(dgelsy)( &lines1, &columns1, &columns2, in1, &lines1, pXb, &iMax,
+ pJpvt, &dblRcond, &pRank[0], pDwork, &iWork, &iInfo);
+
+ if(iInfo == 0)
+ {
+
+ cNorm = 'F';
+ C2F(dlacpy)(&cNorm, &columns1, &columns2, pXb, &iMax, out, &columns1);
+ }
+ }
+
+ free(pAf);
+ free(pXb);
+ free(pRank);
+ free(pIpiv);
+ free(pJpvt);
+ free(pIwork);
+ free(pDwork);
+}
diff --git a/2.3-1/src/c/matrixOperations/division/i8rdivma.c b/2.3-1/src/c/matrixOperations/division/i8rdivma.c
new file mode 100644
index 00000000..5095d9c6
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/division/i8rdivma.c
@@ -0,0 +1,129 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+#include <stdlib.h>
+#include <string.h>
+#include "matrixDivision.h"
+#include "lapack.h"
+
+void i8rdivma ( int8 * in1, int lines1, int columns1,
+ int8 * in2, int lines2, int columns2,
+ int8 * out){
+
+ char cNorm = 0;
+ int iExit = 0;
+
+ /*temporary variables*/
+ int iWork = 0;
+ int iInfo = 0;
+ int iMax = 0;
+ int8 dblRcond = 0;
+
+ int8 dblEps = 0;
+ int8 dblAnorm = 0;
+
+ int8 *pAf = NULL;
+ int8 *pAt = NULL;
+ int8 *pBt = NULL;
+ int8 *pDwork = NULL;
+
+ int *pRank = NULL;
+ int *pIpiv = NULL;
+ int *pJpvt = NULL;
+ int *pIwork = NULL;
+
+ iWork = max(4 * columns2, max(min(lines2, columns2) + 3 * lines2 + 1, 2 * min(lines2, columns2) + lines1));
+
+
+ /* Array allocations*/
+ pAf = (int8*)malloc(sizeof(int8) * (unsigned int)columns2 * (unsigned int)lines2);
+ pAt = (int8*)malloc(sizeof(int8) * (unsigned int)columns2 *(unsigned int) lines2);
+ pBt = (int8*)malloc(sizeof(int8) * (unsigned int)max(lines2,columns2) * (unsigned int)lines1);
+
+ pRank = (int*)malloc(sizeof(int));
+ pIpiv = (int*)malloc(sizeof(int) * (unsigned int)columns2);
+ pJpvt = (int*)malloc(sizeof(int) * (unsigned int)lines2);
+ pIwork = (int*)malloc(sizeof(int) * (unsigned int)columns2);
+
+
+ cNorm = '1';
+ pDwork = (int8*)malloc(sizeof(int8) * (unsigned int)iWork);
+ dblEps = getRelativeMachinePrecision() ;
+ dblAnorm = dlange_(&cNorm, &lines2, &columns1, in2, &lines2, pDwork);
+
+ /*tranpose A and B*/
+
+ dtransposea(in2, lines2, columns2, pAt);
+ dtransposea(in1, lines1, columns2, pBt);
+
+ if(lines2 == columns2)
+ {
+ cNorm = 'F';
+ dlacpy_(&cNorm, &columns2, &columns2, pAt, &columns2, pAf, &columns2);
+ dgetrf_(&columns2, &columns2, pAf, &columns2, pIpiv, &iInfo);
+ if(iInfo == 0)
+ {
+ cNorm = '1';
+ dgecon_(&cNorm, &columns2, pAf, &columns2, &dblAnorm, &dblRcond, pDwork, pIwork, &iInfo);
+ if(dblRcond > sqrt(dblEps))
+ {
+ cNorm = 'N';
+ dgetrs_(&cNorm, &columns2, &lines1, pAf, &columns2, pIpiv, pBt, &columns2, &iInfo);
+ dtransposea(pBt, columns2, lines1, out);
+ iExit = 1;
+ }
+ }
+
+ }
+
+ if(iExit == 0)
+ {
+ dblRcond = sqrt(dblEps);
+ cNorm = 'F';
+ iMax = max(lines2, columns2);
+ memset(pJpvt, 0x00, (unsigned int)sizeof(int) * (unsigned int)lines2);
+ dgelsy_(&columns2, &lines2, &lines1, pAt, &columns2, pBt, &iMax,
+ pJpvt, &dblRcond, &pRank[0], pDwork, &iWork, &iInfo);
+
+ if(iInfo == 0)
+ {
+
+
+ /* TransposeRealMatrix(pBt, lines1, lines2, out, Max(lines1,columns1), lines2);*/
+
+ /*Mega caca de la mort qui tue des ours a mains nues
+ mais je ne sais pas comment le rendre "beau" :(*/
+ {
+ int i,j,ij,ji;
+ for(j = 0 ; j < lines2 ; j++)
+ {
+ for(i = 0 ; i < lines1 ; i++)
+ {
+ ij = i + j * lines1;
+ ji = j + i * max(lines2, columns2);
+ out[ij] = pBt[ji];
+ }
+ }
+ }
+ }
+ }
+
+ free(pAf);
+ free(pAt);
+ free(pBt);
+ free(pRank);
+ free(pIpiv);
+ free(pJpvt);
+ free(pIwork);
+ free(pDwork);
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/division/i8rdivv.c b/2.3-1/src/c/matrixOperations/division/i8rdivv.c
new file mode 100644
index 00000000..04c6c49e
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/division/i8rdivv.c
@@ -0,0 +1,24 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2009 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+
+#include "matrixDivision.h"
+
+int8 i8rdivv(int8 *in1, int8 *in2, int size){
+
+ int8 out[1] = { 0.0} ;
+ i8rdivma ( in1,1 ,size ,in2 , 1 , size , out );
+
+ return out[0] ;
+}
+
+
diff --git a/2.3-1/src/c/matrixOperations/division/u16ldivma.c b/2.3-1/src/c/matrixOperations/division/u16ldivma.c
new file mode 100644
index 00000000..fde268fe
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/division/u16ldivma.c
@@ -0,0 +1,111 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include "matrixDivision.h"
+#include "lapack.h"
+
+void u16ldivma (uint16* in1, int lines1, int columns1 ,
+ uint16* in2, int lines2, int columns2 ,
+ uint16* out ){
+
+
+ char cNorm = 0;
+ int iExit = 0;
+
+ /*temporary variables*/
+ int iWork = 0;
+ int iInfo = 0;
+ int iMax = 0;
+ uint16 dblRcond = 0;
+
+ uint16 dblEps = 0;
+ uint16 dblAnorm = 0;
+
+ uint16 *pAf = NULL;
+ uint16 *pXb = NULL;
+ uint16 *pDwork = NULL;
+
+ int *pRank = NULL;
+ int *pIpiv = NULL;
+ int *pJpvt = NULL;
+ int *pIwork = NULL;
+
+ iWork = max(4 * columns1, max(min(lines1, columns1) + 3 * lines1 + 1, 2 * min(lines1, columns1) + columns2));
+
+
+ lines2 = 0 ;
+
+ /* Array allocations*/
+ pAf = (uint16*)malloc(sizeof(uint16) * (unsigned int) lines1 * (unsigned int) columns1);
+ pXb = (uint16*)malloc(sizeof(uint16) * (unsigned int) max(lines1,columns1) * (unsigned int) columns2);
+
+ pRank = (int*)malloc(sizeof(int));
+ pIpiv = (int*)malloc(sizeof(int) *(unsigned int) columns1);
+ pJpvt = (int*)malloc(sizeof(int) *(unsigned int) columns1);
+ pIwork = (int*)malloc(sizeof(int) *(unsigned int) columns1);
+
+
+
+ cNorm = '1';
+ pDwork = (uint16*)malloc(sizeof(uint16) *(unsigned int)iWork);
+ dblEps = getRelativeMachinePrecision() ;
+
+ dblAnorm = dlange_(&cNorm, &lines1, &columns1, in1, &lines1, pDwork);
+ if(lines1 == columns1)
+ {
+ cNorm = 'F';
+ dlacpy_(&cNorm, &columns1, &columns1, in1, &columns1, pAf, &columns1);
+ dgetrf_(&columns1, &columns1, pAf, &columns1, pIpiv, &iInfo);
+ if(iInfo == 0)
+ {
+ cNorm = '1';
+ C2F(dgecon)(&cNorm, &columns1, pAf, &columns1, &dblAnorm, &dblRcond, pDwork, pIwork, &iInfo);
+ if(dblRcond > sqrt(dblEps))
+ {
+ cNorm = 'N';
+ C2F(dgetrs)(&cNorm, &columns1, &columns2, pAf, &columns1, pIpiv, in2, &columns1, &iInfo);
+ cNorm = 'F';
+ C2F(dlacpy)(&cNorm, &columns1, &columns2, in2, &columns1, out, &columns1);
+ iExit = 1;
+ }
+ }
+
+ }
+
+ if(iExit == 0)
+ {
+ dblRcond = sqrt(dblEps);
+ cNorm = 'F';
+ iMax = max(lines1, columns1);
+ C2F(dlacpy)(&cNorm, &lines1, &columns2, in2, &lines1, pXb, &iMax);
+ memset(pJpvt, 0x00,(unsigned int) sizeof(int) * (unsigned int) columns1);
+ C2F(dgelsy)( &lines1, &columns1, &columns2, in1, &lines1, pXb, &iMax,
+ pJpvt, &dblRcond, &pRank[0], pDwork, &iWork, &iInfo);
+
+ if(iInfo == 0)
+ {
+
+ cNorm = 'F';
+ C2F(dlacpy)(&cNorm, &columns1, &columns2, pXb, &iMax, out, &columns1);
+ }
+ }
+
+ free(pAf);
+ free(pXb);
+ free(pRank);
+ free(pIpiv);
+ free(pJpvt);
+ free(pIwork);
+ free(pDwork);
+}
diff --git a/2.3-1/src/c/matrixOperations/division/u16rdivma.c b/2.3-1/src/c/matrixOperations/division/u16rdivma.c
new file mode 100644
index 00000000..a77db453
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/division/u16rdivma.c
@@ -0,0 +1,129 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+#include <stdlib.h>
+#include <string.h>
+#include "matrixDivision.h"
+#include "lapack.h"
+
+void u16rdivma ( uint16 * in1, int lines1, int columns1,
+ uint16 * in2, int lines2, int columns2,
+ uint16 * out){
+
+ char cNorm = 0;
+ int iExit = 0;
+
+ /*temporary variables*/
+ int iWork = 0;
+ int iInfo = 0;
+ int iMax = 0;
+ uint16 dblRcond = 0;
+
+ uint16 dblEps = 0;
+ uint16 dblAnorm = 0;
+
+ uint16 *pAf = NULL;
+ uint16 *pAt = NULL;
+ uint16 *pBt = NULL;
+ uint16 *pDwork = NULL;
+
+ int *pRank = NULL;
+ int *pIpiv = NULL;
+ int *pJpvt = NULL;
+ int *pIwork = NULL;
+
+ iWork = max(4 * columns2, max(min(lines2, columns2) + 3 * lines2 + 1, 2 * min(lines2, columns2) + lines1));
+
+
+ /* Array allocations*/
+ pAf = (uint16*)malloc(sizeof(uint16) * (unsigned int)columns2 * (unsigned int)lines2);
+ pAt = (uint16*)malloc(sizeof(uint16) * (unsigned int)columns2 *(unsigned int) lines2);
+ pBt = (uint16*)malloc(sizeof(uint16) * (unsigned int)max(lines2,columns2) * (unsigned int)lines1);
+
+ pRank = (int*)malloc(sizeof(int));
+ pIpiv = (int*)malloc(sizeof(int) * (unsigned int)columns2);
+ pJpvt = (int*)malloc(sizeof(int) * (unsigned int)lines2);
+ pIwork = (int*)malloc(sizeof(int) * (unsigned int)columns2);
+
+
+ cNorm = '1';
+ pDwork = (uint16*)malloc(sizeof(uint16) * (unsigned int)iWork);
+ dblEps = getRelativeMachinePrecision() ;
+ dblAnorm = dlange_(&cNorm, &lines2, &columns1, in2, &lines2, pDwork);
+
+ /*tranpose A and B*/
+
+ dtransposea(in2, lines2, columns2, pAt);
+ dtransposea(in1, lines1, columns2, pBt);
+
+ if(lines2 == columns2)
+ {
+ cNorm = 'F';
+ dlacpy_(&cNorm, &columns2, &columns2, pAt, &columns2, pAf, &columns2);
+ dgetrf_(&columns2, &columns2, pAf, &columns2, pIpiv, &iInfo);
+ if(iInfo == 0)
+ {
+ cNorm = '1';
+ dgecon_(&cNorm, &columns2, pAf, &columns2, &dblAnorm, &dblRcond, pDwork, pIwork, &iInfo);
+ if(dblRcond > sqrt(dblEps))
+ {
+ cNorm = 'N';
+ dgetrs_(&cNorm, &columns2, &lines1, pAf, &columns2, pIpiv, pBt, &columns2, &iInfo);
+ dtransposea(pBt, columns2, lines1, out);
+ iExit = 1;
+ }
+ }
+
+ }
+
+ if(iExit == 0)
+ {
+ dblRcond = sqrt(dblEps);
+ cNorm = 'F';
+ iMax = max(lines2, columns2);
+ memset(pJpvt, 0x00, (unsigned int)sizeof(int) * (unsigned int)lines2);
+ dgelsy_(&columns2, &lines2, &lines1, pAt, &columns2, pBt, &iMax,
+ pJpvt, &dblRcond, &pRank[0], pDwork, &iWork, &iInfo);
+
+ if(iInfo == 0)
+ {
+
+
+ /* TransposeRealMatrix(pBt, lines1, lines2, out, Max(lines1,columns1), lines2);*/
+
+ /*Mega caca de la mort qui tue des ours a mains nues
+ mais je ne sais pas comment le rendre "beau" :(*/
+ {
+ int i,j,ij,ji;
+ for(j = 0 ; j < lines2 ; j++)
+ {
+ for(i = 0 ; i < lines1 ; i++)
+ {
+ ij = i + j * lines1;
+ ji = j + i * max(lines2, columns2);
+ out[ij] = pBt[ji];
+ }
+ }
+ }
+ }
+ }
+
+ free(pAf);
+ free(pAt);
+ free(pBt);
+ free(pRank);
+ free(pIpiv);
+ free(pJpvt);
+ free(pIwork);
+ free(pDwork);
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/division/u16rdivv.c b/2.3-1/src/c/matrixOperations/division/u16rdivv.c
new file mode 100644
index 00000000..9fc292c7
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/division/u16rdivv.c
@@ -0,0 +1,24 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2009 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+
+#include "matrixDivision.h"
+
+uint16 u16rdivv(uint16 *in1, uint16 *in2, int size){
+
+ uint16 out[1] = { 0.0} ;
+ u16rdivma ( in1,1 ,size ,in2 , 1 , size , out );
+
+ return out[0] ;
+}
+
+
diff --git a/2.3-1/src/c/matrixOperations/division/u8ldivma.c b/2.3-1/src/c/matrixOperations/division/u8ldivma.c
new file mode 100644
index 00000000..a046fb41
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/division/u8ldivma.c
@@ -0,0 +1,111 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include "matrixDivision.h"
+#include "lapack.h"
+
+void u8ldivma (uint8* in1, int lines1, int columns1 ,
+ uint8* in2, int lines2, int columns2 ,
+ uint8* out ){
+
+
+ char cNorm = 0;
+ int iExit = 0;
+
+ /*temporary variables*/
+ int iWork = 0;
+ int iInfo = 0;
+ int iMax = 0;
+ uint8 dblRcond = 0;
+
+ uint8 dblEps = 0;
+ uint8 dblAnorm = 0;
+
+ uint8 *pAf = NULL;
+ uint8 *pXb = NULL;
+ uint8 *pDwork = NULL;
+
+ int *pRank = NULL;
+ int *pIpiv = NULL;
+ int *pJpvt = NULL;
+ int *pIwork = NULL;
+
+ iWork = max(4 * columns1, max(min(lines1, columns1) + 3 * lines1 + 1, 2 * min(lines1, columns1) + columns2));
+
+
+ lines2 = 0 ;
+
+ /* Array allocations*/
+ pAf = (uint8*)malloc(sizeof(uint8) * (unsigned int) lines1 * (unsigned int) columns1);
+ pXb = (uint8*)malloc(sizeof(uint8) * (unsigned int) max(lines1,columns1) * (unsigned int) columns2);
+
+ pRank = (int*)malloc(sizeof(int));
+ pIpiv = (int*)malloc(sizeof(int) *(unsigned int) columns1);
+ pJpvt = (int*)malloc(sizeof(int) *(unsigned int) columns1);
+ pIwork = (int*)malloc(sizeof(int) *(unsigned int) columns1);
+
+
+
+ cNorm = '1';
+ pDwork = (uint8*)malloc(sizeof(uint8) *(unsigned int)iWork);
+ dblEps = getRelativeMachinePrecision() ;
+
+ dblAnorm = dlange_(&cNorm, &lines1, &columns1, in1, &lines1, pDwork);
+ if(lines1 == columns1)
+ {
+ cNorm = 'F';
+ dlacpy_(&cNorm, &columns1, &columns1, in1, &columns1, pAf, &columns1);
+ dgetrf_(&columns1, &columns1, pAf, &columns1, pIpiv, &iInfo);
+ if(iInfo == 0)
+ {
+ cNorm = '1';
+ C2F(dgecon)(&cNorm, &columns1, pAf, &columns1, &dblAnorm, &dblRcond, pDwork, pIwork, &iInfo);
+ if(dblRcond > sqrt(dblEps))
+ {
+ cNorm = 'N';
+ C2F(dgetrs)(&cNorm, &columns1, &columns2, pAf, &columns1, pIpiv, in2, &columns1, &iInfo);
+ cNorm = 'F';
+ C2F(dlacpy)(&cNorm, &columns1, &columns2, in2, &columns1, out, &columns1);
+ iExit = 1;
+ }
+ }
+
+ }
+
+ if(iExit == 0)
+ {
+ dblRcond = sqrt(dblEps);
+ cNorm = 'F';
+ iMax = max(lines1, columns1);
+ C2F(dlacpy)(&cNorm, &lines1, &columns2, in2, &lines1, pXb, &iMax);
+ memset(pJpvt, 0x00,(unsigned int) sizeof(int) * (unsigned int) columns1);
+ C2F(dgelsy)( &lines1, &columns1, &columns2, in1, &lines1, pXb, &iMax,
+ pJpvt, &dblRcond, &pRank[0], pDwork, &iWork, &iInfo);
+
+ if(iInfo == 0)
+ {
+
+ cNorm = 'F';
+ C2F(dlacpy)(&cNorm, &columns1, &columns2, pXb, &iMax, out, &columns1);
+ }
+ }
+
+ free(pAf);
+ free(pXb);
+ free(pRank);
+ free(pIpiv);
+ free(pJpvt);
+ free(pIwork);
+ free(pDwork);
+}
diff --git a/2.3-1/src/c/matrixOperations/division/u8rdivma.c b/2.3-1/src/c/matrixOperations/division/u8rdivma.c
new file mode 100644
index 00000000..478f6ac9
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/division/u8rdivma.c
@@ -0,0 +1,129 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+#include <stdlib.h>
+#include <string.h>
+#include "matrixDivision.h"
+#include "lapack.h"
+
+void u8rdivma ( uint8 * in1, int lines1, int columns1,
+ uint8 * in2, int lines2, int columns2,
+ uint8 * out){
+
+ char cNorm = 0;
+ int iExit = 0;
+
+ /*temporary variables*/
+ int iWork = 0;
+ int iInfo = 0;
+ int iMax = 0;
+ uint8 dblRcond = 0;
+
+ uint8 dblEps = 0;
+ uint8 dblAnorm = 0;
+
+ uint8 *pAf = NULL;
+ uint8 *pAt = NULL;
+ uint8 *pBt = NULL;
+ uint8 *pDwork = NULL;
+
+ int *pRank = NULL;
+ int *pIpiv = NULL;
+ int *pJpvt = NULL;
+ int *pIwork = NULL;
+
+ iWork = max(4 * columns2, max(min(lines2, columns2) + 3 * lines2 + 1, 2 * min(lines2, columns2) + lines1));
+
+
+ /* Array allocations*/
+ pAf = (uint8*)malloc(sizeof(uint8) * (unsigned int)columns2 * (unsigned int)lines2);
+ pAt = (uint8*)malloc(sizeof(uint8) * (unsigned int)columns2 *(unsigned int) lines2);
+ pBt = (uint8*)malloc(sizeof(uint8) * (unsigned int)max(lines2,columns2) * (unsigned int)lines1);
+
+ pRank = (int*)malloc(sizeof(int));
+ pIpiv = (int*)malloc(sizeof(int) * (unsigned int)columns2);
+ pJpvt = (int*)malloc(sizeof(int) * (unsigned int)lines2);
+ pIwork = (int*)malloc(sizeof(int) * (unsigned int)columns2);
+
+
+ cNorm = '1';
+ pDwork = (uint8*)malloc(sizeof(uint8) * (unsigned int)iWork);
+ dblEps = getRelativeMachinePrecision() ;
+ dblAnorm = dlange_(&cNorm, &lines2, &columns1, in2, &lines2, pDwork);
+
+ /*tranpose A and B*/
+
+ dtransposea(in2, lines2, columns2, pAt);
+ dtransposea(in1, lines1, columns2, pBt);
+
+ if(lines2 == columns2)
+ {
+ cNorm = 'F';
+ dlacpy_(&cNorm, &columns2, &columns2, pAt, &columns2, pAf, &columns2);
+ dgetrf_(&columns2, &columns2, pAf, &columns2, pIpiv, &iInfo);
+ if(iInfo == 0)
+ {
+ cNorm = '1';
+ dgecon_(&cNorm, &columns2, pAf, &columns2, &dblAnorm, &dblRcond, pDwork, pIwork, &iInfo);
+ if(dblRcond > sqrt(dblEps))
+ {
+ cNorm = 'N';
+ dgetrs_(&cNorm, &columns2, &lines1, pAf, &columns2, pIpiv, pBt, &columns2, &iInfo);
+ dtransposea(pBt, columns2, lines1, out);
+ iExit = 1;
+ }
+ }
+
+ }
+
+ if(iExit == 0)
+ {
+ dblRcond = sqrt(dblEps);
+ cNorm = 'F';
+ iMax = max(lines2, columns2);
+ memset(pJpvt, 0x00, (unsigned int)sizeof(int) * (unsigned int)lines2);
+ dgelsy_(&columns2, &lines2, &lines1, pAt, &columns2, pBt, &iMax,
+ pJpvt, &dblRcond, &pRank[0], pDwork, &iWork, &iInfo);
+
+ if(iInfo == 0)
+ {
+
+
+ /* TransposeRealMatrix(pBt, lines1, lines2, out, Max(lines1,columns1), lines2);*/
+
+ /*Mega caca de la mort qui tue des ours a mains nues
+ mais je ne sais pas comment le rendre "beau" :(*/
+ {
+ int i,j,ij,ji;
+ for(j = 0 ; j < lines2 ; j++)
+ {
+ for(i = 0 ; i < lines1 ; i++)
+ {
+ ij = i + j * lines1;
+ ji = j + i * max(lines2, columns2);
+ out[ij] = pBt[ji];
+ }
+ }
+ }
+ }
+ }
+
+ free(pAf);
+ free(pAt);
+ free(pBt);
+ free(pRank);
+ free(pIpiv);
+ free(pJpvt);
+ free(pIwork);
+ free(pDwork);
+
+}
+
diff --git a/2.3-1/src/c/matrixOperations/division/u8rdivv.c b/2.3-1/src/c/matrixOperations/division/u8rdivv.c
new file mode 100644
index 00000000..53ef809d
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/division/u8rdivv.c
@@ -0,0 +1,24 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2009 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+
+#include "matrixDivision.h"
+
+uint8 u8rdivv(uint8 *in1, uint8 *in2, int size){
+
+ uint8 out[1] = { 0.0} ;
+ u8rdivma ( in1,1 ,size ,in2 , 1 , size , out );
+
+ return out[0] ;
+}
+
+
diff --git a/2.3-1/src/c/matrixOperations/includes/diag.h b/2.3-1/src/c/matrixOperations/includes/diag.h
new file mode 100644
index 00000000..24c167af
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/includes/diag.h
@@ -0,0 +1,96 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Allan SIMON
+ *
+ * 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
+ *
+ */
+
+#ifndef __DIAG_H__
+#define __DIAG_H__
+
+#include "dynlib_matrixoperations.h"
+#include "types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EXTERN_MATOPS double ddiags(double in );
+
+EXTERN_MATOPS void ddiaga(double in, int size,int insert_post,double *out);
+
+EXTERN_MATOPS void ddiagina(double *in, int _row,int _column,int insert_post,double *out);
+
+EXTERN_MATOPS void ddiagins(double* in, int size, double* out );
+
+EXTERN_MATOPS void ddiagexa(double* in,int row,int column,int insert_pos,double* out);
+
+EXTERN_MATOPS double ddiagexs(double* in,int row,int column,int extract_pos);
+
+EXTERN_MATOPS uint8 u8diags(uint8 in );
+
+EXTERN_MATOPS void u8diaga(uint8 in, int size,int insert_post,uint8 *out);
+
+EXTERN_MATOPS void u8diagina(uint8 *in, int _row,int _column,int insert_post,uint8 *out);
+
+EXTERN_MATOPS void u8diagins(uint8* in, int size, uint8* out );
+
+EXTERN_MATOPS void u8diagexa(uint8* in,int row,int column,int insert_pos,uint8* out);
+
+EXTERN_MATOPS uint8 u8diagexs(uint8* in,int row,int column,int extract_pos);
+
+EXTERN_MATOPS uint16 u16diags(uint16 in );
+
+EXTERN_MATOPS void u16diaga(uint16 in, int size,int insert_post,uint16 *out);
+
+EXTERN_MATOPS void u16diagina(uint16 *in, int _row,int _column,int insert_post,uint16 *out);
+
+EXTERN_MATOPS void u16diagins(uint16* in, int size, uint16* out );
+
+EXTERN_MATOPS void u16diagexa(uint16* in,int row,int column,int insert_pos,uint16* out);
+
+EXTERN_MATOPS uint16 u16diagexs(uint16* in,int row,int column,int extract_pos);
+
+EXTERN_MATOPS int8 i8diags(int8 in );
+
+EXTERN_MATOPS void i8diaga(int8 in, int size,int insert_post,int8 *out);
+
+EXTERN_MATOPS void i8diagina(int8 *in, int _row,int _column,int insert_post,int8 *out);
+
+EXTERN_MATOPS void i8diagins(int8* in, int size, int8* out );
+
+EXTERN_MATOPS void i8diagexa(int8* in,int row,int column,int insert_pos,int8* out);
+
+EXTERN_MATOPS int8 i8diagexs(int8* in,int row,int column,int extract_pos);
+
+EXTERN_MATOPS int16 i16diags(int16 in );
+
+EXTERN_MATOPS void i16diaga(int16 in, int size,int insert_post,int16 *out);
+
+EXTERN_MATOPS void i16diagina(int16 *in, int _row,int _column,int insert_post,int16 *out);
+
+EXTERN_MATOPS void i16diagins(int16* in, int size, int16* out );
+
+EXTERN_MATOPS void i16diagexa(int16* in,int row,int column,int insert_pos,int16* out);
+
+EXTERN_MATOPS int16 i16diagexs(int16* in,int row,int column,int extract_pos);
+
+
+
+
+
+
+
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* !__DIAG_H__ */
+
diff --git a/2.3-1/src/c/matrixOperations/interfaces/int_diag.h b/2.3-1/src/c/matrixOperations/interfaces/int_diag.h
new file mode 100644
index 00000000..4d6553c5
--- /dev/null
+++ b/2.3-1/src/c/matrixOperations/interfaces/int_diag.h
@@ -0,0 +1,87 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET
+ *
+ * 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
+ *
+ */
+
+/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */
+
+#ifndef __INT_DIAG_H__
+#define __INT_DIAG_H__
+
+
+
+#define d0diagd0(in1) ddiags(in1)
+
+#define d0d0diagd0(in1,in2) ddiags(in1)
+
+#define d0d0diagd2(in1,in2,out) ddiaga(in1,1,in2,out)
+
+#define d2diagd2(in1,size,out) if(size[0] != size[1]) { (size[0]==1) ? ddiagins(in1,size[1],out) : ddiagins(in1,size[0],out); } else {ddiagexa(in1,size[0],size[1],0,out) ;}
+
+#define d2d0diagd2(in1,size,in2,out) if((size[0] != 1) && (size[1] != 1) ) { ddiagexa(in1,size[0],size[1],in2,out); } else { if(in2 != 0) {ddiagina(in1,size[0],size[1],in2,out);} else { (size[0] == 1) ? ddiagins(in1,size[1],out) : ddiagins(in1,size[0],out); };}
+
+#define d2d0diagd0(in1,size,in2) ddiagexs(in1,size[0],size[1],in2)
+
+
+
+#define u80diagu80(in1) u8diags(in1)
+
+#define u80d0diagu80(in1,in2) u8diags(in1)
+
+#define u80d0diagu82(in1,in2,out) u8diaga(in1,1,in2,out)
+
+#define u82diagu82(in1,size,out) if(size[0] != size[1]) { (size[0]==1) ? u8diagins(in1,size[1],out) : u8diagins(in1,size[0],out); } else {u8diagexa(in1,size[0],size[1],0,out) ;}
+
+#define u82d0diagu82(in1,size,in2,out) if((size[0] != 1) && (size[1] != 1) ) { u8diagexa(in1,size[0],size[1],in2,out); } else { if(in2 != 0) {u8diagina(in1,size[0],size[1],in2,out);} else { (size[0] == 1) ? u8diagins(in1,size[1],out) : u8diagins(in1,size[0],out); };}
+
+#define u82d0diagu80(in1,size,in2) u8diagexs(in1,size[0],size[1],in2)
+
+#define u160diagu160(in1) u16diags(in1)
+
+#define u160d0diagu160(in1,in2) u16diags(in1)
+
+#define u160d0diagu162(in1,in2,out) u16diaga(in1,1,in2,out)
+
+#define u162diagu162(in1,size,out) if(size[0] != size[1]) { (size[0]==1) ? u16diagins(in1,size[1],out) : u16diagins(in1,size[0],out); } else {u16diagexa(in1,size[0],size[1],0,out) ;}
+
+#define u162d0diagu162(in1,size,in2,out) if((size[0] != 1) && (size[1] != 1) ) { u16diagexa(in1,size[0],size[1],in2,out); } else { if(in2 != 0) {u16diagina(in1,size[0],size[1],in2,out);} else { (size[0] == 1) ? u16diagins(in1,size[1],out) : u16diagins(in1,size[0],out); };}
+
+#define u162d0diagu160(in1,size,in2) u16diagexs(in1,size[0],size[1],in2)
+
+
+
+#define i80diagi80(in1) i8diags(in1)
+
+#define i80d0diagi80(in1,in2) i8diags(in1)
+
+#define i80d0diagi82(in1,in2,out) i8diaga(in1,1,in2,out)
+
+#define i82diagi82(in1,size,out) if(size[0] != size[1]) { (size[0]==1) ? i8diagins(in1,size[1],out) : i8diagins(in1,size[0],out); } else {i8diagexa(in1,size[0],size[1],0,out) ;}
+
+#define i82d0diagi82(in1,size,in2,out) if((size[0] != 1) && (size[1] != 1) ) { i8diagexa(in1,size[0],size[1],in2,out); } else { if(in2 != 0) {i8diagina(in1,size[0],size[1],in2,out);} else { (size[0] == 1) ? i8diagins(in1,size[1],out) : i8diagins(in1,size[0],out); };}
+
+#define i82d0diagi80(in1,size,in2) i8diagexs(in1,size[0],size[1],in2)
+
+#define i160diagi160(in1) i16diags(in1)
+
+#define i160d0diagi160(in1,in2) i16diags(in1)
+
+#define i160d0diagi162(in1,in2,out) i16diaga(in1,1,in2,out)
+
+
+#define i162diagi162(in1,size,out) if(size[0] != size[1]) { (size[0]==1) ? i16diagins(in1,size[1],out) : i16diagins(in1,size[0],out); } else {i16diagexa(in1,size[0],size[1],0,out) ;}
+
+#define i162d0diagi162(in1,size,in2,out) if((size[0] != 1) && (size[1] != 1) ) { i16diagexa(in1,size[0],size[1],in2,out); } else { if(in2 != 0) {i16diagina(in1,size[0],size[1],in2,out);} else { (size[0] == 1) ? i16diagins(in1,size[1],out) : i16diagins(in1,size[0],out); };}
+
+#define i162d0diagi160(in1,size,in2) i16diagexs(in1,size[0],size[1],in2)
+
+
+
+#endif /* !__INT_DIAG_H__ */
diff --git a/2.3-1/src/c/operations/interfaces/int_OpLogOr.h b/2.3-1/src/c/operations/interfaces/int_OpLogOr.h
index 5618ff63..c7acb51d 100644
--- a/2.3-1/src/c/operations/interfaces/int_OpLogOr.h
+++ b/2.3-1/src/c/operations/interfaces/int_OpLogOr.h
@@ -95,28 +95,28 @@
/*scalar or matrix */
#define s0s2OpLogOrs2(in1, in2, size2, out) {int i = 0 ;\
- for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float(in1 != 0.2f || in2[i] != 0.2f);}
+ for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float(in1 != 0.0 || in2[i] != 0.0);}
#define d0d2OpLogOrd2(in1, in2, size2, out) {int i = 0 ;\
- for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double(in1 != 0.2 || in2[i] != 0.2);}
+ for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double(in1 != 0.0 || in2[i] != 0.0);}
#define c0c2OpLogOrs2(in1, in2, size2, out) {int i = 0 ;\
- for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float((creals(in1) != 0.2f || cimags(in1) != 0.2f) || (creals(in2[i]) != 0.2f || cimags(in2[i])));}
+ for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float((creals(in1) != 0.0 || cimags(in1) != 0.0) || (creals(in2[i]) != 0.0 || cimags(in2[i])));}
#define s0c2OpLogOrs2(in1, in2, size2, out) {int i = 0 ;\
- for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float(in1 != 0.2f && (creals(in2[i]) != 0.2f || cimags(in2[i])));}
+ for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float(in1 != 0.0 && (creals(in2[i]) != 0.0 || cimags(in2[i])));}
#define c0s2OpLogOrs2(in1, in2, size2, out) {int i = 0 ;\
- for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float((creals(in1) != 0.2f || cimags(in1) != 0.2f) && in2[i] != 0.2f);}
+ for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float((creals(in1) != 0.0 || cimags(in1) != 0.0) && in2[i] != 0.0);}
#define z0z2OpLogOrd2(in1, in2, size2, out) {int i = 0 ;\
- for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double((zreals(in1) != 0.2 || zimags(in1) != 0.2) && (zreals(in2[i]) != 0.2 || zimags(in2[i])));}
+ for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double((zreals(in1) != 0.0 || zimags(in1) != 0.0) && (zreals(in2[i]) != 0.0 || zimags(in2[i])));}
#define d0z2OpLogOrd2(in1, in2, size2, out) {int i = 0 ;\
- for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double(in1 != 0.2 && (zreals(in2[i]) != 0.2 || zimags(in2[i])));}
+ for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double(in1 != 0.0 && (zreals(in2[i]) != 0.0 || zimags(in2[i])));}
#define z0d2OpLogOrd2(in1, in2, size2, out) {int i = 0 ;\
- for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double((zreals(in1) != 0.2 || zimags(in1) != 0.2) && in2[i] != 0.2);}
+ for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double((zreals(in1) != 0.0 || zimags(in1) != 0.0) && in2[i] != 0.0);}
#define u80u82OpLogOru82(in1, in2, size2, out) {int i = 0 ;\
for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Uint8(in1 != 0 || in2[i] != 0);}
@@ -133,28 +133,28 @@
/*matrix or matrix */
#define s2s2OpLogOrs2(in1, size1, in2, size2, out) {int i = 0 ;\
- for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float(in1[i] != 0.2f || in2[i] != 0.2f);}
+ for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float(in1[i] != 0.0 || in2[i] != 0.0);}
#define d2d2OpLogOrd2(in1, size1, in2, size2, out) {int i = 0 ;\
- for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double(in1[i] != 0.2 || in2[i] != 0.2);}
+ for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double(in1[i] != 0.0 || in2[i] != 0.0);}
#define c2c2OpLogOrs2(in1, size1, in2, size2, out) {int i = 0 ;\
- for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float((creals(in1[i]) != 0.2f || cimags(in1[i]) != 0.2f) || (creals(in2[i]) != 0.2f || cimags(in2[i])));}
+ for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float((creals(in1[i]) != 0.0 || cimags(in1[i]) != 0.0) || (creals(in2[i]) != 0.0 || cimags(in2[i])));}
#define s2c2OpLogOrs2(in1, size1, in2, size2, out) {int i = 0 ;\
- for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float(in1[i] != 0.2f && (creals(in2[i]) != 0.2f || cimags(in2[i])));}
+ for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float(in1[i] != 0.0 && (creals(in2[i]) != 0.0 || cimags(in2[i])));}
#define c2s2OpLogOrs2(in1, size1, in2, size2, out) {int i = 0 ;\
- for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float((creals(in1[i]) != 0.2f || cimags(in1[i]) != 0.2f) && in2[i] != 0.2f);}
+ for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Float((creals(in1[i]) != 0.0 || cimags(in1[i]) != 0.0) && in2[i] != 0.0);}
#define z2z2OpLogOrd2(in1, size1, in2, size2, out) {int i = 0 ;\
- for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double((zreals(in1[i]) != 0.2 || zimags(in1[i]) != 0.2) && (zreals(in2[i]) != 0.2 || zimags(in2[i])));}
+ for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double((zreals(in1[i]) != 0.0 || zimags(in1[i]) != 0.0) && (zreals(in2[i]) != 0.0 || zimags(in2[i])));}
#define d2z2OpLogOrd2(in1, size1, in2, size2, out) {int i = 0 ;\
- for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double(in1[i] != 0.2 && (zreals(in2[i]) != 0.2 || zimags(in2[i])));}
+ for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double(in1[i] != 0.0 && (zreals(in2[i]) != 0.0 || zimags(in2[i])));}
#define z2d2OpLogOrd2(in1, size1, in2, size2, out) {int i = 0 ;\
- for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double((zreals(in1[i]) != 0.2 || zimags(in1[i]) != 0.2) && in2[i] != 0.2);}
+ for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double((zreals(in1[i]) != 0.0 || zimags(in1[i]) != 0.0) && in2[i] != 0.0);}
#define u82u82OpLogOru82(in1, size1, in2, size2, out) {int i = 0 ;\
for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Uint8(in1[i] != 0 || in2[i] != 0);}
diff --git a/2.3-1/src/c/scilab-arduino/cmd_analog_in/u8cmd_analog_ins.c b/2.3-1/src/c/scilab-arduino/cmd_analog_in/u8cmd_analog_ins.c
index ebfad618..29e6c0f7 100644
--- a/2.3-1/src/c/scilab-arduino/cmd_analog_in/u8cmd_analog_ins.c
+++ b/2.3-1/src/c/scilab-arduino/cmd_analog_in/u8cmd_analog_ins.c
@@ -11,6 +11,7 @@
*/
#include "cmd_analog_in.h"
+#include "Arduino.h"
uint16 u8cmd_analog_ins(uint8 board_no, uint8 pin)
{
diff --git a/2.3-1/src/c/scilab-arduino/cmd_analog_out/u8cmd_analog_outs.c b/2.3-1/src/c/scilab-arduino/cmd_analog_out/u8cmd_analog_outs.c
index 94d51f6f..aa7dac06 100644
--- a/2.3-1/src/c/scilab-arduino/cmd_analog_out/u8cmd_analog_outs.c
+++ b/2.3-1/src/c/scilab-arduino/cmd_analog_out/u8cmd_analog_outs.c
@@ -11,6 +11,7 @@
*/
#include "cmd_analog_out.h"
+#include "Arduino.h"
uint8 u8cmd_analog_outs(uint8 board_no, uint8 pin, uint8 value)
{
diff --git a/2.3-1/src/c/scilab-arduino/cmd_dcmotor_run/u8cmd_dcmotor_runs.c b/2.3-1/src/c/scilab-arduino/cmd_dcmotor_run/u8cmd_dcmotor_runs.c
index 93905c94..07798aba 100644
--- a/2.3-1/src/c/scilab-arduino/cmd_dcmotor_run/u8cmd_dcmotor_runs.c
+++ b/2.3-1/src/c/scilab-arduino/cmd_dcmotor_run/u8cmd_dcmotor_runs.c
@@ -11,6 +11,7 @@
*/
#include "cmd_dcmotor_run.h"
+#include "Arduino.h"
uint8 u8cmd_dcmotor_runs(uint8 board_no, uint8 motor_no, int16 duty)
{
diff --git a/2.3-1/src/c/scilab-arduino/cmd_dcmotor_setup/u8cmd_dcmotor_setups.c b/2.3-1/src/c/scilab-arduino/cmd_dcmotor_setup/u8cmd_dcmotor_setups.c
index 30b4b9b3..d1d0fea8 100644
--- a/2.3-1/src/c/scilab-arduino/cmd_dcmotor_setup/u8cmd_dcmotor_setups.c
+++ b/2.3-1/src/c/scilab-arduino/cmd_dcmotor_setup/u8cmd_dcmotor_setups.c
@@ -11,6 +11,7 @@
*/
#include "cmd_dcmotor_setup.h"
+#include "Arduino.h"
uint8 dcm_pin_1[4], dcm_pin_2[4], dcm_mode[4];
@@ -18,7 +19,7 @@ uint8 u8cmd_dcmotor_setups(uint8 board_no, uint8 driver_type, uint8 motor_no,\
uint8 pin_1, uint8 pin_2)
{
dcm_pin_1[motor_no] = pin_1;
- dcm_pin_2[motor_no] = pin_2;
+ dcm_pin_2[motor_no] = pin_2;
dcm_mode[motor_no] = driver_type;
//Initialise pins
diff --git a/2.3-1/src/c/scilab-arduino/cmd_digital_in/u8cmd_digital_ins.c b/2.3-1/src/c/scilab-arduino/cmd_digital_in/u8cmd_digital_ins.c
index 1d0036a4..129db1a9 100644
--- a/2.3-1/src/c/scilab-arduino/cmd_digital_in/u8cmd_digital_ins.c
+++ b/2.3-1/src/c/scilab-arduino/cmd_digital_in/u8cmd_digital_ins.c
@@ -11,6 +11,7 @@
*/
#include "cmd_digital_in.h"
+#include "Arduino.h"
uint8 u8cmd_digital_ins(uint8 board_no, uint8 pin)
{
diff --git a/2.3-1/src/c/scilab-arduino/cmd_servo_attach/u8cmd_servo_attach.cpp b/2.3-1/src/c/scilab-arduino/cmd_servo_attach/u8cmd_servo_attach.cpp
new file mode 100644
index 00000000..a89363ba
--- /dev/null
+++ b/2.3-1/src/c/scilab-arduino/cmd_servo_attach/u8cmd_servo_attach.cpp
@@ -0,0 +1,26 @@
+/*
+ Scilab2C FOSSEE IIT BOMBAY
+ */
+
+#include "cmd_servo_attach.h"
+#include "Arduino.h"
+#include<Servo.h>
+Servo servo1,servo2;
+uint8 u8cmd_servo_attach(uint8 h,uint8 servo_no)
+{
+ // h -> Board no. reserve for future use
+ // servo_no -> pin no.(9 and 10).
+ if(servo_no == 1)
+ {
+ servo1.attach(9);
+ servo1.write(0);
+ }
+ else
+ {
+ servo2.attach(10);
+ servo2.write(0);
+ }
+
+ return 0;
+}
+
diff --git a/2.3-1/src/c/scilab-arduino/cmd_servo_detach/u8cmd_servo_detach.cpp b/2.3-1/src/c/scilab-arduino/cmd_servo_detach/u8cmd_servo_detach.cpp
new file mode 100644
index 00000000..95faf4cd
--- /dev/null
+++ b/2.3-1/src/c/scilab-arduino/cmd_servo_detach/u8cmd_servo_detach.cpp
@@ -0,0 +1,24 @@
+/*
+ Scilab2C FOSSEE IIT BOMBAY
+ */
+#include "cmd_servo_detach.h"
+#include "Arduino.h"
+#include<Servo.h>
+Servo servo1,servo2;
+uint8 u8cmd_servo_detach(uint8 h,uint8 servo_no)
+{
+ // h -> Board no. reserve for future use
+ // servo_no -> pin no.(9 and 10).
+ if(servo_no == 1)
+ {
+ servo1.detach();
+ }
+
+ else
+ {
+ servo2.detach();
+ }
+
+ return 0;
+}
+
diff --git a/2.3-1/src/c/scilab-arduino/cmd_servo_move/u8cmd_servo_move.cpp b/2.3-1/src/c/scilab-arduino/cmd_servo_move/u8cmd_servo_move.cpp
new file mode 100644
index 00000000..e8874766
--- /dev/null
+++ b/2.3-1/src/c/scilab-arduino/cmd_servo_move/u8cmd_servo_move.cpp
@@ -0,0 +1,27 @@
+/*
+ Scilab2C FOSSEE IIT BOMBAY
+ */
+
+#include "cmd_servo_move.h"
+#include "Arduino.h"
+#include<Servo.h>
+Servo servo1,servo2;
+uint8 u8cmd_servo_move(uint8 h,uint8 servo_no,uint8 val)
+{
+ // h -> Board no. reserve for future use
+ // servo_no -> pin no.(9 and 10).
+ //val -> 0 to 180 angle of rotation
+ if (val>=0 && val<=180)
+ {
+ if (servo_no==1)
+ {
+ servo1.write(val);
+ }
+ else if (servo_no==2)
+ {
+ servo2.write(val);
+ }
+ }
+ return 0;
+}
+
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 4478fb09..5361fe80 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
@@ -15,7 +15,6 @@
#define __CMD_ANALOG_IN_H__
#include "types.h"
-#include "Arduino.h"
#ifdef __cplusplus
extern "C" {
diff --git a/2.3-1/src/c/scilab-arduino/includes/cmd_analog_out.h b/2.3-1/src/c/scilab-arduino/includes/cmd_analog_out.h
index e75c5a66..a0da68e1 100644
--- a/2.3-1/src/c/scilab-arduino/includes/cmd_analog_out.h
+++ b/2.3-1/src/c/scilab-arduino/includes/cmd_analog_out.h
@@ -15,8 +15,6 @@
#define __CMD_ANALOG_OUT_H__
#include "types.h"
-#include "Arduino.h"
-
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/2.3-1/src/c/scilab-arduino/includes/cmd_dcmotor_run.h b/2.3-1/src/c/scilab-arduino/includes/cmd_dcmotor_run.h
index 7631761b..82df60ad 100644
--- a/2.3-1/src/c/scilab-arduino/includes/cmd_dcmotor_run.h
+++ b/2.3-1/src/c/scilab-arduino/includes/cmd_dcmotor_run.h
@@ -15,7 +15,6 @@
#define __CMD_DCMOTOR_RUN_H__
#include "types.h"
-#include "Arduino.h"
#ifdef __cplusplus
extern "C" {
diff --git a/2.3-1/src/c/scilab-arduino/includes/cmd_dcmotor_setup.h b/2.3-1/src/c/scilab-arduino/includes/cmd_dcmotor_setup.h
index 94f5a161..66fa04e9 100644
--- a/2.3-1/src/c/scilab-arduino/includes/cmd_dcmotor_setup.h
+++ b/2.3-1/src/c/scilab-arduino/includes/cmd_dcmotor_setup.h
@@ -15,7 +15,6 @@
#define __CMD_DCMOTOR_SETUP_H__
#include "types.h"
-#include "Arduino.h"
#ifdef __cplusplus
extern "C" {
diff --git a/2.3-1/src/c/scilab-arduino/includes/cmd_digital_in.h b/2.3-1/src/c/scilab-arduino/includes/cmd_digital_in.h
index 9e809aa4..96fd24bb 100644
--- a/2.3-1/src/c/scilab-arduino/includes/cmd_digital_in.h
+++ b/2.3-1/src/c/scilab-arduino/includes/cmd_digital_in.h
@@ -15,7 +15,6 @@
#define __CMD_DIGITAL_IN_H__
#include "types.h"
-#include "Arduino.h"
#ifdef __cplusplus
extern "C" {
diff --git a/2.3-1/src/c/scilab-arduino/includes/cmd_digital_out.h b/2.3-1/src/c/scilab-arduino/includes/cmd_digital_out.h
index 49739b0c..ee459d18 100644
--- a/2.3-1/src/c/scilab-arduino/includes/cmd_digital_out.h
+++ b/2.3-1/src/c/scilab-arduino/includes/cmd_digital_out.h
@@ -15,7 +15,6 @@
#define __CMD_DIGITAL_OUT_H__
#include "types.h"
-#include "Arduino.h"
#ifdef __cplusplus
extern "C" {
diff --git a/2.3-1/src/c/scilab-arduino/includes/cmd_servo_attach.h b/2.3-1/src/c/scilab-arduino/includes/cmd_servo_attach.h
new file mode 100644
index 00000000..5dd3ed6b
--- /dev/null
+++ b/2.3-1/src/c/scilab-arduino/includes/cmd_servo_attach.h
@@ -0,0 +1,23 @@
+/*
+ Scilab2C FOSSEE IIT Bombay
+ */
+
+
+#ifndef __CMD_SERVO_ATTACH_H__
+#define __CMD_SERVO_ATTACH_H__
+
+#include "types.h"
+//#include <Servo.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern Servo servo1,servo2;
+
+uint8 u8cmd_servo_attach(uint8 h, uint8 servo_no );
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __CMD_DCMOTOR_SETUP_H__ */
diff --git a/2.3-1/src/c/scilab-arduino/includes/cmd_servo_detach.h b/2.3-1/src/c/scilab-arduino/includes/cmd_servo_detach.h
new file mode 100644
index 00000000..ce74d62d
--- /dev/null
+++ b/2.3-1/src/c/scilab-arduino/includes/cmd_servo_detach.h
@@ -0,0 +1,24 @@
+/*
+ Scilab2C FOSSEE IIT Bombay
+ */
+
+
+#ifndef __CMD_SERVO_DETACH_H__
+#define __CMD_SERVO_DETACH_H__
+
+#include "types.h"
+//#include<Servo.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern Servo servo1,servo2;
+
+uint8 u8cmd_servo_detach(uint8 h, uint8 servo_no );
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __CMD_DCMOTOR_SETUP_H__ */
diff --git a/2.3-1/src/c/scilab-arduino/includes/cmd_servo_move.h b/2.3-1/src/c/scilab-arduino/includes/cmd_servo_move.h
new file mode 100644
index 00000000..9013d3cc
--- /dev/null
+++ b/2.3-1/src/c/scilab-arduino/includes/cmd_servo_move.h
@@ -0,0 +1,24 @@
+/*
+ Scilab2C FOSSEE IIT Bombay
+ */
+
+
+#ifndef __CMD_SERVO_MOVE_H__
+#define __CMD_SERVO_MOVE_H__
+
+#include "types.h"
+//#include<Servo.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern Servo servo1,servo2;
+
+uint8 u8cmd_servo_move(uint8 h, uint8 servo_no,uint8 val);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __CMD_DCMOTOR_SETUP_H__ */
diff --git a/2.3-1/src/c/scilab-arduino/includes/sleep.h b/2.3-1/src/c/scilab-arduino/includes/sleep.h
index cde27164..4c8cbc29 100644
--- a/2.3-1/src/c/scilab-arduino/includes/sleep.h
+++ b/2.3-1/src/c/scilab-arduino/includes/sleep.h
@@ -15,8 +15,6 @@
#define __SLEEP_H__
#include "types.h"
-#include "Arduino.h"
-
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_analog_out.h b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_analog_out.h
index 09f5c6ea..ead26acd 100644
--- a/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_analog_out.h
+++ b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_analog_out.h
@@ -23,6 +23,9 @@ extern "C" {
#define d0d0d0cmd_analog_outu80(in1,in2,in3) u8cmd_analog_outs((uint8)in1,\
(uint8)in2,(uint8)in3)
+#define d0d0u80cmd_analog_outu80(in1,in2,in3) u8cmd_analog_outs((uint8)in1,\
+ (uint8)in2,(uint8)in3)
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_servo.h b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_servo.h
new file mode 100644
index 00000000..d99a0444
--- /dev/null
+++ b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_servo.h
@@ -0,0 +1,27 @@
+/*
+ Scilab2C FOSSEE IIT BOMBAY
+ */
+
+
+#ifndef __INT_CMD_SERVO_H__
+#define __INT_CMD_SERVO_H__
+
+#include "types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#define d0d0cmd_servo_attachu80(in1,in2) u8cmd_servo_attach((uint8)in1,(uint8)in2);
+
+#define d0d0cmd_servo_detachu80(in1,in2) u8cmd_servo_detach((uint8)in1,(uint8)in2);
+
+#define d0d0d0cmd_servo_moveu80(in1,in2,in3) u8cmd_servo_move((uint8)in1,(uint8)in2,(uint8)in3);
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __INT_CMD_DCMOTOR_H__ */
diff --git a/2.3-1/src/c/string/interfaces/int_string.h b/2.3-1/src/c/string/interfaces/int_string.h
index e90f1f98..7cea7799 100644
--- a/2.3-1/src/c/string/interfaces/int_string.h
+++ b/2.3-1/src/c/string/interfaces/int_string.h
@@ -17,36 +17,36 @@
#include <stdio.h>
-#define s0string(in,out) sstrings(in,out)
+#define s0stringg0(in,out) sstrings(in,out)
-#define d0string(in,out) dstrings(in,out)
+#define d0stringg0(in,out) dstrings(in,out)
-#define c0string(in,out) cstrings(in,out)
+#define c0stringg0(in,out) cstrings(in,out)
-#define z0string(in,out) zstrings(in,out)
+#define z0stringg0(in,out) zstrings(in,out)
-#define u80string(in,out) u8strings(in,out)
+#define u80stringg0(in,out) u8strings(in,out)
-#define i80string(in,out) i8strings(in,out)
+#define i80stringg0(in,out) i8strings(in,out)
-#define u160string(in,out) u16strings(in,out)
+#define u160stringg0(in,out) u16strings(in,out)
-#define i160string(in,out) i16strings(in,out)
+#define i160stringg0(in,out) i16strings(in,out)
-#define s2string(in,size,out) sstringa(in,size[0]*size[1],out)
+#define s2stringg2(in,size,out) sstringa(in,size[0]*size[1],out)
-#define d2string(in,size,out) dstringa(in,size[0]*size[1],out)
+#define d2stringg2(in,size,out) dstringa(in,size[0]*size[1],out)
-#define c2string(in,size,out) cstringa(in,size[0]*size[1],out)
+#define c2stringg2(in,size,out) cstringa(in,size[0]*size[1],out)
-#define z2string(in,size,out) zstringa(in,size[0]*size[1],out)
+#define z2stringg2(in,size,out) zstringa(in,size[0]*size[1],out)
-#define u82string(in,size,out) u8stringa(in,size[0]*size[1],out)
+#define u82stringg2(in,size,out) u8stringa(in,size[0]*size[1],out)
-#define i82string(in,size,out) i8stringa(in,size[0]*size[1],out)
+#define i82stringg2(in,size,out) i8stringa(in,size[0]*size[1],out)
-#define u162string(in,size,out) u16stringa(in,size[0]*size[1],out)
+#define u162stringg2(in,size,out) u16stringa(in,size[0]*size[1],out)
-#define i162string(in,size,out) i16stringa(in,size[0]*size[1],out)
+#define i162stringg2(in,size,out) i16stringa(in,size[0]*size[1],out)
#endif /* __INT_STRING_H__ */
diff --git a/README.md b/README.md
new file mode 100644
index 00000000..182480dc
--- /dev/null
+++ b/README.md
@@ -0,0 +1,22 @@
+# Scilab2C
+- - - - - -
+__A scilab to C conversion extention for scilab.__
+- - - - - -
+###How to use this toolbox ?
+1. Download the [Scilab 5.5.2](http://www.scilab.org/download/latest)
+2. Clone this repository.
+3. Copy this cloned repository at /pathuptoscilab/scilab-5.5.2/share/scilab/contrib
+4. Go to scilab console
+5. Change the directory to /pathuptoscilab/scilab-5.5.2/share/scilab/contrib/Scilab2C/2.3.1
+6. And execute the following two commands to load this toolbox in Scilab
+ * `` exec builder.sce ``
+ * `` exec loader.sce ``
+7. Scilab2c toolbox successfully loaded into Scilab.
+8. Run the ``sci2c_gui`` command in scilab console to open up the Scilab2C GUI
+9. Follow the user manual for further explorer to this toolbox
+
+# Thank you.
+
+
+
+