diff options
Diffstat (limited to 'macros/FunctionAnnotation')
22 files changed, 262 insertions, 11 deletions
diff --git a/macros/FunctionAnnotation/FA_GetOutArgInfo.bin b/macros/FunctionAnnotation/FA_GetOutArgInfo.bin Binary files differindex 1deaff6..39d97b2 100644 --- a/macros/FunctionAnnotation/FA_GetOutArgInfo.bin +++ b/macros/FunctionAnnotation/FA_GetOutArgInfo.bin diff --git a/macros/FunctionAnnotation/FA_GetOutArgInfo.sci b/macros/FunctionAnnotation/FA_GetOutArgInfo.sci index 84640df..37e6d09 100644 --- a/macros/FunctionAnnotation/FA_GetOutArgInfo.sci +++ b/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/macros/FunctionAnnotation/FA_SZ_1.bin b/macros/FunctionAnnotation/FA_SZ_1.bin Binary files differindex 91cd951..c01ff59 100644 --- a/macros/FunctionAnnotation/FA_SZ_1.bin +++ b/macros/FunctionAnnotation/FA_SZ_1.bin diff --git a/macros/FunctionAnnotation/FA_SZ_1.sci b/macros/FunctionAnnotation/FA_SZ_1.sci index d9a481c..3d20b99 100644 --- a/macros/FunctionAnnotation/FA_SZ_1.sci +++ b/macros/FunctionAnnotation/FA_SZ_1.sci @@ -17,4 +17,5 @@ function outsize = FA_SZ_1(insize) // -----------------------------------------------------------------
outsize = insize(1);
+
endfunction
diff --git a/macros/FunctionAnnotation/FA_SZ_2.bin b/macros/FunctionAnnotation/FA_SZ_2.bin Binary files differindex 099f1d6..00834df 100644 --- a/macros/FunctionAnnotation/FA_SZ_2.bin +++ b/macros/FunctionAnnotation/FA_SZ_2.bin diff --git a/macros/FunctionAnnotation/FA_SZ_2.sci b/macros/FunctionAnnotation/FA_SZ_2.sci index 64fdac1..164cab3 100644 --- a/macros/FunctionAnnotation/FA_SZ_2.sci +++ b/macros/FunctionAnnotation/FA_SZ_2.sci @@ -17,4 +17,5 @@ function outsize = FA_SZ_2(insize) // -----------------------------------------------------------------
outsize = insize(2);
+
endfunction
diff --git a/macros/FunctionAnnotation/FA_SZ_COLUMN_DIAG.bin b/macros/FunctionAnnotation/FA_SZ_COLUMN_DIAG.bin Binary files differnew file mode 100644 index 0000000..68d6a37 --- /dev/null +++ b/macros/FunctionAnnotation/FA_SZ_COLUMN_DIAG.bin diff --git a/macros/FunctionAnnotation/FA_SZ_COLUMN_DIAG.sci b/macros/FunctionAnnotation/FA_SZ_COLUMN_DIAG.sci new file mode 100644 index 0000000..df129f9 --- /dev/null +++ b/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/macros/FunctionAnnotation/FA_SZ_COLUMN_DIAG_INS_EXT.bin b/macros/FunctionAnnotation/FA_SZ_COLUMN_DIAG_INS_EXT.bin Binary files differnew file mode 100644 index 0000000..6d88309 --- /dev/null +++ b/macros/FunctionAnnotation/FA_SZ_COLUMN_DIAG_INS_EXT.bin diff --git a/macros/FunctionAnnotation/FA_SZ_COL_DIAG_IN_EX.bin b/macros/FunctionAnnotation/FA_SZ_COL_DIAG_IN_EX.bin Binary files differnew file mode 100644 index 0000000..e39a0be --- /dev/null +++ b/macros/FunctionAnnotation/FA_SZ_COL_DIAG_IN_EX.bin diff --git a/macros/FunctionAnnotation/FA_SZ_COL_DIAG_IN_EX.sci b/macros/FunctionAnnotation/FA_SZ_COL_DIAG_IN_EX.sci new file mode 100644 index 0000000..45d74c3 --- /dev/null +++ b/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/macros/FunctionAnnotation/FA_SZ_FROM_VAL.bin b/macros/FunctionAnnotation/FA_SZ_FROM_VAL.bin Binary files differindex 9a39d12..a06f3b1 100644 --- a/macros/FunctionAnnotation/FA_SZ_FROM_VAL.bin +++ b/macros/FunctionAnnotation/FA_SZ_FROM_VAL.bin diff --git a/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci b/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci index c3cae53..bb02b98 100644 --- a/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci +++ b/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/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN.bin b/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN.bin Binary files differnew file mode 100644 index 0000000..edba674 --- /dev/null +++ b/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN.bin diff --git a/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN.sci b/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN.sci new file mode 100644 index 0000000..ca1d262 --- /dev/null +++ b/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/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN_CAT.bin b/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN_CAT.bin Binary files differnew file mode 100644 index 0000000..2373b81 --- /dev/null +++ b/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN_CAT.bin diff --git a/macros/FunctionAnnotation/FA_SZ_ROW_DIAG.bin b/macros/FunctionAnnotation/FA_SZ_ROW_DIAG.bin Binary files differnew file mode 100644 index 0000000..7fc7dcc --- /dev/null +++ b/macros/FunctionAnnotation/FA_SZ_ROW_DIAG.bin diff --git a/macros/FunctionAnnotation/FA_SZ_ROW_DIAG.sci b/macros/FunctionAnnotation/FA_SZ_ROW_DIAG.sci new file mode 100644 index 0000000..687a89e --- /dev/null +++ b/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/macros/FunctionAnnotation/FA_SZ_ROW_DIAG_INS_EXT.bin b/macros/FunctionAnnotation/FA_SZ_ROW_DIAG_INS_EXT.bin Binary files differnew file mode 100644 index 0000000..046b4b7 --- /dev/null +++ b/macros/FunctionAnnotation/FA_SZ_ROW_DIAG_INS_EXT.bin diff --git a/macros/FunctionAnnotation/FA_SZ_ROW_DIAG_INS_EXT.sci b/macros/FunctionAnnotation/FA_SZ_ROW_DIAG_INS_EXT.sci new file mode 100644 index 0000000..1ec720a --- /dev/null +++ b/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/macros/FunctionAnnotation/lib b/macros/FunctionAnnotation/lib Binary files differindex c2025c8..11e8b99 100644 --- a/macros/FunctionAnnotation/lib +++ b/macros/FunctionAnnotation/lib diff --git a/macros/FunctionAnnotation/names b/macros/FunctionAnnotation/names index d9300d2..2df2ed2 100644 --- a/macros/FunctionAnnotation/names +++ b/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 |