diff options
161 files changed, 4004 insertions, 580 deletions
diff --git a/2.3-1/includes/sci2clib.h b/2.3-1/includes/sci2clib.h index 65533aa8..c3617971 100644 --- a/2.3-1/includes/sci2clib.h +++ b/2.3-1/includes/sci2clib.h @@ -296,6 +296,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 Binary files differindex 8a4fc960..5f8c96b5 100644 --- a/2.3-1/macros/ASTManagement/AST2Ccode.bin +++ b/2.3-1/macros/ASTManagement/AST2Ccode.bin 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.bin b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin Binary files differindex d5d2e4ab..bfb9f7fe 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin +++ b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin diff --git a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci index f6ae58e7..7d940b84 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 Binary files differindex 36d91dec..06ca43d1 100644 --- a/2.3-1/macros/ASTManagement/lib +++ b/2.3-1/macros/ASTManagement/lib diff --git a/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.bin b/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.bin Binary files differindex cf4ea0e4..d5648f44 100644 --- a/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.bin +++ b/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.bin diff --git a/2.3-1/macros/CCodeGeneration/lib b/2.3-1/macros/CCodeGeneration/lib Binary files differindex 9007df7e..f91bc268 100644 --- a/2.3-1/macros/CCodeGeneration/lib +++ b/2.3-1/macros/CCodeGeneration/lib diff --git a/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.bin b/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.bin Binary files differindex 1deaff60..39d97b24 100644 --- a/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.bin +++ b/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.bin diff --git a/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.sci b/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.sci index 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 Binary files differindex 91cd951d..c01ff59d 100644 --- a/2.3-1/macros/FunctionAnnotation/FA_SZ_1.bin +++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_1.bin 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 Binary files differindex 099f1d66..00834df4 100644 --- a/2.3-1/macros/FunctionAnnotation/FA_SZ_2.bin +++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_2.bin 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 Binary files differnew file mode 100644 index 00000000..68d6a37c --- /dev/null +++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_COLUMN_DIAG.bin 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 Binary files differnew file mode 100644 index 00000000..6d883096 --- /dev/null +++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_COLUMN_DIAG_INS_EXT.bin 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 Binary files differnew file mode 100644 index 00000000..e39a0be3 --- /dev/null +++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_COL_DIAG_IN_EX.bin 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 Binary files differindex 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 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_ROW_COLUMN.bin b/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN.bin Binary files differnew file mode 100644 index 00000000..edba674a --- /dev/null +++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN.bin 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_COLUMN_CAT.bin b/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN_CAT.bin Binary files differnew file mode 100644 index 00000000..2373b813 --- /dev/null +++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN_CAT.bin diff --git a/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_DIAG.bin b/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_DIAG.bin Binary files differnew file mode 100644 index 00000000..7fc7dcc8 --- /dev/null +++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_DIAG.bin 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 Binary files differnew file mode 100644 index 00000000..046b4b78 --- /dev/null +++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_DIAG_INS_EXT.bin 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/FunctionAnnotation/lib b/2.3-1/macros/FunctionAnnotation/lib Binary files differindex c2025c87..11e8b990 100644 --- a/2.3-1/macros/FunctionAnnotation/lib +++ b/2.3-1/macros/FunctionAnnotation/lib diff --git a/2.3-1/macros/FunctionAnnotation/names b/2.3-1/macros/FunctionAnnotation/names index d9300d20..2df2ed28 100644 --- a/2.3-1/macros/FunctionAnnotation/names +++ b/2.3-1/macros/FunctionAnnotation/names @@ -12,6 +12,8 @@ FA_REAL FA_SUB FA_SZ_1 FA_SZ_2 +FA_SZ_COLUMN_DIAG +FA_SZ_COL_DIAG_IN_EX FA_SZ_FROM_VAL FA_SZ_OPAPEX FA_SZ_OPBACKSLASH @@ -37,6 +39,10 @@ FA_SZ_OPPLUSA FA_SZ_OPRC FA_SZ_OPSLASH FA_SZ_OPSTAR +FA_SZ_ROW_COLUMN +FA_SZ_ROW_COLUMN_CAT +FA_SZ_ROW_DIAG +FA_SZ_ROW_DIAG_INS_EXT FA_SZ_SEL1 FA_SZ_SEL2 FA_TP_C diff --git a/2.3-1/macros/FunctionList/lib b/2.3-1/macros/FunctionList/lib Binary files differindex 32c92be8..74542a2a 100644 --- a/2.3-1/macros/FunctionList/lib +++ b/2.3-1/macros/FunctionList/lib diff --git a/2.3-1/macros/GeneralFunctions/SCI2COpenFileRead.bin b/2.3-1/macros/GeneralFunctions/SCI2COpenFileRead.bin Binary files differindex 7d5f101b..f3f6a5e3 100644 --- a/2.3-1/macros/GeneralFunctions/SCI2COpenFileRead.bin +++ b/2.3-1/macros/GeneralFunctions/SCI2COpenFileRead.bin 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 Binary files differindex a3af87e6..8367688a 100644 --- a/2.3-1/macros/GeneralFunctions/lib +++ b/2.3-1/macros/GeneralFunctions/lib diff --git a/2.3-1/macros/Hardware/AVR/AVRUARTSetup.bin b/2.3-1/macros/Hardware/AVR/AVRUARTSetup.bin Binary files differnew file mode 100644 index 00000000..4a49b861 --- /dev/null +++ b/2.3-1/macros/Hardware/AVR/AVRUARTSetup.bin diff --git a/2.3-1/macros/Hardware/AVR/lib b/2.3-1/macros/Hardware/AVR/lib Binary files differindex b1986824..4931fea0 100644 --- a/2.3-1/macros/Hardware/AVR/lib +++ b/2.3-1/macros/Hardware/AVR/lib diff --git a/2.3-1/macros/Hardware/AVR/names b/2.3-1/macros/Hardware/AVR/names index 126da77a..624fee8a 100644 --- a/2.3-1/macros/Hardware/AVR/names +++ b/2.3-1/macros/Hardware/AVR/names @@ -7,6 +7,7 @@ AVRPWMSetDuty AVRPWMSetup AVRReadADC AVRTimerSetup +AVRUARTSetup GetAVRSupportFunctions GetPeripheral InsertPeripheralInList diff --git a/2.3-1/macros/Scilab-Arduino/GenerateSetupFunction.bin b/2.3-1/macros/Scilab-Arduino/GenerateSetupFunction.bin Binary files differindex 7a5052dc..ea2bdec3 100644 --- a/2.3-1/macros/Scilab-Arduino/GenerateSetupFunction.bin +++ b/2.3-1/macros/Scilab-Arduino/GenerateSetupFunction.bin diff --git a/2.3-1/macros/Scilab-Arduino/GetArduinoFunctions.bin b/2.3-1/macros/Scilab-Arduino/GetArduinoFunctions.bin Binary files differindex 82b0d456..fe9e2040 100644 --- a/2.3-1/macros/Scilab-Arduino/GetArduinoFunctions.bin +++ b/2.3-1/macros/Scilab-Arduino/GetArduinoFunctions.bin 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 Binary files differindex 048da7d7..67f9fada 100644 --- a/2.3-1/macros/Scilab-Arduino/GetArduinoSetupFunctions.bin +++ b/2.3-1/macros/Scilab-Arduino/GetArduinoSetupFunctions.bin 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 Binary files differindex 41c1a3fe..44e688c6 100644 --- a/2.3-1/macros/Scilab-Arduino/InsertSetupInList.bin +++ b/2.3-1/macros/Scilab-Arduino/InsertSetupInList.bin 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 Binary files differindex bd0cb707..824ce45a 100644 --- a/2.3-1/macros/Scilab-Arduino/lib +++ b/2.3-1/macros/Scilab-Arduino/lib diff --git a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin Binary files differnew file mode 100644 index 00000000..05adc1fb --- /dev/null +++ b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index e832b83c..69fd0573 100644 --- a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -1009,6 +1009,72 @@ 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 Rand.------
//---------------------
@@ -1160,6 +1226,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 +1898,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 +2746,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 +2898,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 +3181,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);
@@ -3834,6 +3906,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 +4037,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');
@@ -4469,6 +4543,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');
diff --git a/2.3-1/macros/ToolInitialization/INIT_SCI2C.bin b/2.3-1/macros/ToolInitialization/INIT_SCI2C.bin Binary files differindex c6141d61..72f9e1df 100644 --- a/2.3-1/macros/ToolInitialization/INIT_SCI2C.bin +++ b/2.3-1/macros/ToolInitialization/INIT_SCI2C.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_SCI2C.sci b/2.3-1/macros/ToolInitialization/INIT_SCI2C.sci index 6dde05de..167b2ee4 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/UpdateSCI2CInfo.bin b/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.bin Binary files differindex 16e99c9a..af1ae435 100644 --- a/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.bin +++ b/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.bin diff --git a/2.3-1/macros/ToolInitialization/lib b/2.3-1/macros/ToolInitialization/lib Binary files differindex 6240d3dd..0b3bb8ea 100644 --- a/2.3-1/macros/ToolInitialization/lib +++ b/2.3-1/macros/ToolInitialization/lib diff --git a/2.3-1/macros/findDeps/getAllHeaders.bin b/2.3-1/macros/findDeps/getAllHeaders.bin Binary files differindex 4ed973e7..fd56a811 100644 --- a/2.3-1/macros/findDeps/getAllHeaders.bin +++ b/2.3-1/macros/findDeps/getAllHeaders.bin diff --git a/2.3-1/macros/findDeps/getAllHeaders.sci b/2.3-1/macros/findDeps/getAllHeaders.sci index 2678d9e9..ca022cf1 100644 --- a/2.3-1/macros/findDeps/getAllHeaders.sci +++ b/2.3-1/macros/findDeps/getAllHeaders.sci @@ -63,6 +63,7 @@ function allHeaders = getAllHeaders(OutFormat) "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" diff --git a/2.3-1/macros/findDeps/getAllInterfaces.bin b/2.3-1/macros/findDeps/getAllInterfaces.bin Binary files differindex 368b84ab..b9449d4e 100644 --- a/2.3-1/macros/findDeps/getAllInterfaces.bin +++ b/2.3-1/macros/findDeps/getAllInterfaces.bin diff --git a/2.3-1/macros/findDeps/getAllInterfaces.sci b/2.3-1/macros/findDeps/getAllInterfaces.sci index 649210b8..b7c04bb1 100644 --- a/2.3-1/macros/findDeps/getAllInterfaces.sci +++ b/2.3-1/macros/findDeps/getAllInterfaces.sci @@ -51,6 +51,7 @@ function allInterfaces = getAllInterfaces(OutFormat) "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" diff --git a/2.3-1/macros/findDeps/getAllSources.bin b/2.3-1/macros/findDeps/getAllSources.bin Binary files differindex a81e474e..85caa0c7 100644 --- a/2.3-1/macros/findDeps/getAllSources.bin +++ b/2.3-1/macros/findDeps/getAllSources.bin diff --git a/2.3-1/macros/findDeps/getAllSources.sci b/2.3-1/macros/findDeps/getAllSources.sci index 0dc0fdea..b6e85565 100644 --- a/2.3-1/macros/findDeps/getAllSources.sci +++ b/2.3-1/macros/findDeps/getAllSources.sci @@ -244,6 +244,36 @@ function allSources = getAllSources(OutFormat) "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" diff --git a/2.3-1/macros/findDeps/lib b/2.3-1/macros/findDeps/lib Binary files differindex 8d3728f0..17f4d7f6 100644 --- a/2.3-1/macros/findDeps/lib +++ b/2.3-1/macros/findDeps/lib diff --git a/2.3-1/macros/lib b/2.3-1/macros/lib Binary files differindex 1b718c75..f3cab7db 100644 --- a/2.3-1/macros/lib +++ b/2.3-1/macros/lib diff --git a/2.3-1/macros/runsci2c.bin b/2.3-1/macros/runsci2c.bin Binary files differindex 6c09823e..854f774a 100644 --- a/2.3-1/macros/runsci2c.bin +++ b/2.3-1/macros/runsci2c.bin 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/bitget/u16bitgets.c~ b/2.3-1/src/c/elementaryFunctions/bitget/u16bitgets.c~ deleted file mode 100644 index 20593bff..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitget/u16bitgets.c~ +++ /dev/null @@ -1,24 +0,0 @@ -/* Scilab2C FOSSEE IITB */ - -#include "bitget.h" -#include<stdio.h> - -uint16 u16bitgets(uint16 value,int position) -{ - - value = value >> (position -1); - value = value & 1; - return value; - - /*unsigned char mask = 1<<(position-1); - uint16 bit = value&mask; - if(bit > 0) - { - return 1; - } - else - { - return 0; - }*/ - -} diff --git a/2.3-1/src/c/elementaryFunctions/bitget/u8bitgets.c~ b/2.3-1/src/c/elementaryFunctions/bitget/u8bitgets.c~ deleted file mode 100644 index 130bff86..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitget/u8bitgets.c~ +++ /dev/null @@ -1,24 +0,0 @@ -/* Scilab2C FOSSEE IITB */ - -#include "bitget.h" -#include<stdio.h> - -uint8 u8bitgets(uint8 value,int position) -{ - - value = value >> (position -1); - value = value & 1; - return value; - - /*unsigned char mask = 1<<(position-1); - uint8 bit = value&mask; - if(bit > 0) - { - return 1; - } - else - { - return 0; - }*/ - -} diff --git a/2.3-1/src/c/elementaryFunctions/bitor/dbitanda.c~ b/2.3-1/src/c/elementaryFunctions/bitor/dbitanda.c~ deleted file mode 100644 index d411e6e4..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitor/dbitanda.c~ +++ /dev/null @@ -1,14 +0,0 @@ -/* Scilab2C FOSSEE IITB */ -#include "bitand.h" - -void dbitanda(double* x,double* y,int size,double* out) -{ - int i = 0; - for(i=0;i<size;i++) - { - out[i] = dbitands(x[i],y[i]); - } - - -} - diff --git a/2.3-1/src/c/elementaryFunctions/bitor/dbitands.c~ b/2.3-1/src/c/elementaryFunctions/bitor/dbitands.c~ deleted file mode 100644 index a66e3c13..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitor/dbitands.c~ +++ /dev/null @@ -1,9 +0,0 @@ -/* Scilab2C FOSSEE IITB */ - -#include "bitand.h" - -double dbitands(double x,double y) -{ - return ((int)x & (int)y); - -} diff --git a/2.3-1/src/c/elementaryFunctions/bitor/u16bitanda.c~ b/2.3-1/src/c/elementaryFunctions/bitor/u16bitanda.c~ deleted file mode 100644 index 743161ea..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitor/u16bitanda.c~ +++ /dev/null @@ -1,14 +0,0 @@ -/* Scilab2C FOSSEE IITB */ -#include "bitand.h" - -void u16bitanda(uint16* x,uint16* y,int size,uint16* out) -{ - int i = 0; - for(i=0;i<size;i++) - { - out[i] = u16bitands(x[i],y[i]); - } - - -} - diff --git a/2.3-1/src/c/elementaryFunctions/bitor/u16bitands.c~ b/2.3-1/src/c/elementaryFunctions/bitor/u16bitands.c~ deleted file mode 100644 index 7ba73c15..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitor/u16bitands.c~ +++ /dev/null @@ -1,9 +0,0 @@ -/* Scilab2C FOSSEE IITB */ - -#include "bitand.h" - -uint16 u16bitands(uint16 x,uint16 y) -{ - return (x & y); - -} diff --git a/2.3-1/src/c/elementaryFunctions/bitor/u16bitora.c~ b/2.3-1/src/c/elementaryFunctions/bitor/u16bitora.c~ deleted file mode 100644 index 84722e18..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitor/u16bitora.c~ +++ /dev/null @@ -1,14 +0,0 @@ -/* Scilab2C FOSSEE IITB */ -#include "bitor.h" - -void u16bitora(uint16* x,uint16* y,int size,uint16* out) -{ - int i = 0; - for(i=0;i<size;i++) - { - out[i] = u16bitors(x[i],y[i]); - } - - -} - diff --git a/2.3-1/src/c/elementaryFunctions/bitor/u16bitors.c~ b/2.3-1/src/c/elementaryFunctions/bitor/u16bitors.c~ deleted file mode 100644 index e48e3000..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitor/u16bitors.c~ +++ /dev/null @@ -1,9 +0,0 @@ -/* Scilab2C FOSSEE IITB */ - -#include "bitor.h" - -uint16 u16bitors(uint16 x,uint16 y) -{ - return (x | y); - -} diff --git a/2.3-1/src/c/elementaryFunctions/bitor/u8bitanda.c~ b/2.3-1/src/c/elementaryFunctions/bitor/u8bitanda.c~ deleted file mode 100644 index e1260a71..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitor/u8bitanda.c~ +++ /dev/null @@ -1,14 +0,0 @@ -/* Scilab2C FOSSEE IITB */ -#include "bitand.h" - -void u8bitanda(uint8* x,uint8* y,int size,uint8* out) -{ - int i = 0; - for(i=0;i<size;i++) - { - out[i] = u8bitands(x[i],y[i]); - } - - -} - diff --git a/2.3-1/src/c/elementaryFunctions/bitor/u8bitands.c~ b/2.3-1/src/c/elementaryFunctions/bitor/u8bitands.c~ deleted file mode 100644 index eda3ccc6..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitor/u8bitands.c~ +++ /dev/null @@ -1,9 +0,0 @@ -/* Scilab2C FOSSEE IITB */ - -#include "bitand.h" - -uint8 u8bitands(uint8 x,uint8 y) -{ - return (x & y); - -} diff --git a/2.3-1/src/c/elementaryFunctions/bitor/u8bitora.c~ b/2.3-1/src/c/elementaryFunctions/bitor/u8bitora.c~ deleted file mode 100644 index edda9bba..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitor/u8bitora.c~ +++ /dev/null @@ -1,14 +0,0 @@ -/* Scilab2C FOSSEE IITB */ -#include "bitor.h" - -void u8bitora(uint8* x,uint8* y,int size,uint8* out) -{ - int i = 0; - for(i=0;i<size;i++) - { - out[i] = u8bitors(x[i],y[i]); - } - - -} - diff --git a/2.3-1/src/c/elementaryFunctions/bitor/u8bitors.c~ b/2.3-1/src/c/elementaryFunctions/bitor/u8bitors.c~ deleted file mode 100644 index 56d3540d..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitor/u8bitors.c~ +++ /dev/null @@ -1,9 +0,0 @@ -/* Scilab2C FOSSEE IITB */ - -#include "bitor.h" - -uint8 u8bitors(uint8 x,uint8 y) -{ - return (x | y); - -} diff --git a/2.3-1/src/c/elementaryFunctions/bitset/u16bitsets.c~ b/2.3-1/src/c/elementaryFunctions/bitset/u16bitsets.c~ deleted file mode 100644 index 953e46c9..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitset/u16bitsets.c~ +++ /dev/null @@ -1,20 +0,0 @@ -/* Scilab2C FOSSEE IITB */ - -#include "bitset.h" -#include<stdio.h> - -uint16 u16bitsets(uint16 value,int position,int bit_value) -{ - if(bit_value==1) - { - unsigned char mask1 = 1 << (position-1) ; // we could cast to unsigned char, just to be safe - return (mask1 | value); - } - else - { - unsigned char mask2 = ~(1 << (position-1)); // we could cast to unsigned char, just to be safe - return (mask2 & value); - - } - -} diff --git a/2.3-1/src/c/elementaryFunctions/bitset/u8bitsets.c~ b/2.3-1/src/c/elementaryFunctions/bitset/u8bitsets.c~ deleted file mode 100644 index 5f44dcd8..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitset/u8bitsets.c~ +++ /dev/null @@ -1,20 +0,0 @@ -/* Scilab2C FOSSEE IITB */ - -#include "bitset.h" -#include<stdio.h> - -uint8 u8bitsets(uint8 value,int position,int bit_value) -{ - if(bit_value==1) - { - unsigned char mask1 = 1 << (position-1) ; // we could cast to unsigned char, just to be safe - return (mask1 | value); - } - else - { - unsigned char mask2 = ~(1 << (position-1)); // we could cast to unsigned char, just to be safe - return (mask2 & value); - - } - -} diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/dbitanda.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/dbitanda.c~ deleted file mode 100644 index d411e6e4..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitxor/dbitanda.c~ +++ /dev/null @@ -1,14 +0,0 @@ -/* Scilab2C FOSSEE IITB */ -#include "bitand.h" - -void dbitanda(double* x,double* y,int size,double* out) -{ - int i = 0; - for(i=0;i<size;i++) - { - out[i] = dbitands(x[i],y[i]); - } - - -} - diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/dbitands.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/dbitands.c~ deleted file mode 100644 index a66e3c13..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitxor/dbitands.c~ +++ /dev/null @@ -1,9 +0,0 @@ -/* Scilab2C FOSSEE IITB */ - -#include "bitand.h" - -double dbitands(double x,double y) -{ - return ((int)x & (int)y); - -} diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u16bitanda.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/u16bitanda.c~ deleted file mode 100644 index 743161ea..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitxor/u16bitanda.c~ +++ /dev/null @@ -1,14 +0,0 @@ -/* Scilab2C FOSSEE IITB */ -#include "bitand.h" - -void u16bitanda(uint16* x,uint16* y,int size,uint16* out) -{ - int i = 0; - for(i=0;i<size;i++) - { - out[i] = u16bitands(x[i],y[i]); - } - - -} - diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u16bitands.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/u16bitands.c~ deleted file mode 100644 index 7ba73c15..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitxor/u16bitands.c~ +++ /dev/null @@ -1,9 +0,0 @@ -/* Scilab2C FOSSEE IITB */ - -#include "bitand.h" - -uint16 u16bitands(uint16 x,uint16 y) -{ - return (x & y); - -} diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u16bitora.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/u16bitora.c~ deleted file mode 100644 index 84722e18..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitxor/u16bitora.c~ +++ /dev/null @@ -1,14 +0,0 @@ -/* Scilab2C FOSSEE IITB */ -#include "bitor.h" - -void u16bitora(uint16* x,uint16* y,int size,uint16* out) -{ - int i = 0; - for(i=0;i<size;i++) - { - out[i] = u16bitors(x[i],y[i]); - } - - -} - diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u16bitors.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/u16bitors.c~ deleted file mode 100644 index e48e3000..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitxor/u16bitors.c~ +++ /dev/null @@ -1,9 +0,0 @@ -/* Scilab2C FOSSEE IITB */ - -#include "bitor.h" - -uint16 u16bitors(uint16 x,uint16 y) -{ - return (x | y); - -} diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u16bitxora.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/u16bitxora.c~ deleted file mode 100644 index 6f50f068..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitxor/u16bitxora.c~ +++ /dev/null @@ -1,14 +0,0 @@ -/* Scilab2C FOSSEE IITB */ -#include "bitxor.h" - -void u16bitxora(uint16* x,uint16* y,int size,uint16* out) -{ - int i = 0; - for(i=0;i<size;i++) - { - out[i] = u16bitxors(x[i],y[i]); - } - - -} - diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u16bitxors.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/u16bitxors.c~ deleted file mode 100644 index 03ca8f83..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitxor/u16bitxors.c~ +++ /dev/null @@ -1,9 +0,0 @@ -/* Scilab2C FOSSEE IITB */ - -#include "bitxor.h" - -uint16 u16bitxors(uint16 x,uint16 y) -{ - return (x ^ y); - -} diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u8bitanda.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/u8bitanda.c~ deleted file mode 100644 index e1260a71..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitxor/u8bitanda.c~ +++ /dev/null @@ -1,14 +0,0 @@ -/* Scilab2C FOSSEE IITB */ -#include "bitand.h" - -void u8bitanda(uint8* x,uint8* y,int size,uint8* out) -{ - int i = 0; - for(i=0;i<size;i++) - { - out[i] = u8bitands(x[i],y[i]); - } - - -} - diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u8bitands.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/u8bitands.c~ deleted file mode 100644 index eda3ccc6..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitxor/u8bitands.c~ +++ /dev/null @@ -1,9 +0,0 @@ -/* Scilab2C FOSSEE IITB */ - -#include "bitand.h" - -uint8 u8bitands(uint8 x,uint8 y) -{ - return (x & y); - -} diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u8bitora.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/u8bitora.c~ deleted file mode 100644 index edda9bba..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitxor/u8bitora.c~ +++ /dev/null @@ -1,14 +0,0 @@ -/* Scilab2C FOSSEE IITB */ -#include "bitor.h" - -void u8bitora(uint8* x,uint8* y,int size,uint8* out) -{ - int i = 0; - for(i=0;i<size;i++) - { - out[i] = u8bitors(x[i],y[i]); - } - - -} - diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u8bitors.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/u8bitors.c~ deleted file mode 100644 index 56d3540d..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitxor/u8bitors.c~ +++ /dev/null @@ -1,9 +0,0 @@ -/* Scilab2C FOSSEE IITB */ - -#include "bitor.h" - -uint8 u8bitors(uint8 x,uint8 y) -{ - return (x | y); - -} diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u8bitxora.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/u8bitxora.c~ deleted file mode 100644 index ad7cc24e..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitxor/u8bitxora.c~ +++ /dev/null @@ -1,14 +0,0 @@ -/* Scilab2C FOSSEE IITB */ -#include "bitxor.h" - -void u8bitxora(uint8* x,uint8* y,int size,uint8* out) -{ - int i = 0; - for(i=0;i<size;i++) - { - out[i] = u8bitxors(x[i],y[i]); - } - - -} - diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u8bitxors.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/u8bitxors.c~ deleted file mode 100644 index 9a346eee..00000000 --- a/2.3-1/src/c/elementaryFunctions/bitxor/u8bitxors.c~ +++ /dev/null @@ -1,9 +0,0 @@ -/* Scilab2C FOSSEE IITB */ - -#include "bitxor.h" - -uint8 u8bitxors(uint8 x,uint8 y) -{ - return (x ^ y); - -} 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..b4ca929d --- /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(int8 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__ */ |