diff options
author | siddhu8990 | 2015-11-28 11:21:19 +0530 |
---|---|---|
committer | siddhu8990 | 2015-11-28 11:21:19 +0530 |
commit | 3eeb9f450ed9360a4d84e64fa8bee9be2fafb5c7 (patch) | |
tree | aabbd1a190c49ba6f4ad953dfe50daf22916b7a7 /2.3-1/macros/FunctionAnnotation/FA_SZ_OPPLUS.sci | |
parent | 128638e88ce6d8414c9e1061faa96008be9bcda5 (diff) | |
parent | fd8c4f9bc0763e85c16a59c7639803fd09663281 (diff) | |
download | Scilab2C-3eeb9f450ed9360a4d84e64fa8bee9be2fafb5c7.tar.gz Scilab2C-3eeb9f450ed9360a4d84e64fa8bee9be2fafb5c7.tar.bz2 Scilab2C-3eeb9f450ed9360a4d84e64fa8bee9be2fafb5c7.zip |
Merge branch 'master' of https://github.com/siddhu8990/Scilab2C
Diffstat (limited to '2.3-1/macros/FunctionAnnotation/FA_SZ_OPPLUS.sci')
-rw-r--r-- | 2.3-1/macros/FunctionAnnotation/FA_SZ_OPPLUS.sci | 73 |
1 files changed, 71 insertions, 2 deletions
diff --git a/2.3-1/macros/FunctionAnnotation/FA_SZ_OPPLUS.sci b/2.3-1/macros/FunctionAnnotation/FA_SZ_OPPLUS.sci index f439e23e..4ad282ff 100644 --- a/2.3-1/macros/FunctionAnnotation/FA_SZ_OPPLUS.sci +++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_OPPLUS.sci @@ -53,41 +53,110 @@ SCI2CNInArgCheck(argn(2),4,4); // --- Generate Output. ---
// ------------------------
// --- Get dimensions of input arguments. ---
+disp(in1type,'in1type before casting : ');
+disp(type(in1type),'in1type before casting using type function : ');
+disp(in2type,'in2type before casting : ');
+disp(type(in2type),'in2type is before casting using type function : ');
+disp(in1size,'in1size before casting : ');
+disp(size(in1size),'in1size before casting using size funcion : ');
+disp(in2size,'in2size before casting : ')
+disp(size(in2size),'in2size before casting using size function : ');
in1size = string(in1size);
in2size = string(in2size);
in1type = string(in1type);
in2type = string(in2type);
+disp(in1type,'in1type After casting : ');
+disp(type(in1type),'in1type After casting using type function : ');
+disp(in2type,'in2type After casting : ');
+disp(type(in2type),'in2type After casting using type function : ');
+disp(in1size,'in1size After casting : ');
+disp(size(in1size),'in1size After casting using size funcion : ');
+disp(in2size,'in2size After casting : ')
+disp(size(in2size),'in2size After casting using size function : ');
in1dim = GetSymbolDimension(in1size);
-
+in2dim = GetSymbolDimension(in2size);
+disp(in1dim,'in1dimension is : ');
+disp(in2dim,'in2dimension is : ');
if ((in1type ~= 'g') & (in2type ~= 'g'))
+ disp("Inside 1st if condition");
opoutsize = FA_SZ_OPPLUSA(in1size,in2size);
+ disp(opoutsize,'Opoutsize in 1st if condition is : ');
+disp("Going to 1st elseif statement");
elseif ((in1type == 'g') & (in2type == 'g'))
+ disp("Inside to elseif statement");
opoutsize(1) = '1';
+ disp(opoutsize(1),"oputsize(1) is : ")
if (isnum(in1size(1)) & isnum(in2size(1)))
+ disp("Inside 2nd if condition");
in1num = eval(in1size(1));
+ disp(in1num,"in1num is in 2nd if : ");
in2num = eval(in2size(1));
- if (in1num > 1 | in2num > 1)
+ disp(in2num,"in2num is in 2nd if : ");
+ if (in1num > 1 & in2num > 1)
+ disp("Inside 3rd if condition");
error(9999, 'String catenation can be performed only on strings of 1 x N size not N x 1 size');
//NUT: mi pare che non possano proprio esistere stringe di dimensione Nx1 perche' in
//NUT: scilab esiste il tipo string che e' di size 1x1 e sono io a trasformarlo in
//NUT: 1xN per cui se uso sempre questa convenzione non sbaglio mai.
//NUT: ho provato in scilab a fare la trasposta di una stringa e ottengo sempre 1x1.
+ disp("End of 3rd if condition");
end
+ disp("End of 2nd if condition");
end
if (isnum(in1size(2)) & isnum(in2size(2)))
+ disp("Inside 4th if condition");
in1num = eval(in1size(2));
+ disp(in1num,"in1num is in 4th if : ");
in2num = eval(in2size(2));
+ disp(in2num,"in2num is in 4th if : ");
opoutsize(2) = string(in1num+in2num-1);
+ disp(opoutsize(2),"Final Oputsize(2) without casting to String : ");
if isnan(opoutsize(2))
+ disp("Inside 5th if condition");
opoutsize(2) = '__SCI2CNANSIZE';
+ disp(opoutsize(2),"Opoutsize(2) is when it is not a Number : ");
else
opoutsize(2) = string(opoutsize(2));
+ disp(opoutsize(2),"Opoutsize(2) is casting to String : ");
end
+ disp("Outside of 5th if condition");
else
opoutsize(2) = '('+string(in1size(2))+'+'+string(in2size(2))+'-1)';
+ disp(opoutsize(2),"Final Opoutsize(2) casting to String : ")
+ end
+ disp("Outside 4th if condition");
+disp("Going to Inside 2nd elseif condition");
+
+elseif (in2type == 'g')
+ disp("Inside 4th elseif condition");
+ if (isnum(in2size(2)))
+ disp(in2size(2),"in2size(2) is inside 1st if of 4th elseif : ");
+ if(in2size(2) == 3)
+ in1num = eval(in1size(2));
+ opoutsize(2) = string(in1num);
+ #opoutsize = string(in1num);
+ disp(opoutsize,"opoutsize inside 1st If condition of 4th elseif : ");
+ else
+ in2num = eval(in1size(1));
+ opoutsize(1) = string(in2num);
+ #opoutsize = in2num;
+ disp(opoutsize,"opoutsize inside 1st Else condition of 4th elseif : ");
+ end
+ disp("OutSide of 1st if condition of 4th elseif");
+
+ else
+ disp("Inside else condition of 4th else")
+ if(in2size(2) == 3)
+ opoutsize(2) = '('+string(in1size(2))+')';
+ disp(opoutsize(2),"Final Opoutsize(2) is not a number : ")
+ else
+ opoutsize(1) = '('+string(in1size(1))+')';
+ disp(opoutsize(1),"Final Opoutsize(1) is not a number : ")
+ end
end
else
error(9999, 'Unexpected type combination for ""+"" operator (type1,type2): ('+in1type+in2type+').');
end
endfunction
+
|