diff options
author | Sunil Shetye | 2019-05-16 12:18:48 +0530 |
---|---|---|
committer | Sunil Shetye | 2019-05-29 11:08:01 +0530 |
commit | 26b77d7593b5ee0792b6b556f5569ea4227c2b02 (patch) | |
tree | 8f92052234b01bf39b9c3a6e3cb12b3962d96b1b /macros/FunctionAnnotation | |
parent | 5a73e6bec4a12db7afae9de300e39256f754d8d3 (diff) | |
download | scilab2c-26b77d7593b5ee0792b6b556f5569ea4227c2b02.tar.gz scilab2c-26b77d7593b5ee0792b6b556f5569ea4227c2b02.tar.bz2 scilab2c-26b77d7593b5ee0792b6b556f5569ea4227c2b02.zip |
convert to unix format
Diffstat (limited to 'macros/FunctionAnnotation')
47 files changed, 2035 insertions, 2035 deletions
diff --git a/macros/FunctionAnnotation/FA_ADD.sci b/macros/FunctionAnnotation/FA_ADD.sci index 4193422b..f0dc131b 100644 --- a/macros/FunctionAnnotation/FA_ADD.sci +++ b/macros/FunctionAnnotation/FA_ADD.sci @@ -1,43 +1,43 @@ -function opout = FA_ADD(in1,in2)
-// function opout = FA_ADD(in1,in2)
-// -----------------------------------------------------------------
-// Addition function for Function Annotations.
-//
-// Input data:
-// in1: string specifying a number or a symbol.
-// in2: string specifying a number or a symbol.
-//
-// Output data:
-// opout: string containing the computed result.
-//
-// Status:
-// 26-Oct-2007 -- Raffaele Nutricato: Author.
-// 26-Oct-2007 -- Alberto Morea: Test Ok.
-//
-// Copyright 2007 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),2,2);
-
-
-// ------------------------
-// --- Generate Output. ---
-// ------------------------
-if (isnum(in1) & isnum(in2))
- in1num = eval(in1);
- in2num = eval(in2);
- outnum = in1num+in2num;
- if isnan(outnum)
- opout = '__SCI2CNANSIZE';
- else
- opout = string(outnum);
- end
-else
- opout = string('('+in1+'+'+in2+')');
-end
-
-endfunction
+function opout = FA_ADD(in1,in2) +// function opout = FA_ADD(in1,in2) +// ----------------------------------------------------------------- +// Addition function for Function Annotations. +// +// Input data: +// in1: string specifying a number or a symbol. +// in2: string specifying a number or a symbol. +// +// Output data: +// opout: string containing the computed result. +// +// Status: +// 26-Oct-2007 -- Raffaele Nutricato: Author. +// 26-Oct-2007 -- Alberto Morea: Test Ok. +// +// Copyright 2007 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),2,2); + + +// ------------------------ +// --- Generate Output. --- +// ------------------------ +if (isnum(in1) & isnum(in2)) + in1num = eval(in1); + in2num = eval(in2); + outnum = in1num+in2num; + if isnan(outnum) + opout = '__SCI2CNANSIZE'; + else + opout = string(outnum); + end +else + opout = string('('+in1+'+'+in2+')'); +end + +endfunction diff --git a/macros/FunctionAnnotation/FA_DIV.sci b/macros/FunctionAnnotation/FA_DIV.sci index d4ec0ccd..e23c0330 100644 --- a/macros/FunctionAnnotation/FA_DIV.sci +++ b/macros/FunctionAnnotation/FA_DIV.sci @@ -1,41 +1,41 @@ -function opout = FA_DIV(in1,in2)
-// function opout = FA_DIV(in1,in2)
-// -----------------------------------------------------------------
-// Division function for Function Annotations.
-//
-// Input data:
-// in1: string specifying a number or a symbol.
-// in2: string specifying a number or a symbol.
-//
-// Output data:
-// opout: string containing the computed result.
-//
-// Status:
-// 26-Oct-2007 -- Raffaele Nutricato: Author.
-// 26-Oct-2007 -- 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. ---
-// ------------------------
-if (isnum(in1) & isnum(in2))
- in1num = eval(in1);
- in2num = eval(in2);
- outnum = in1num/in2num;
- if isnan(outnum)
- opout = '__SCI2CNANSIZE';
- else
- opout = string(outnum);
- end
-else
- opout = '('+string(in1)+'/'+string(in2)+')';
-end
-endfunction
+function opout = FA_DIV(in1,in2) +// function opout = FA_DIV(in1,in2) +// ----------------------------------------------------------------- +// Division function for Function Annotations. +// +// Input data: +// in1: string specifying a number or a symbol. +// in2: string specifying a number or a symbol. +// +// Output data: +// opout: string containing the computed result. +// +// Status: +// 26-Oct-2007 -- Raffaele Nutricato: Author. +// 26-Oct-2007 -- 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. --- +// ------------------------ +if (isnum(in1) & isnum(in2)) + in1num = eval(in1); + in2num = eval(in2); + outnum = in1num/in2num; + if isnan(outnum) + opout = '__SCI2CNANSIZE'; + else + opout = string(outnum); + end +else + opout = '('+string(in1)+'/'+string(in2)+')'; +end +endfunction diff --git a/macros/FunctionAnnotation/FA_GetDefaultPrecision.sci b/macros/FunctionAnnotation/FA_GetDefaultPrecision.sci index f4e321aa..5e357459 100644 --- a/macros/FunctionAnnotation/FA_GetDefaultPrecision.sci +++ b/macros/FunctionAnnotation/FA_GetDefaultPrecision.sci @@ -1,105 +1,105 @@ -function defaultprecision = FA_GetDefaultPrecision(scifilename,scifileid,ReportFileName)
-// function defaultprecision = FA_GetDefaultPrecision(scifilename,scifileid,ReportFileName)
-// -----------------------------------------------------------------
-// #RNU_RES_B
-// Extracts the default precision for the file .sci passed in input.
-// The following annotation will be searched in the scilab code:
-// //SCI2C: DEFAULT_PRECISION= FLOAT
-// //SCI2C: DEFAULT_PRECISION= DOUBLE
-// If the annotation is missing the default DOUBLE precision will be
-// implicitly used.
-// #RNU_RES_E
-//
-// Input data:
-// ---
-//
-// Output data:
-// defaultprecision: string which specifies the default precision to be
-// used in the translation of scifilename.
-//
-// Status:
-// 12-Feb-2008 -- Raffaele Nutricato: Author.
-// 12-Feb-2008 -- Alberto Morea: Test Ok.
-//
-// Copyright 2008 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),3,3);
-
-// -----------------------
-// --- Initialization. ---
-// -----------------------
-defaultprecision = 'd';
-annotationstring = '//SCI2C: DEFAULT_PRECISION='
-// #RNU_RES_B
-PrintStringInfo('***Get default precision from: '+scifilename,ReportFileName,'file','y');
-// #RNU_RES_E
-// ---------------------------
-// --- End Initialization. ---
-// ---------------------------
-
-// --- Open the .sci file (read only). ---
-if scifileid == [] then
- scifid = SCI2COpenFileRead(scifilename);
-else
- scifid = scifileid;
-end
-
-// #RNU_RES_B
-// --- Loop over the lines of the input file. ---
-// Position file pointer to the desired NInArg/NOutArg section,
-// and read the NOutArg annotation.
-// #RNU_RES_E
-foundannotation = 0;
-line_position = 0;
-while ((meof(scifid) == 0) & (foundannotation == 0))
- check_string = stripblanks(mgetl(scifid,1));
- line_position = line_position + 1;
- if (~isempty(check_string))
-
- if (SCI2Cstrncmps1size(annotationstring,check_string))
- tmpprecision = stripblanks(part(check_string,length(annotationstring)+1:length(check_string)));
- // #RNU_RES_B
- PrintStringInfo(' Line '+string(line_position)+...
- ' - Found annotation for default precision'+' ""'+check_string+' ""',...
- ReportFileName,'file','y');
- // #RNU_RES_E
- foundannotation = 1;
- end
- end
-end
-
-if (foundannotation == 0)
- // #RNU_RES_B
- PrintStringInfo('Annotation for default precision not found.',ReportFileName,'file','y');
- PrintStringInfo('Using the ""DOUBLE"" default precision.',ReportFileName,'file','y');
- // #RNU_RES_E
-else
- if (tmpprecision == 'FLOAT')
- defaultprecision = 's';
- elseif (tmpprecision == 'DOUBLE')
- defaultprecision = 'd';
- elseif (tmpprecision == 'UINT8')
- defaultprecision = 'u8';
- elseif (tmpprecision == 'INT8')
- defaultprecision = 'i8';
- elseif (tmpprecision == 'UINT16')
- defaultprecision = 'u16';
- elseif (tmpprecision == 'INT16')
- defaultprecision = 'i16';
- elseif (tmpprecision == 'CVIMAGE')
- defaultprecision = 'IplImage'
-
- end
-end
-
-if scifileid == [] then
- mclose(scifid);
-else
- mseek(0, scifid);
-end
-endfunction
+function defaultprecision = FA_GetDefaultPrecision(scifilename,scifileid,ReportFileName) +// function defaultprecision = FA_GetDefaultPrecision(scifilename,scifileid,ReportFileName) +// ----------------------------------------------------------------- +// #RNU_RES_B +// Extracts the default precision for the file .sci passed in input. +// The following annotation will be searched in the scilab code: +// //SCI2C: DEFAULT_PRECISION= FLOAT +// //SCI2C: DEFAULT_PRECISION= DOUBLE +// If the annotation is missing the default DOUBLE precision will be +// implicitly used. +// #RNU_RES_E +// +// Input data: +// --- +// +// Output data: +// defaultprecision: string which specifies the default precision to be +// used in the translation of scifilename. +// +// Status: +// 12-Feb-2008 -- Raffaele Nutricato: Author. +// 12-Feb-2008 -- Alberto Morea: Test Ok. +// +// Copyright 2008 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),3,3); + +// ----------------------- +// --- Initialization. --- +// ----------------------- +defaultprecision = 'd'; +annotationstring = '//SCI2C: DEFAULT_PRECISION=' +// #RNU_RES_B +PrintStringInfo('***Get default precision from: '+scifilename,ReportFileName,'file','y'); +// #RNU_RES_E +// --------------------------- +// --- End Initialization. --- +// --------------------------- + +// --- Open the .sci file (read only). --- +if scifileid == [] then + scifid = SCI2COpenFileRead(scifilename); +else + scifid = scifileid; +end + +// #RNU_RES_B +// --- Loop over the lines of the input file. --- +// Position file pointer to the desired NInArg/NOutArg section, +// and read the NOutArg annotation. +// #RNU_RES_E +foundannotation = 0; +line_position = 0; +while ((meof(scifid) == 0) & (foundannotation == 0)) + check_string = stripblanks(mgetl(scifid,1)); + line_position = line_position + 1; + if (~isempty(check_string)) + + if (SCI2Cstrncmps1size(annotationstring,check_string)) + tmpprecision = stripblanks(part(check_string,length(annotationstring)+1:length(check_string))); + // #RNU_RES_B + PrintStringInfo(' Line '+string(line_position)+... + ' - Found annotation for default precision'+' ""'+check_string+' ""',... + ReportFileName,'file','y'); + // #RNU_RES_E + foundannotation = 1; + end + end +end + +if (foundannotation == 0) + // #RNU_RES_B + PrintStringInfo('Annotation for default precision not found.',ReportFileName,'file','y'); + PrintStringInfo('Using the ""DOUBLE"" default precision.',ReportFileName,'file','y'); + // #RNU_RES_E +else + if (tmpprecision == 'FLOAT') + defaultprecision = 's'; + elseif (tmpprecision == 'DOUBLE') + defaultprecision = 'd'; + elseif (tmpprecision == 'UINT8') + defaultprecision = 'u8'; + elseif (tmpprecision == 'INT8') + defaultprecision = 'i8'; + elseif (tmpprecision == 'UINT16') + defaultprecision = 'u16'; + elseif (tmpprecision == 'INT16') + defaultprecision = 'i16'; + elseif (tmpprecision == 'CVIMAGE') + defaultprecision = 'IplImage' + + end +end + +if scifileid == [] then + mclose(scifid); +else + mseek(0, scifid); +end +endfunction diff --git a/macros/FunctionAnnotation/FA_GetFunAnn.sci b/macros/FunctionAnnotation/FA_GetFunAnn.sci index 3fadd1f2..57bae95c 100644 --- a/macros/FunctionAnnotation/FA_GetFunAnn.sci +++ b/macros/FunctionAnnotation/FA_GetFunAnn.sci @@ -1,217 +1,217 @@ -function [FunTypeAnnot,FunSizeAnnot,NOutArg_mod] = ...
- FA_GetFunAnn(NInArg,NOutArg,FunName,FileInfo,SharedInfo)
-// function [FunTypeAnnot,FunSizeAnnot] = ...
-// FA_GetFunAnn(NInArg,NOutArg,FunName,FileInfo,SharedInfo)
-// -----------------------------------------------------------------
-// #RNU_RES_B
-// This function extracts the TYPE and SIZE annotations from the
-// input .ann file.
-// No blank lines are allowed between function annotations.
-//
-// #RNU_RES_E
-// Input data:
-// //NUT: Add description here
-//
-// Output data:
-// //NUT: Add description here
-//
-// Status:
-// 11-Jul-2007 -- Nutricato Raffaele: Author.
-//
-// Copyright 2007 Raffaele Nutricato.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-//NUT: consider the possibility to split this function into more functions.
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),5,5);
-
-// -----------------------
-// --- Initialization. ---
-// -----------------------
-nxtscifunname = SharedInfo.NextSCIFunName;
-nxtscifunnumber = SharedInfo.NextSCIFunNumber;
-ReportFileName = FileInfo.Funct(nxtscifunnumber).ReportFileName;
-// #RNU_RES_B
-PrintStringInfo(' ',ReportFileName,'file','y');
-PrintStringInfo('***Reading function annotations***',ReportFileName,'file','y');
-// #RNU_RES_E
-SCI2CClassFileName = GetClsFileName(FunName,FileInfo,SharedInfo);
-FunTypeAnnot = '';
-FunSizeAnnot = '';
-// ---------------------------
-// --- End Initialization. ---
-// ---------------------------
-
-
-// ---------------------------------------------
-// --- Read the annotations of the function. ---
-// ---------------------------------------------
-// --- Open the .sci file (read only). ---
-inclsfid = SCI2COpenFileRead(SCI2CClassFileName);
-PrintStringInfo(' '+string(inclsfid),ReportFileName,'file','y');
-// #RNU_RES_B
-// --- Loop over the lines of the input file. ---
-// Position file pointer to the desired NInArg/NOutArg section,
-// and read the NOutArg annotation.
-// #RNU_RES_E
-FoundNIn = 0;
-FoundNOut = 0;
-line_position = 0;
-while ((meof(inclsfid) == 0) & (FoundNIn == 0) & (FoundNOut == 0))
- check_string = stripblanks(mgetl(inclsfid,1));
- line_position = line_position + 1;
- if (~isempty(check_string))
-
-// #RNU_RES_B
-// --- Search for the NIN annotation. ---
-// #RNU_RES_E
- if (SCI2Cstrncmps1size(SharedInfo.Annotations.FUNNIN,check_string))
- FUNNINAnnot = part(check_string,length(SharedInfo.Annotations.FUNNIN)+1:length(check_string));
-
-// #RNU_RES_B
-// --- Check NIN value. ---
-// #RNU_RES_E
- if (eval(FUNNINAnnot) == NInArg)
-// #RNU_RES_B
- PrintStringInfo(' Line '+string(line_position)+' - Function NInArg Annotation: '+' ""'+check_string+' ""',...
- ReportFileName,'file','y');
-// #RNU_RES_E
- FoundNIn = 1;
- check_string = stripblanks(mgetl(inclsfid,1));
- line_position = line_position + 1;
- if (~isempty(check_string))
-
-// #RNU_RES_B
-// --- Search for the NOUT annotation. ---
-// #RNU_RES_E
- if (SCI2Cstrncmps1size(SharedInfo.Annotations.FUNNOUT,check_string))
- FUNNOUTAnnot = part(check_string,length(SharedInfo.Annotations.FUNNOUT)+1:length(check_string));
-// #RNU_RES_B
-// --- Check NOUT value. ---
-// #RNU_RES_E
- if (eval(FUNNOUTAnnot) == NOutArg)
-// #RNU_RES_B
- PrintStringInfo(' Line '+string(line_position)+' - Function NOutArg Annotation: '+' ""'+check_string+' ""',...
- ReportFileName,'file','y');
-// #RNU_RES_E
- FoundNOut = 1;
- elseif(eval(FUNNOUTAnnot) == 0)
- FoundNOut = 1
- else
- FoundNIn = 0;
- end
- else
- PrintStringInfo(' ',ReportFileName,'both','y');
- PrintStringInfo('SCI2CERROR: Incorrect format for function annotation.',ReportFileName,'both','y');
- PrintStringInfo('SCI2CERROR: Expected '+SharedInfo.Annotations.FUNNIN+' field in the annotations of the function.',ReportFileName,'both','y');
- PrintStringInfo(' ',ReportFileName,'both','y');
- error(9999, 'SCI2CERROR: Incorrect format for function annotation.');
- end
- else
- PrintStringInfo(' ',ReportFileName,'both','y');
- PrintStringInfo('SCI2CERROR: Incorrect format for function annotation.',ReportFileName,'both','y');
- PrintStringInfo('SCI2CERROR: Expected '+SharedInfo.Annotations.FUNNIN+' field in the annotations of the function.',ReportFileName,'both','y');
- PrintStringInfo(' ',ReportFileName,'both','y');
- error(9999, 'SCI2CERROR: Incorrect format for function annotation.');
- end
- end
- end
- end
-end
-
-if (FoundNOut*FoundNIn == 0)
- PrintStringInfo(' ',ReportFileName,'both','y');
- PrintStringInfo('SCI2CERROR: Please check file: '+SCI2CClassFileName,ReportFileName,'both','y');
- PrintStringInfo('SCI2CERROR: Incorrect function annotation.',ReportFileName,'both','y');
- PrintStringInfo('SCI2CERROR: There are two possibilities:',ReportFileName,'both','y');
- PrintStringInfo('SCI2CERROR: 1. Syntax error in function annotations.',ReportFileName,'both','y');
- PrintStringInfo('SCI2CERROR: 2. Missing the right combination of NIN/NOUT annotations: ""'+SharedInfo.Annotations.FUNNIN+string(NInArg)+','+SharedInfo.Annotations.FUNNOUT+' '+string(NOutArg)+'"".',ReportFileName,'both','y');
- PrintStringInfo(' ',ReportFileName,'both','y');
- error(9999, 'SCI2CERROR: Incorrect function annotation.');
-else
- //This change has been made in order to supress the generation
- //of output variables in case of functions which do not return
- //anything.
- if(eval(FUNNOUTAnnot) == 0)
- NOutArg_mod = 0;
- else
- NOutArg_mod = NOutArg
- end
-
- // In case we are reading to much informations
- readNewLine = %t;
-
- for cntout = 1:NOutArg
- SCI2C_nout=cntout; // Useful for eval.
-
-// #RNU_RES_B
-// Read the Fun type annotation.
-// #RNU_RES_E
- if (readNewLine == %t)
- check_string = stripblanks(mgetl(inclsfid,1));
- line_position = line_position + 1;
- else
- // reset state
- readNewLine = %t;
- end
- if (isempty(check_string) == %F)
- tmpannstring = eval(SharedInfo.Annotations.FUNTYPE);
- if (SCI2Cstrncmps1size(tmpannstring,check_string))
-// #RNU_RES_B
- PrintStringInfo(' Line '+string(line_position)+' - Function Type Annotation: '+' ""'+check_string+' ""',...
- ReportFileName,'file','y');
-// #RNU_RES_E
- FunTypeAnnot(cntout) = ...
- stripblanks(part(check_string,length(tmpannstring)+1:length(check_string)));
- end
- else
- PrintStringInfo(' ',ReportFileName,'both','y');
- PrintStringInfo('SCI2CERROR: Line '+string(line_position)+' Function type annotation not found in file: '+SCI2CClassFileName,ReportFileName,'both','y');
- PrintStringInfo(' ',ReportFileName,'both','y');
- error(9999, 'SCI2CERROR: Line '+string(line_position)+' Function type annotation not found in file: '+SCI2CClassFileName);
- end
-
-// #RNU_RES_B
-// --- Read the Fun size annotation. ---
-// #RNU_RES_E
- SCI2C_nelem = 0; // Useful for eval.
-// while(SCI2C_nelem < 2 & isempty(check_string) == %F)
- while(SCI2C_nelem < 3 & isempty(check_string) == %F)
- line_position = line_position + 1;
-// #RNU_RES_B
- PrintStringInfo(' Line '+string(line_position)+' - Function Size Annotation: '+' ""'+check_string+' ""',...
- ReportFileName,'file','y');
- if (isempty(check_string) == %F)
- SCI2C_nelem = SCI2C_nelem + 1
- tmpannstring = eval(SharedInfo.Annotations.FUNSIZE);
- check_string = stripblanks(mgetl(inclsfid,1));
- if (SCI2Cstrncmps1size(tmpannstring,check_string))
-// #RNU_RES_E
- FunSizeAnnot(cntout,SCI2C_nelem) = ...
- stripblanks(part(check_string,length(tmpannstring)+1:length(check_string)));
- else
- readNewLine = %f;
- end
- else
- PrintStringInfo(' ',ReportFileName,'both','y');
- PrintStringInfo('SCI2CERROR: Line '+string(line_position)+' Function size annotation not found in file: '+SCI2CClassFileName,ReportFileName,'both','y');
- PrintStringInfo(' ',ReportFileName,'both','y');
- error(9999, 'SCI2CERROR: Line '+string(line_position)+' Function size annotation not found in file: '+SCI2CClassFileName);
- end
- end
- end
-
-
-end
-// --- End loop over the lines of the input file. ---
-mclose(inclsfid);
-// -------------------------------------------------
-// --- End Read the annotations of the function. ---
-// -------------------------------------------------
-PrintStringInfo(' end of annotation '+string(NOutArg_mod),ReportFileName,'file','y');
-
-endfunction
+function [FunTypeAnnot,FunSizeAnnot,NOutArg_mod] = ... + FA_GetFunAnn(NInArg,NOutArg,FunName,FileInfo,SharedInfo) +// function [FunTypeAnnot,FunSizeAnnot] = ... +// FA_GetFunAnn(NInArg,NOutArg,FunName,FileInfo,SharedInfo) +// ----------------------------------------------------------------- +// #RNU_RES_B +// This function extracts the TYPE and SIZE annotations from the +// input .ann file. +// No blank lines are allowed between function annotations. +// +// #RNU_RES_E +// Input data: +// //NUT: Add description here +// +// Output data: +// //NUT: Add description here +// +// Status: +// 11-Jul-2007 -- Nutricato Raffaele: Author. +// +// Copyright 2007 Raffaele Nutricato. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +//NUT: consider the possibility to split this function into more functions. + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),5,5); + +// ----------------------- +// --- Initialization. --- +// ----------------------- +nxtscifunname = SharedInfo.NextSCIFunName; +nxtscifunnumber = SharedInfo.NextSCIFunNumber; +ReportFileName = FileInfo.Funct(nxtscifunnumber).ReportFileName; +// #RNU_RES_B +PrintStringInfo(' ',ReportFileName,'file','y'); +PrintStringInfo('***Reading function annotations***',ReportFileName,'file','y'); +// #RNU_RES_E +SCI2CClassFileName = GetClsFileName(FunName,FileInfo,SharedInfo); +FunTypeAnnot = ''; +FunSizeAnnot = ''; +// --------------------------- +// --- End Initialization. --- +// --------------------------- + + +// --------------------------------------------- +// --- Read the annotations of the function. --- +// --------------------------------------------- +// --- Open the .sci file (read only). --- +inclsfid = SCI2COpenFileRead(SCI2CClassFileName); +PrintStringInfo(' '+string(inclsfid),ReportFileName,'file','y'); +// #RNU_RES_B +// --- Loop over the lines of the input file. --- +// Position file pointer to the desired NInArg/NOutArg section, +// and read the NOutArg annotation. +// #RNU_RES_E +FoundNIn = 0; +FoundNOut = 0; +line_position = 0; +while ((meof(inclsfid) == 0) & (FoundNIn == 0) & (FoundNOut == 0)) + check_string = stripblanks(mgetl(inclsfid,1)); + line_position = line_position + 1; + if (~isempty(check_string)) + +// #RNU_RES_B +// --- Search for the NIN annotation. --- +// #RNU_RES_E + if (SCI2Cstrncmps1size(SharedInfo.Annotations.FUNNIN,check_string)) + FUNNINAnnot = part(check_string,length(SharedInfo.Annotations.FUNNIN)+1:length(check_string)); + +// #RNU_RES_B +// --- Check NIN value. --- +// #RNU_RES_E + if (eval(FUNNINAnnot) == NInArg) +// #RNU_RES_B + PrintStringInfo(' Line '+string(line_position)+' - Function NInArg Annotation: '+' ""'+check_string+' ""',... + ReportFileName,'file','y'); +// #RNU_RES_E + FoundNIn = 1; + check_string = stripblanks(mgetl(inclsfid,1)); + line_position = line_position + 1; + if (~isempty(check_string)) + +// #RNU_RES_B +// --- Search for the NOUT annotation. --- +// #RNU_RES_E + if (SCI2Cstrncmps1size(SharedInfo.Annotations.FUNNOUT,check_string)) + FUNNOUTAnnot = part(check_string,length(SharedInfo.Annotations.FUNNOUT)+1:length(check_string)); +// #RNU_RES_B +// --- Check NOUT value. --- +// #RNU_RES_E + if (eval(FUNNOUTAnnot) == NOutArg) +// #RNU_RES_B + PrintStringInfo(' Line '+string(line_position)+' - Function NOutArg Annotation: '+' ""'+check_string+' ""',... + ReportFileName,'file','y'); +// #RNU_RES_E + FoundNOut = 1; + elseif(eval(FUNNOUTAnnot) == 0) + FoundNOut = 1 + else + FoundNIn = 0; + end + else + PrintStringInfo(' ',ReportFileName,'both','y'); + PrintStringInfo('SCI2CERROR: Incorrect format for function annotation.',ReportFileName,'both','y'); + PrintStringInfo('SCI2CERROR: Expected '+SharedInfo.Annotations.FUNNIN+' field in the annotations of the function.',ReportFileName,'both','y'); + PrintStringInfo(' ',ReportFileName,'both','y'); + error(9999, 'SCI2CERROR: Incorrect format for function annotation.'); + end + else + PrintStringInfo(' ',ReportFileName,'both','y'); + PrintStringInfo('SCI2CERROR: Incorrect format for function annotation.',ReportFileName,'both','y'); + PrintStringInfo('SCI2CERROR: Expected '+SharedInfo.Annotations.FUNNIN+' field in the annotations of the function.',ReportFileName,'both','y'); + PrintStringInfo(' ',ReportFileName,'both','y'); + error(9999, 'SCI2CERROR: Incorrect format for function annotation.'); + end + end + end + end +end + +if (FoundNOut*FoundNIn == 0) + PrintStringInfo(' ',ReportFileName,'both','y'); + PrintStringInfo('SCI2CERROR: Please check file: '+SCI2CClassFileName,ReportFileName,'both','y'); + PrintStringInfo('SCI2CERROR: Incorrect function annotation.',ReportFileName,'both','y'); + PrintStringInfo('SCI2CERROR: There are two possibilities:',ReportFileName,'both','y'); + PrintStringInfo('SCI2CERROR: 1. Syntax error in function annotations.',ReportFileName,'both','y'); + PrintStringInfo('SCI2CERROR: 2. Missing the right combination of NIN/NOUT annotations: ""'+SharedInfo.Annotations.FUNNIN+string(NInArg)+','+SharedInfo.Annotations.FUNNOUT+' '+string(NOutArg)+'"".',ReportFileName,'both','y'); + PrintStringInfo(' ',ReportFileName,'both','y'); + error(9999, 'SCI2CERROR: Incorrect function annotation.'); +else + //This change has been made in order to supress the generation + //of output variables in case of functions which do not return + //anything. + if(eval(FUNNOUTAnnot) == 0) + NOutArg_mod = 0; + else + NOutArg_mod = NOutArg + end + + // In case we are reading to much informations + readNewLine = %t; + + for cntout = 1:NOutArg + SCI2C_nout=cntout; // Useful for eval. + +// #RNU_RES_B +// Read the Fun type annotation. +// #RNU_RES_E + if (readNewLine == %t) + check_string = stripblanks(mgetl(inclsfid,1)); + line_position = line_position + 1; + else + // reset state + readNewLine = %t; + end + if (isempty(check_string) == %F) + tmpannstring = eval(SharedInfo.Annotations.FUNTYPE); + if (SCI2Cstrncmps1size(tmpannstring,check_string)) +// #RNU_RES_B + PrintStringInfo(' Line '+string(line_position)+' - Function Type Annotation: '+' ""'+check_string+' ""',... + ReportFileName,'file','y'); +// #RNU_RES_E + FunTypeAnnot(cntout) = ... + stripblanks(part(check_string,length(tmpannstring)+1:length(check_string))); + end + else + PrintStringInfo(' ',ReportFileName,'both','y'); + PrintStringInfo('SCI2CERROR: Line '+string(line_position)+' Function type annotation not found in file: '+SCI2CClassFileName,ReportFileName,'both','y'); + PrintStringInfo(' ',ReportFileName,'both','y'); + error(9999, 'SCI2CERROR: Line '+string(line_position)+' Function type annotation not found in file: '+SCI2CClassFileName); + end + +// #RNU_RES_B +// --- Read the Fun size annotation. --- +// #RNU_RES_E + SCI2C_nelem = 0; // Useful for eval. +// while(SCI2C_nelem < 2 & isempty(check_string) == %F) + while(SCI2C_nelem < 3 & isempty(check_string) == %F) + line_position = line_position + 1; +// #RNU_RES_B + PrintStringInfo(' Line '+string(line_position)+' - Function Size Annotation: '+' ""'+check_string+' ""',... + ReportFileName,'file','y'); + if (isempty(check_string) == %F) + SCI2C_nelem = SCI2C_nelem + 1 + tmpannstring = eval(SharedInfo.Annotations.FUNSIZE); + check_string = stripblanks(mgetl(inclsfid,1)); + if (SCI2Cstrncmps1size(tmpannstring,check_string)) +// #RNU_RES_E + FunSizeAnnot(cntout,SCI2C_nelem) = ... + stripblanks(part(check_string,length(tmpannstring)+1:length(check_string))); + else + readNewLine = %f; + end + else + PrintStringInfo(' ',ReportFileName,'both','y'); + PrintStringInfo('SCI2CERROR: Line '+string(line_position)+' Function size annotation not found in file: '+SCI2CClassFileName,ReportFileName,'both','y'); + PrintStringInfo(' ',ReportFileName,'both','y'); + error(9999, 'SCI2CERROR: Line '+string(line_position)+' Function size annotation not found in file: '+SCI2CClassFileName); + end + end + end + + +end +// --- End loop over the lines of the input file. --- +mclose(inclsfid); +// ------------------------------------------------- +// --- End Read the annotations of the function. --- +// ------------------------------------------------- +PrintStringInfo(' end of annotation '+string(NOutArg_mod),ReportFileName,'file','y'); + +endfunction diff --git a/macros/FunctionAnnotation/FA_GetOutArgInfo.sci b/macros/FunctionAnnotation/FA_GetOutArgInfo.sci index 284f4a29..2324eb6f 100644 --- a/macros/FunctionAnnotation/FA_GetOutArgInfo.sci +++ b/macros/FunctionAnnotation/FA_GetOutArgInfo.sci @@ -1,146 +1,146 @@ -function UpdatedOutArg = ...
- FA_GetOutArgInfo(InArg,NInArg,OutArg,NOutArg,SharedInfo,FunPrecSpecifier, ...
- FunTypeAnnot,FunSizeAnnot,ReportFileName,ASTFunName)
-// function UpdatedOutArg = ...
-// FA_GetOutArgInfo(InArg,NInArg,OutArg,NOutArg,SharedInfo,FunPrecSpecifier,FunTypeAnnot,FunSizeAnnot,ReportFileName)
-// -----------------------------------------------------------------
-// #RNU_RES_B
-// InArg is used by eval don't remove it from the function call.
-//
-// #RNU_RES_E
-// Input data:
-// //NUT: Add description here
-//
-// Output data:
-// //NUT: Add description here
-//
-// Status:
-// 25-Oct-2007 -- Raffaele Nutricato: Author.
-//
-// Copyright 2007 Raffaele Nutricato.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),10,10);
-// -----------------------
-// --- Initialization. ---
-// -----------------------
-
-
-UpdatedOutArg = OutArg;
-for cntin = 1:NInArg
- IN(cntin).TP = InArg(cntin).Type;
- for _InArgSize=1:size(InArg(cntin).Size, '*')
- IN(cntin).SZ(_InArgSize) = InArg(cntin).Size(_InArgSize);
- end
- if ((isnan(InArg(cntin).Value)) & (GetSymbolDimension(InArg(cntin).Size) == 0))
- // #RNU_RES_B
- // IN(cntin).VAL = '__SCI2CNANSIZE'; //RNU: toglimi
- //RNU: Replace the value of the variable with its name, in case it is a scalar variable.
- // #RNU_RES_E
- IN(cntin).VAL = InArg(cntin).Name;
- else
- IN(cntin).VAL = string(InArg(cntin).Value);
- end
-end
-DefaultPrecision = SharedInfo.DefaultPrecision;
-// ---------------------------
-// --- End Initialization. ---
-// ---------------------------
-if (FunTypeAnnot(1) == '')
- NOutArg = 0;
-
-else
- NOutArg = max(size(FunTypeAnnot));
-end
-
-flagfindlike = 0;
-
-for counterin = 1:NInArg
- if (InArg(counterin).FindLike == 1 | InArg(counterin).FindLike == -1)
- // #RNU_RES_B
- // Then we must assume that the output will be findlike
- // 0 = no find-like
- // 1 = pure find-like
- //-1 = similar to find-like (out=fun(in)) where in is find-like.
- // #RNU_RES_E
- flagfindlike = -1;
- end
-end
-
-for counterout = 1:NOutArg
- if(FunTypeAnnot == 'FA_TP_USER')
- UpdatedOutArg(counterout).Type = FA_TP_USER(FunPrecSpecifier,DefaultPrecision);
- else
- UpdatedOutArg(counterout).Type = eval(FunTypeAnnot(counterout));
- end
- UpdatedOutArg(counterout).FindLike = 0;
-
- // This is just to remove the FA_SZ_RTMAX tag ???
- lengthFA_SZ_RTMAX = length('FA_SZ_RTMAX');
- if (SCI2Cstrncmps1size('FA_SZ_RTMAX',FunSizeAnnot(counterout,1)))
- UpdatedOutArg(counterout).FindLike = 1;
- FunSizeAnnot(counterout,1) = part(FunSizeAnnot(counterout,1),lengthFA_SZ_RTMAX+1:length(FunSizeAnnot(counterout,1)));
- end
-
- if (SCI2Cstrncmps1size('FA_SZ_RTMAX',FunSizeAnnot(counterout,2)))
- UpdatedOutArg(counterout).FindLike = 1;
- FunSizeAnnot(counterout,2) = part(FunSizeAnnot(counterout,2),lengthFA_SZ_RTMAX+1:length(FunSizeAnnot(counterout,2)));
- end
-
- if (flagfindlike == -1)
- UpdatedOutArg(counterout).FindLike = -1;
- end
-
-// #RNU_RES_B
-// When the size is given by e IN(x).VAL annotation we can have two cases:
-// IN(x).VAL is a number or IN(x).VAL is %nan. When it is %nan the
-// size is equal to the name of IN(x).
-// This is a dynamic memory extension of a local variable and for the moment
-// we issue an error according to SCI2C specifications
-// #RNU_RES_E
-// disp(FunSizeAnnot(2),FunSizeAnnot(1))
-// Ukasha
-// if ASTFunName == svd
-// x=1;
-// for i=1:InArg(1).Size(1)
-// for j=1:InArg(1).Size(2)
-// A(i)(j)=InArg(1).Value(x);
-// end
-// end
-// [U,S,V]=svd(A,"e");
-
-
-
- for iterOutputPosition=1:size(FunSizeAnnot, 'c')
- tmpeval = eval(FunSizeAnnot(counterout, iterOutputPosition));
- if (IsNanSize(tmpeval))
- if SharedInfo.ForExpr.OnExec == 0
- EM_NanSize(ReportFileName);
- else
- UpdatedOutArg(counterout).Size(iterOutputPosition) = string(tmpeval);
- end
- elseif(isnum(tmpeval))
- if (eval(tmpeval) <= 0)
- EM_ZeroSize(ReportFileName);
- else
- UpdatedOutArg(counterout).Size(iterOutputPosition) = string(tmpeval);
- end
- else
- UpdatedOutArg(counterout).Size(iterOutputPosition) = string(tmpeval);
- end
- end
- if(ASTFunName == 'syslin')
- no_of_st = eval(InArg(2).Size(1))
- no_of_ip = eval(InArg(3).Size(2))
- UpdatedOutArg(counterout).Value = no_of_st+no_of_ip*0.1;
- else
- UpdatedOutArg(counterout).Value = %nan;
- end
- UpdatedOutArg(counterout).Dimension = GetSymbolDimension(UpdatedOutArg(counterout).Size);
- UpdatedOutArg(counterout).Scope = 'Temp';//NUT anche su questo si puo' ragionare verifica anche la handleoperation.
-end
-endfunction
+function UpdatedOutArg = ... + FA_GetOutArgInfo(InArg,NInArg,OutArg,NOutArg,SharedInfo,FunPrecSpecifier, ... + FunTypeAnnot,FunSizeAnnot,ReportFileName,ASTFunName) +// function UpdatedOutArg = ... +// FA_GetOutArgInfo(InArg,NInArg,OutArg,NOutArg,SharedInfo,FunPrecSpecifier,FunTypeAnnot,FunSizeAnnot,ReportFileName) +// ----------------------------------------------------------------- +// #RNU_RES_B +// InArg is used by eval don't remove it from the function call. +// +// #RNU_RES_E +// Input data: +// //NUT: Add description here +// +// Output data: +// //NUT: Add description here +// +// Status: +// 25-Oct-2007 -- Raffaele Nutricato: Author. +// +// Copyright 2007 Raffaele Nutricato. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),10,10); +// ----------------------- +// --- Initialization. --- +// ----------------------- + + +UpdatedOutArg = OutArg; +for cntin = 1:NInArg + IN(cntin).TP = InArg(cntin).Type; + for _InArgSize=1:size(InArg(cntin).Size, '*') + IN(cntin).SZ(_InArgSize) = InArg(cntin).Size(_InArgSize); + end + if ((isnan(InArg(cntin).Value)) & (GetSymbolDimension(InArg(cntin).Size) == 0)) + // #RNU_RES_B + // IN(cntin).VAL = '__SCI2CNANSIZE'; //RNU: toglimi + //RNU: Replace the value of the variable with its name, in case it is a scalar variable. + // #RNU_RES_E + IN(cntin).VAL = InArg(cntin).Name; + else + IN(cntin).VAL = string(InArg(cntin).Value); + end +end +DefaultPrecision = SharedInfo.DefaultPrecision; +// --------------------------- +// --- End Initialization. --- +// --------------------------- +if (FunTypeAnnot(1) == '') + NOutArg = 0; + +else + NOutArg = max(size(FunTypeAnnot)); +end + +flagfindlike = 0; + +for counterin = 1:NInArg + if (InArg(counterin).FindLike == 1 | InArg(counterin).FindLike == -1) + // #RNU_RES_B + // Then we must assume that the output will be findlike + // 0 = no find-like + // 1 = pure find-like + //-1 = similar to find-like (out=fun(in)) where in is find-like. + // #RNU_RES_E + flagfindlike = -1; + end +end + +for counterout = 1:NOutArg + if(FunTypeAnnot == 'FA_TP_USER') + UpdatedOutArg(counterout).Type = FA_TP_USER(FunPrecSpecifier,DefaultPrecision); + else + UpdatedOutArg(counterout).Type = eval(FunTypeAnnot(counterout)); + end + UpdatedOutArg(counterout).FindLike = 0; + + // This is just to remove the FA_SZ_RTMAX tag ??? + lengthFA_SZ_RTMAX = length('FA_SZ_RTMAX'); + if (SCI2Cstrncmps1size('FA_SZ_RTMAX',FunSizeAnnot(counterout,1))) + UpdatedOutArg(counterout).FindLike = 1; + FunSizeAnnot(counterout,1) = part(FunSizeAnnot(counterout,1),lengthFA_SZ_RTMAX+1:length(FunSizeAnnot(counterout,1))); + end + + if (SCI2Cstrncmps1size('FA_SZ_RTMAX',FunSizeAnnot(counterout,2))) + UpdatedOutArg(counterout).FindLike = 1; + FunSizeAnnot(counterout,2) = part(FunSizeAnnot(counterout,2),lengthFA_SZ_RTMAX+1:length(FunSizeAnnot(counterout,2))); + end + + if (flagfindlike == -1) + UpdatedOutArg(counterout).FindLike = -1; + end + +// #RNU_RES_B +// When the size is given by e IN(x).VAL annotation we can have two cases: +// IN(x).VAL is a number or IN(x).VAL is %nan. When it is %nan the +// size is equal to the name of IN(x). +// This is a dynamic memory extension of a local variable and for the moment +// we issue an error according to SCI2C specifications +// #RNU_RES_E +// disp(FunSizeAnnot(2),FunSizeAnnot(1)) +// Ukasha +// if ASTFunName == svd +// x=1; +// for i=1:InArg(1).Size(1) +// for j=1:InArg(1).Size(2) +// A(i)(j)=InArg(1).Value(x); +// end +// end +// [U,S,V]=svd(A,"e"); + + + + for iterOutputPosition=1:size(FunSizeAnnot, 'c') + tmpeval = eval(FunSizeAnnot(counterout, iterOutputPosition)); + if (IsNanSize(tmpeval)) + if SharedInfo.ForExpr.OnExec == 0 + EM_NanSize(ReportFileName); + else + UpdatedOutArg(counterout).Size(iterOutputPosition) = string(tmpeval); + end + elseif(isnum(tmpeval)) + if (eval(tmpeval) <= 0) + EM_ZeroSize(ReportFileName); + else + UpdatedOutArg(counterout).Size(iterOutputPosition) = string(tmpeval); + end + else + UpdatedOutArg(counterout).Size(iterOutputPosition) = string(tmpeval); + end + end + if(ASTFunName == 'syslin') + no_of_st = eval(InArg(2).Size(1)) + no_of_ip = eval(InArg(3).Size(2)) + UpdatedOutArg(counterout).Value = no_of_st+no_of_ip*0.1; + else + UpdatedOutArg(counterout).Value = %nan; + end + UpdatedOutArg(counterout).Dimension = GetSymbolDimension(UpdatedOutArg(counterout).Size); + UpdatedOutArg(counterout).Scope = 'Temp';//NUT anche su questo si puo' ragionare verifica anche la handleoperation. +end +endfunction diff --git a/macros/FunctionAnnotation/FA_GetResizeApproach.sci b/macros/FunctionAnnotation/FA_GetResizeApproach.sci index 4db6054c..f883cace 100644 --- a/macros/FunctionAnnotation/FA_GetResizeApproach.sci +++ b/macros/FunctionAnnotation/FA_GetResizeApproach.sci @@ -1,87 +1,87 @@ -function ResizeApproach = FA_GetResizeApproach(scifilename,scifileid,ReportFileName)
-
-// function ResizeApproach = FA_GetResizeApproach(scifilename,ReportFileName)
-// -----------------------------------------------------------------
-// Extracts the resize approach from the file .sci passed in input.
-// The following annotation will be searched in the scilab code:
-// //SCI2C: RESIZE_APPROACH= NO_RESIZE
-// //SCI2C: RESIZE_APPROACH= RESIZE_ALL
-// //SCI2C: RESIZE_APPROACH= REALLOC_ALL_RESIZE_ALL
-// //SCI2C: RESIZE_APPROACH= RESIZE_TEMP
-// //SCI2C: RESIZE_APPROACH= RESIZE_LOCAL
-// //SCI2C: RESIZE_APPROACH= RESIZE_GLOBAL
-// If the annotation is missing the default NO_RESIZE approach will be
-// implicitly used.
-//
-// Input data:
-// ---
-//
-// Output data:
-// ResizeApproach: string which specifies the resize approach
-// used in the translation of scifilename.
-//
-// Status:
-// 12-Jul-2008 -- Raffaele Nutricato: Author.
-//
-// Copyright 2008 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),3,3);
-
-// -----------------------
-// --- Initialization. ---
-// -----------------------
-ResizeApproach = 'NO_RESIZE';
-annotationstring = '//SCI2C: RESIZE_APPROACH='
-PrintStringInfo('***Get resize approach from: '+scifilename,ReportFileName,'file','y'); // #RNUREM_ME
-// ---------------------------
-// --- End Initialization. ---
-// ---------------------------
-
-// --- Open the .sci file (read only). ---
-if scifileid == [] then
- scifid = SCI2COpenFileRead(scifilename);
-else
- scifid = scifileid;
-end
-
-// --- Loop over the lines of the input file. ---
-// Position file pointer to the desired NInArg/NOutArg section,
-// and read the NOutArg annotation.
-foundannotation = 0;
-line_position = 0;
-
-while ((meof(scifid) == 0) & (foundannotation == 0))
- check_string = stripblanks(mgetl(scifid,1));
- line_position = line_position + 1;
- if (~isempty(check_string))
- if (SCI2Cstrncmps1size(annotationstring,check_string))
- tmpresize = stripblanks(part(check_string,length(annotationstring)+1:length(check_string)));
- // #RNU_RES_B
- PrintStringInfo(' Line '+string(line_position)+...
- ' - Found annotation for resize approach'+' ""'+check_string+' ""',...
- ReportFileName,'file','y');
- // #RNU_RES_E
- foundannotation = 1;
- end
- end
-end
-
-if (foundannotation == 0)
- // #RNU_RES_B
- PrintStringInfo('Annotation for resize approach not found.',ReportFileName,'file','y');
- PrintStringInfo('Using the ''NO_RESIZE'' resize approach.',ReportFileName,'file','y');
- // #RNU_RES_E
-else
- ResizeApproach = tmpresize;
-end
-if scifileid == [] then
-mclose(scifid);
-else
-mseek(0, scifid)
-end
-endfunction
+function ResizeApproach = FA_GetResizeApproach(scifilename,scifileid,ReportFileName) + +// function ResizeApproach = FA_GetResizeApproach(scifilename,ReportFileName) +// ----------------------------------------------------------------- +// Extracts the resize approach from the file .sci passed in input. +// The following annotation will be searched in the scilab code: +// //SCI2C: RESIZE_APPROACH= NO_RESIZE +// //SCI2C: RESIZE_APPROACH= RESIZE_ALL +// //SCI2C: RESIZE_APPROACH= REALLOC_ALL_RESIZE_ALL +// //SCI2C: RESIZE_APPROACH= RESIZE_TEMP +// //SCI2C: RESIZE_APPROACH= RESIZE_LOCAL +// //SCI2C: RESIZE_APPROACH= RESIZE_GLOBAL +// If the annotation is missing the default NO_RESIZE approach will be +// implicitly used. +// +// Input data: +// --- +// +// Output data: +// ResizeApproach: string which specifies the resize approach +// used in the translation of scifilename. +// +// Status: +// 12-Jul-2008 -- Raffaele Nutricato: Author. +// +// Copyright 2008 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),3,3); + +// ----------------------- +// --- Initialization. --- +// ----------------------- +ResizeApproach = 'NO_RESIZE'; +annotationstring = '//SCI2C: RESIZE_APPROACH=' +PrintStringInfo('***Get resize approach from: '+scifilename,ReportFileName,'file','y'); // #RNUREM_ME +// --------------------------- +// --- End Initialization. --- +// --------------------------- + +// --- Open the .sci file (read only). --- +if scifileid == [] then + scifid = SCI2COpenFileRead(scifilename); +else + scifid = scifileid; +end + +// --- Loop over the lines of the input file. --- +// Position file pointer to the desired NInArg/NOutArg section, +// and read the NOutArg annotation. +foundannotation = 0; +line_position = 0; + +while ((meof(scifid) == 0) & (foundannotation == 0)) + check_string = stripblanks(mgetl(scifid,1)); + line_position = line_position + 1; + if (~isempty(check_string)) + if (SCI2Cstrncmps1size(annotationstring,check_string)) + tmpresize = stripblanks(part(check_string,length(annotationstring)+1:length(check_string))); + // #RNU_RES_B + PrintStringInfo(' Line '+string(line_position)+... + ' - Found annotation for resize approach'+' ""'+check_string+' ""',... + ReportFileName,'file','y'); + // #RNU_RES_E + foundannotation = 1; + end + end +end + +if (foundannotation == 0) + // #RNU_RES_B + PrintStringInfo('Annotation for resize approach not found.',ReportFileName,'file','y'); + PrintStringInfo('Using the ''NO_RESIZE'' resize approach.',ReportFileName,'file','y'); + // #RNU_RES_E +else + ResizeApproach = tmpresize; +end +if scifileid == [] then +mclose(scifid); +else +mseek(0, scifid) +end +endfunction diff --git a/macros/FunctionAnnotation/FA_INT.sci b/macros/FunctionAnnotation/FA_INT.sci index e1bdba33..37248d35 100644 --- a/macros/FunctionAnnotation/FA_INT.sci +++ b/macros/FunctionAnnotation/FA_INT.sci @@ -1,40 +1,40 @@ -function opout = FA_INT(in1)
-// function opout = FA_INT(in1)
-// -----------------------------------------------------------------
-// Int function for Function Annotations.
-// When in1 is a number opout = int(in1); where int truncates in1
-// to integer. If in1 is string opout = in1.
-//
-// Input data:
-// in1: string specifying a number or a symbol.
-//
-// Output data:
-// opout: string containing the computed result.
-//
-// Status:
-// 26-Oct-2007 -- Raffaele Nutricato: Author.
-// 26-Oct-2007 -- Alberto Morea: Test Ok.
-//
-// Copyright 2008 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),1,1);
-
-// ------------------------
-// --- Generate Output. ---
-// ------------------------
-if (isnum(in1))
- outnum = int(eval(in1));
- if isnan(outnum)
- opout = '__SCI2CNANSIZE';
- else
- opout = string(outnum);
- end
-else
- opout = in1;
-end
-endfunction
+function opout = FA_INT(in1) +// function opout = FA_INT(in1) +// ----------------------------------------------------------------- +// Int function for Function Annotations. +// When in1 is a number opout = int(in1); where int truncates in1 +// to integer. If in1 is string opout = in1. +// +// Input data: +// in1: string specifying a number or a symbol. +// +// Output data: +// opout: string containing the computed result. +// +// Status: +// 26-Oct-2007 -- Raffaele Nutricato: Author. +// 26-Oct-2007 -- Alberto Morea: Test Ok. +// +// Copyright 2008 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),1,1); + +// ------------------------ +// --- Generate Output. --- +// ------------------------ +if (isnum(in1)) + outnum = int(eval(in1)); + if isnan(outnum) + opout = '__SCI2CNANSIZE'; + else + opout = string(outnum); + end +else + opout = in1; +end +endfunction diff --git a/macros/FunctionAnnotation/FA_MUL.sci b/macros/FunctionAnnotation/FA_MUL.sci index 8c9a930a..50f35262 100644 --- a/macros/FunctionAnnotation/FA_MUL.sci +++ b/macros/FunctionAnnotation/FA_MUL.sci @@ -1,42 +1,42 @@ -function opout = FA_MUL(in1,in2)
-// function opout = FA_MUL(in1,in2)
-// -----------------------------------------------------------------
-// Multiplication function for Function Annotations.
-//
-// Input data:
-// in1: string specifying a number or a symbol.
-// in2: string specifying a number or a symbol.
-//
-// Output data:
-// opout: string containing the computed result.
-//
-// Status:
-// 26-Oct-2007 -- Raffaele Nutricato: Author.
-// 26-Oct-2007 -- Alberto Morea: Test Ok.
-//
-// Copyright 2007 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),2,2);
-
-
-// ------------------------
-// --- Generate Output. ---
-// ------------------------
-if (isnum(in1) & isnum(in2))
- in1num = eval(in1);
- in2num = eval(in2);
- outnum = in1num*in2num;
- if isnan(outnum)
- opout = '__SCI2CNANSIZE';
- else
- opout = string(outnum);
- end
-else
- opout = '('+string(in1)+'*'+string(in2)+')';
-end
-endfunction
+function opout = FA_MUL(in1,in2) +// function opout = FA_MUL(in1,in2) +// ----------------------------------------------------------------- +// Multiplication function for Function Annotations. +// +// Input data: +// in1: string specifying a number or a symbol. +// in2: string specifying a number or a symbol. +// +// Output data: +// opout: string containing the computed result. +// +// Status: +// 26-Oct-2007 -- Raffaele Nutricato: Author. +// 26-Oct-2007 -- Alberto Morea: Test Ok. +// +// Copyright 2007 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),2,2); + + +// ------------------------ +// --- Generate Output. --- +// ------------------------ +if (isnum(in1) & isnum(in2)) + in1num = eval(in1); + in2num = eval(in2); + outnum = in1num*in2num; + if isnan(outnum) + opout = '__SCI2CNANSIZE'; + else + opout = string(outnum); + end +else + opout = '('+string(in1)+'*'+string(in2)+')'; +end +endfunction diff --git a/macros/FunctionAnnotation/FA_SUB.sci b/macros/FunctionAnnotation/FA_SUB.sci index 1ef0ad46..36228c57 100644 --- a/macros/FunctionAnnotation/FA_SUB.sci +++ b/macros/FunctionAnnotation/FA_SUB.sci @@ -1,41 +1,41 @@ -function opout = FA_SUB(in1,in2)
-// function opout = FA_SUB(in1,in2)
-// -----------------------------------------------------------------
-// Subtraction function for Function Annotations.
-//
-// Input data:
-// in1: string specifying a number or a symbol.
-// in2: string specifying a number or a symbol.
-//
-// Output data:
-// opout: string containing the computed result.
-//
-// Status:
-// 26-Oct-2007 -- Raffaele Nutricato: Author.
-// 26-Oct-2007 -- Alberto Morea: Test Ok.
-//
-// Copyright 2007 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),2,2);
-
-// ------------------------
-// --- Generate Output. ---
-// ------------------------
-if (isnum(in1) & isnum(in2))
- in1num = eval(in1);
- in2num = eval(in2);
- outnum = in1num-in2num;
- if isnan(outnum)
- opout = '__SCI2CNANSIZE';
- else
- opout = string(outnum);
- end
-else
- opout = '('+string(in1)+'-'+string(in2)+')';
-end
-endfunction
+function opout = FA_SUB(in1,in2) +// function opout = FA_SUB(in1,in2) +// ----------------------------------------------------------------- +// Subtraction function for Function Annotations. +// +// Input data: +// in1: string specifying a number or a symbol. +// in2: string specifying a number or a symbol. +// +// Output data: +// opout: string containing the computed result. +// +// Status: +// 26-Oct-2007 -- Raffaele Nutricato: Author. +// 26-Oct-2007 -- Alberto Morea: Test Ok. +// +// Copyright 2007 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),2,2); + +// ------------------------ +// --- Generate Output. --- +// ------------------------ +if (isnum(in1) & isnum(in2)) + in1num = eval(in1); + in2num = eval(in2); + outnum = in1num-in2num; + if isnan(outnum) + opout = '__SCI2CNANSIZE'; + else + opout = string(outnum); + end +else + opout = '('+string(in1)+'-'+string(in2)+')'; +end +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_1.sci b/macros/FunctionAnnotation/FA_SZ_1.sci index 3d20b992..14e1c437 100644 --- a/macros/FunctionAnnotation/FA_SZ_1.sci +++ b/macros/FunctionAnnotation/FA_SZ_1.sci @@ -1,21 +1,21 @@ -function outsize = FA_SZ_1(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.
-// -----------------------------------------------------------------
-
-outsize = insize(1);
-
-endfunction
+function outsize = FA_SZ_1(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. +// ----------------------------------------------------------------- + +outsize = insize(1); + +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_2.sci b/macros/FunctionAnnotation/FA_SZ_2.sci index 164cab3f..433f8b0d 100644 --- a/macros/FunctionAnnotation/FA_SZ_2.sci +++ b/macros/FunctionAnnotation/FA_SZ_2.sci @@ -1,21 +1,21 @@ -function outsize = FA_SZ_2(insize)
-// function outsize = FA_SZ_2(insize)
-// -----------------------------------------------------------------
-// Returns the second 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: second element of the insize array.
-//
-// Status:
-// 08-Dec-2007 -- Raffaele Nutricato: Author.
-// 08-Dec-2007 -- Alberto Morea: Test Ok.
-// -----------------------------------------------------------------
-
-outsize = insize(2);
-
-endfunction
+function outsize = FA_SZ_2(insize) +// function outsize = FA_SZ_2(insize) +// ----------------------------------------------------------------- +// Returns the second 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: second element of the insize array. +// +// Status: +// 08-Dec-2007 -- Raffaele Nutricato: Author. +// 08-Dec-2007 -- Alberto Morea: Test Ok. +// ----------------------------------------------------------------- + +outsize = insize(2); + +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_OPAPEX.sci b/macros/FunctionAnnotation/FA_SZ_OPAPEX.sci index a93e8c50..2b4fd2df 100644 --- a/macros/FunctionAnnotation/FA_SZ_OPAPEX.sci +++ b/macros/FunctionAnnotation/FA_SZ_OPAPEX.sci @@ -1,26 +1,26 @@ -function opoutsize = FA_SZ_OPAPEX(in1size)
-// function opoutsize = FA_SZ_OPAPEX(in1size)
-// -----------------------------------------------------------------
-// Returns the size of the output computed by OPAPEX operator.
-//
-//
-// Status:
-// 08-Jan-2008 -- Raffaele Nutricato: Author.
-// 08-Jan-2008 -- Alberto Morea: Test Ok.
-//
-// Copyright 2008 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),1,1);
-
-// ------------------------
-// --- Generate Output. ---
-// ------------------------
-opoutsize(1) = string(in1size(2));
-opoutsize(2) = string(in1size(1));
-
-endfunction
+function opoutsize = FA_SZ_OPAPEX(in1size) +// function opoutsize = FA_SZ_OPAPEX(in1size) +// ----------------------------------------------------------------- +// Returns the size of the output computed by OPAPEX operator. +// +// +// Status: +// 08-Jan-2008 -- Raffaele Nutricato: Author. +// 08-Jan-2008 -- Alberto Morea: Test Ok. +// +// Copyright 2008 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),1,1); + +// ------------------------ +// --- Generate Output. --- +// ------------------------ +opoutsize(1) = string(in1size(2)); +opoutsize(2) = string(in1size(1)); + +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_OPBACKSLASH.sci b/macros/FunctionAnnotation/FA_SZ_OPBACKSLASH.sci index 9d0625bd..9f4da318 100644 --- a/macros/FunctionAnnotation/FA_SZ_OPBACKSLASH.sci +++ b/macros/FunctionAnnotation/FA_SZ_OPBACKSLASH.sci @@ -1,39 +1,39 @@ -function opoutsize = FA_SZ_OPBACKSLASH(in1size,in2size)
-// function opoutsize = FA_SZ_OPBACKSLASH(in1size,in2size)
-// -----------------------------------------------------------------
-// Returns the size of the output computed by OPBACKSLASH operator.
-//
-//
-// Status:
-// 08-Mar-2008 -- Alberto Morea: Author.
-// 08-Mar-2008 -- Raffaele Nutricato: Test Ok.
-//
-// Copyright 2008 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),2,2);
-
-// ------------------------
-// --- Generate Output. ---
-// ------------------------
-in1size=string(in1size);
-in2size=string(in2size);
-
-// --- Get dimensions of input arguments. ---
-in1dim = GetSymbolDimension(in1size);
-in2dim = GetSymbolDimension(in2size);
-
-if (in1dim == 0)
- opoutsize = in2size;
-elseif (in2dim == 0)
- opoutsize = in1size;
-else
- opoutsize(1) = in1size(2);
- opoutsize(2) = in2size(2);
-end
-
-endfunction
+function opoutsize = FA_SZ_OPBACKSLASH(in1size,in2size) +// function opoutsize = FA_SZ_OPBACKSLASH(in1size,in2size) +// ----------------------------------------------------------------- +// Returns the size of the output computed by OPBACKSLASH operator. +// +// +// Status: +// 08-Mar-2008 -- Alberto Morea: Author. +// 08-Mar-2008 -- Raffaele Nutricato: Test Ok. +// +// Copyright 2008 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),2,2); + +// ------------------------ +// --- Generate Output. --- +// ------------------------ +in1size=string(in1size); +in2size=string(in2size); + +// --- Get dimensions of input arguments. --- +in1dim = GetSymbolDimension(in1size); +in2dim = GetSymbolDimension(in2size); + +if (in1dim == 0) + opoutsize = in2size; +elseif (in2dim == 0) + opoutsize = in1size; +else + opoutsize(1) = in1size(2); + opoutsize(2) = in2size(2); +end + +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_OPCC.sci b/macros/FunctionAnnotation/FA_SZ_OPCC.sci index 50527771..55638cf0 100644 --- a/macros/FunctionAnnotation/FA_SZ_OPCC.sci +++ b/macros/FunctionAnnotation/FA_SZ_OPCC.sci @@ -1,40 +1,40 @@ -function opoutsize = FA_SZ_OPCC(in1size,in2size)
-// function opoutsize = FA_SZ_OPCC(in1size,in2size)
-// -----------------------------------------------------------------
-// Returns the size of the output computed by OPCC operator.
-//
-//
-// Status:
-// 08-Mar-2008 -- Raffaele Nutricato: Author.
-// 08-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);
-
-in1size = string(in1size);
-in2size = string(in2size);
-
-// ------------------------
-// --- Generate Output. ---
-// ------------------------
-// --- Get dimensions of input arguments. ---
-in1dim = GetSymbolDimension(in1size);
-in2dim = GetSymbolDimension(in2size);
-
-if (isnum(in1size(1)) & isnum(in2size(1)))
- in1num = eval(in1size(1));
- in2num = eval(in2size(1));
- opoutsize(1) = string(in1num+in2num);
-else
- opoutsize(1) = '('+string(in1size(1))+'+'+string(in2size(1))+')';
-end
-
-opoutsize(2) = in1size(2);
-
-endfunction
+function opoutsize = FA_SZ_OPCC(in1size,in2size) +// function opoutsize = FA_SZ_OPCC(in1size,in2size) +// ----------------------------------------------------------------- +// Returns the size of the output computed by OPCC operator. +// +// +// Status: +// 08-Mar-2008 -- Raffaele Nutricato: Author. +// 08-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); + +in1size = string(in1size); +in2size = string(in2size); + +// ------------------------ +// --- Generate Output. --- +// ------------------------ +// --- Get dimensions of input arguments. --- +in1dim = GetSymbolDimension(in1size); +in2dim = GetSymbolDimension(in2size); + +if (isnum(in1size(1)) & isnum(in2size(1))) + in1num = eval(in1size(1)); + in2num = eval(in2size(1)); + opoutsize(1) = string(in1num+in2num); +else + opoutsize(1) = '('+string(in1size(1))+'+'+string(in2size(1))+')'; +end + +opoutsize(2) = in1size(2); + +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_OPDOTAPEX.sci b/macros/FunctionAnnotation/FA_SZ_OPDOTAPEX.sci index 64e8030e..b8b36218 100644 --- a/macros/FunctionAnnotation/FA_SZ_OPDOTAPEX.sci +++ b/macros/FunctionAnnotation/FA_SZ_OPDOTAPEX.sci @@ -1,16 +1,16 @@ -function opoutsize = FA_SZ_OPDOTAPEX(in1size)
-// function opoutsize = FA_SZ_OPDOTAPEX(in1size)
-// -----------------------------------------------------------------
-// Alias of FA_SZ_OPDOTAPEX.
-//
-//
-// Status:
-// 08-Mar-2008 -- Raffaele Nutricato: Author.
-// 08-Mar-2008 -- Alberto Morea: Test Ok.
-//
-// Copyright 2008 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-opoutsize = FA_SZ_OPDOTAPEX(in1size,in2size);
-endfunction
+function opoutsize = FA_SZ_OPDOTAPEX(in1size) +// function opoutsize = FA_SZ_OPDOTAPEX(in1size) +// ----------------------------------------------------------------- +// Alias of FA_SZ_OPDOTAPEX. +// +// +// Status: +// 08-Mar-2008 -- Raffaele Nutricato: Author. +// 08-Mar-2008 -- Alberto Morea: Test Ok. +// +// Copyright 2008 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +opoutsize = FA_SZ_OPDOTAPEX(in1size,in2size); +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_OPDOTBACKSLASH.sci b/macros/FunctionAnnotation/FA_SZ_OPDOTBACKSLASH.sci index 75f4d5c3..2baeb0f3 100644 --- a/macros/FunctionAnnotation/FA_SZ_OPDOTBACKSLASH.sci +++ b/macros/FunctionAnnotation/FA_SZ_OPDOTBACKSLASH.sci @@ -1,16 +1,16 @@ -function opoutsize = FA_SZ_OPDOTBACKSLASH(in1size,in2size)
-// function opoutsize = FA_SZ_OPDOTBACKSLASH(in1size,in2size)
-// -----------------------------------------------------------------
-// Alias of FA_SZ_OPDOTSTAR.
-//
-//
-// Status:
-// 08-Mar-2008 -- Raffaele Nutricato: Author.
-// 08-Mar-2008 -- Alberto Morea: Test Ok.
-//
-// Copyright 2008 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size);
-endfunction
+function opoutsize = FA_SZ_OPDOTBACKSLASH(in1size,in2size) +// function opoutsize = FA_SZ_OPDOTBACKSLASH(in1size,in2size) +// ----------------------------------------------------------------- +// Alias of FA_SZ_OPDOTSTAR. +// +// +// Status: +// 08-Mar-2008 -- Raffaele Nutricato: Author. +// 08-Mar-2008 -- Alberto Morea: Test Ok. +// +// Copyright 2008 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size); +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_OPDOTHAT.sci b/macros/FunctionAnnotation/FA_SZ_OPDOTHAT.sci index af522bac..024284e2 100644 --- a/macros/FunctionAnnotation/FA_SZ_OPDOTHAT.sci +++ b/macros/FunctionAnnotation/FA_SZ_OPDOTHAT.sci @@ -1,43 +1,43 @@ -function opoutsize = FA_SZ_OPDOTHAT(in1size,in2size)
-// function opoutsize = FA_SZ_OPDOTHAT(in1size,in2size)
-// -----------------------------------------------------------------
-// Returns the size of the output computed by OPDOTHAT operator.
-//
-// 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.
-//
-// 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:
-// 10-Dec-2007 -- Raffaele Nutricato: Author.
-// 10-Dec-2007 -- Alberto Morea: Test Ok.
-// -----------------------------------------------------------------
-
-opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size);
-
-endfunction
+function opoutsize = FA_SZ_OPDOTHAT(in1size,in2size) +// function opoutsize = FA_SZ_OPDOTHAT(in1size,in2size) +// ----------------------------------------------------------------- +// Returns the size of the output computed by OPDOTHAT operator. +// +// 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. +// +// 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: +// 10-Dec-2007 -- Raffaele Nutricato: Author. +// 10-Dec-2007 -- Alberto Morea: Test Ok. +// ----------------------------------------------------------------- + +opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size); + +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_OPDOTSLASH.sci b/macros/FunctionAnnotation/FA_SZ_OPDOTSLASH.sci index 2a071f27..dc760757 100644 --- a/macros/FunctionAnnotation/FA_SZ_OPDOTSLASH.sci +++ b/macros/FunctionAnnotation/FA_SZ_OPDOTSLASH.sci @@ -1,16 +1,16 @@ -function opoutsize = FA_SZ_OPDOTSLASH(in1size,in2size)
-// function opoutsize = FA_SZ_OPDOTSLASH(in1size,in2size)
-// -----------------------------------------------------------------
-// Alias of FA_SZ_OPDOTSTAR.
-//
-//
-// Status:
-// 08-Mar-2008 -- Raffaele Nutricato: Author.
-// 08-Mar-2008 -- Alberto Morea: Test Ok.
-//
-// Copyright 2008 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size);
-endfunction
+function opoutsize = FA_SZ_OPDOTSLASH(in1size,in2size) +// function opoutsize = FA_SZ_OPDOTSLASH(in1size,in2size) +// ----------------------------------------------------------------- +// Alias of FA_SZ_OPDOTSTAR. +// +// +// Status: +// 08-Mar-2008 -- Raffaele Nutricato: Author. +// 08-Mar-2008 -- Alberto Morea: Test Ok. +// +// Copyright 2008 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size); +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_OPDOTSTAR.sci b/macros/FunctionAnnotation/FA_SZ_OPDOTSTAR.sci index 3fbae19a..1263f127 100644 --- a/macros/FunctionAnnotation/FA_SZ_OPDOTSTAR.sci +++ b/macros/FunctionAnnotation/FA_SZ_OPDOTSTAR.sci @@ -1,32 +1,32 @@ -function opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size)
-// function opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size)
-// -----------------------------------------------------------------
-// Returns the size of the output computed by OPDOTSTAR operator.
-//
-//
-// Status:
-// 08-Jan-2008 -- Raffaele Nutricato: Author.
-// 08-Jan-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. ---
-in1dim = GetSymbolDimension(in1size);
-
-if (in1dim == 0)
- opoutsize = string(in2size);
-else
- opoutsize = string(in1size);
-end
-
-endfunction
+function opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size) +// function opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size) +// ----------------------------------------------------------------- +// Returns the size of the output computed by OPDOTSTAR operator. +// +// +// Status: +// 08-Jan-2008 -- Raffaele Nutricato: Author. +// 08-Jan-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. --- +in1dim = GetSymbolDimension(in1size); + +if (in1dim == 0) + opoutsize = string(in2size); +else + opoutsize = string(in1size); +end + +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_OPHAT.sci b/macros/FunctionAnnotation/FA_SZ_OPHAT.sci index 31174511..aac56372 100644 --- a/macros/FunctionAnnotation/FA_SZ_OPHAT.sci +++ b/macros/FunctionAnnotation/FA_SZ_OPHAT.sci @@ -1,43 +1,43 @@ -function opoutsize = FA_SZ_OPHAT(in1size,in2size)
-// function opoutsize = FA_SZ_OPHAT(in1size,in2size)
-// -----------------------------------------------------------------
-// Returns the size of the output computed by OPHAT operator.
-//
-// 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.
-//
-// 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:
-// 10-Dec-2007 -- Raffaele Nutricato: Author.
-// 10-Dec-2007 -- Alberto Morea: Test Ok.
-// -----------------------------------------------------------------
-
-opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size);
-
-endfunction
+function opoutsize = FA_SZ_OPHAT(in1size,in2size) +// function opoutsize = FA_SZ_OPHAT(in1size,in2size) +// ----------------------------------------------------------------- +// Returns the size of the output computed by OPHAT operator. +// +// 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. +// +// 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: +// 10-Dec-2007 -- Raffaele Nutricato: Author. +// 10-Dec-2007 -- Alberto Morea: Test Ok. +// ----------------------------------------------------------------- + +opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size); + +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_OPLOGAND.sci b/macros/FunctionAnnotation/FA_SZ_OPLOGAND.sci index 099bb9ac..29748c2c 100644 --- a/macros/FunctionAnnotation/FA_SZ_OPLOGAND.sci +++ b/macros/FunctionAnnotation/FA_SZ_OPLOGAND.sci @@ -1,16 +1,16 @@ -function opoutsize = FA_SZ_OPLOGAND(in1size,in2size)
-// function opoutsize = FA_SZ_OPLOGAND(in1size,in2size)
-// -----------------------------------------------------------------
-// Alias of FA_SZ_OPDOTSTAR.
-//
-//
-// Status:
-// 08-Mar-2008 -- Raffaele Nutricato: Author.
-// 08-Mar-2008 -- Alberto Morea: Test Ok.
-//
-// Copyright 2008 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size);
-endfunction
+function opoutsize = FA_SZ_OPLOGAND(in1size,in2size) +// function opoutsize = FA_SZ_OPLOGAND(in1size,in2size) +// ----------------------------------------------------------------- +// Alias of FA_SZ_OPDOTSTAR. +// +// +// Status: +// 08-Mar-2008 -- Raffaele Nutricato: Author. +// 08-Mar-2008 -- Alberto Morea: Test Ok. +// +// Copyright 2008 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size); +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_OPLOGEQ.sci b/macros/FunctionAnnotation/FA_SZ_OPLOGEQ.sci index 4ade6a0f..ecb30035 100644 --- a/macros/FunctionAnnotation/FA_SZ_OPLOGEQ.sci +++ b/macros/FunctionAnnotation/FA_SZ_OPLOGEQ.sci @@ -1,16 +1,16 @@ -function opoutsize = FA_SZ_OPLOGEQ(in1size,in2size)
-// function opoutsize = FA_SZ_OPLOGEQ(in1size,in2size)
-// -----------------------------------------------------------------
-// Alias of FA_SZ_OPDOTSTAR.
-//
-//
-// Status:
-// 08-Mar-2008 -- Raffaele Nutricato: Author.
-// 08-Mar-2008 -- Alberto Morea: Test Ok.
-//
-// Copyright 2008 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size);
-endfunction
+function opoutsize = FA_SZ_OPLOGEQ(in1size,in2size) +// function opoutsize = FA_SZ_OPLOGEQ(in1size,in2size) +// ----------------------------------------------------------------- +// Alias of FA_SZ_OPDOTSTAR. +// +// +// Status: +// 08-Mar-2008 -- Raffaele Nutricato: Author. +// 08-Mar-2008 -- Alberto Morea: Test Ok. +// +// Copyright 2008 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size); +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_OPLOGGE.sci b/macros/FunctionAnnotation/FA_SZ_OPLOGGE.sci index c6d6ee3f..702d9171 100644 --- a/macros/FunctionAnnotation/FA_SZ_OPLOGGE.sci +++ b/macros/FunctionAnnotation/FA_SZ_OPLOGGE.sci @@ -1,16 +1,16 @@ -function opoutsize = FA_SZ_OPLOGGE(in1size,in2size)
-// function opoutsize = FA_SZ_OPLOGGE(in1size,in2size)
-// -----------------------------------------------------------------
-// Alias of FA_SZ_OPDOTSTAR.
-//
-//
-// Status:
-// 08-Mar-2008 -- Raffaele Nutricato: Author.
-// 08-Mar-2008 -- Alberto Morea: Test Ok.
-//
-// Copyright 2008 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size);
-endfunction
+function opoutsize = FA_SZ_OPLOGGE(in1size,in2size) +// function opoutsize = FA_SZ_OPLOGGE(in1size,in2size) +// ----------------------------------------------------------------- +// Alias of FA_SZ_OPDOTSTAR. +// +// +// Status: +// 08-Mar-2008 -- Raffaele Nutricato: Author. +// 08-Mar-2008 -- Alberto Morea: Test Ok. +// +// Copyright 2008 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size); +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_OPLOGGT.sci b/macros/FunctionAnnotation/FA_SZ_OPLOGGT.sci index 0f6493c9..5a15d26e 100644 --- a/macros/FunctionAnnotation/FA_SZ_OPLOGGT.sci +++ b/macros/FunctionAnnotation/FA_SZ_OPLOGGT.sci @@ -1,16 +1,16 @@ -function opoutsize = FA_SZ_OPLOGGT(in1size,in2size)
-// function opoutsize = FA_SZ_OPLOGGT(in1size,in2size)
-// -----------------------------------------------------------------
-// Alias of FA_SZ_OPDOTSTAR.
-//
-//
-// Status:
-// 08-Mar-2008 -- Raffaele Nutricato: Author.
-// 08-Mar-2008 -- Alberto Morea: Test Ok.
-//
-// Copyright 2008 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size);
-endfunction
+function opoutsize = FA_SZ_OPLOGGT(in1size,in2size) +// function opoutsize = FA_SZ_OPLOGGT(in1size,in2size) +// ----------------------------------------------------------------- +// Alias of FA_SZ_OPDOTSTAR. +// +// +// Status: +// 08-Mar-2008 -- Raffaele Nutricato: Author. +// 08-Mar-2008 -- Alberto Morea: Test Ok. +// +// Copyright 2008 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size); +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_OPLOGLE.sci b/macros/FunctionAnnotation/FA_SZ_OPLOGLE.sci index edda359f..2e2e8621 100644 --- a/macros/FunctionAnnotation/FA_SZ_OPLOGLE.sci +++ b/macros/FunctionAnnotation/FA_SZ_OPLOGLE.sci @@ -1,16 +1,16 @@ -function opoutsize = FA_SZ_OPLOGLE(in1size,in2size)
-// function opoutsize = FA_SZ_OPLOGLE(in1size,in2size)
-// -----------------------------------------------------------------
-// Alias of FA_SZ_OPDOTSTAR.
-//
-//
-// Status:
-// 08-Mar-2008 -- Raffaele Nutricato: Author.
-// 08-Mar-2008 -- Alberto Morea: Test Ok.
-//
-// Copyright 2008 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size);
-endfunction
+function opoutsize = FA_SZ_OPLOGLE(in1size,in2size) +// function opoutsize = FA_SZ_OPLOGLE(in1size,in2size) +// ----------------------------------------------------------------- +// Alias of FA_SZ_OPDOTSTAR. +// +// +// Status: +// 08-Mar-2008 -- Raffaele Nutricato: Author. +// 08-Mar-2008 -- Alberto Morea: Test Ok. +// +// Copyright 2008 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size); +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_OPLOGLT.sci b/macros/FunctionAnnotation/FA_SZ_OPLOGLT.sci index 81b1b256..92fe9305 100644 --- a/macros/FunctionAnnotation/FA_SZ_OPLOGLT.sci +++ b/macros/FunctionAnnotation/FA_SZ_OPLOGLT.sci @@ -1,16 +1,16 @@ -function opoutsize = FA_SZ_OPLOGLT(in1size,in2size)
-// function opoutsize = FA_SZ_OPLOGLT(in1size,in2size)
-// -----------------------------------------------------------------
-// Alias of FA_SZ_OPDOTSTAR.
-//
-//
-// Status:
-// 08-Mar-2008 -- Raffaele Nutricato: Author.
-// 08-Mar-2008 -- Alberto Morea: Test Ok.
-//
-// Copyright 2008 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size);
-endfunction
+function opoutsize = FA_SZ_OPLOGLT(in1size,in2size) +// function opoutsize = FA_SZ_OPLOGLT(in1size,in2size) +// ----------------------------------------------------------------- +// Alias of FA_SZ_OPDOTSTAR. +// +// +// Status: +// 08-Mar-2008 -- Raffaele Nutricato: Author. +// 08-Mar-2008 -- Alberto Morea: Test Ok. +// +// Copyright 2008 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size); +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_OPLOGNE.sci b/macros/FunctionAnnotation/FA_SZ_OPLOGNE.sci index ff62abbf..785c6b3c 100644 --- a/macros/FunctionAnnotation/FA_SZ_OPLOGNE.sci +++ b/macros/FunctionAnnotation/FA_SZ_OPLOGNE.sci @@ -1,16 +1,16 @@ -function opoutsize = FA_SZ_OPLOGNE(in1size,in2size)
-// function opoutsize = FA_SZ_OPLOGNE(in1size,in2size)
-// -----------------------------------------------------------------
-// Alias of FA_SZ_OPDOTSTAR.
-//
-//
-// Status:
-// 08-Mar-2008 -- Raffaele Nutricato: Author.
-// 08-Mar-2008 -- Alberto Morea: Test Ok.
-//
-// Copyright 2008 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size);
-endfunction
+function opoutsize = FA_SZ_OPLOGNE(in1size,in2size) +// function opoutsize = FA_SZ_OPLOGNE(in1size,in2size) +// ----------------------------------------------------------------- +// Alias of FA_SZ_OPDOTSTAR. +// +// +// Status: +// 08-Mar-2008 -- Raffaele Nutricato: Author. +// 08-Mar-2008 -- Alberto Morea: Test Ok. +// +// Copyright 2008 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size); +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_OPLOGNOT.sci b/macros/FunctionAnnotation/FA_SZ_OPLOGNOT.sci index 3b0c6549..540be9dc 100644 --- a/macros/FunctionAnnotation/FA_SZ_OPLOGNOT.sci +++ b/macros/FunctionAnnotation/FA_SZ_OPLOGNOT.sci @@ -1,16 +1,16 @@ -function opoutsize = FA_SZ_OPLOGNOT(in1size)
-// function opoutsize = FA_SZ_OPLOGNOT(in1size)
-// -----------------------------------------------------------------
-// Alias of FA_SZ_OPDOTAPEX.
-//
-//
-// Status:
-// 08-Mar-2008 -- Raffaele Nutricato: Author.
-// 08-Mar-2008 -- Alberto Morea: Test Ok.
-//
-// Copyright 2008 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-opoutsize = FA_SZ_OPDOTAPEX(in1size,in2size);
-endfunction
+function opoutsize = FA_SZ_OPLOGNOT(in1size) +// function opoutsize = FA_SZ_OPLOGNOT(in1size) +// ----------------------------------------------------------------- +// Alias of FA_SZ_OPDOTAPEX. +// +// +// Status: +// 08-Mar-2008 -- Raffaele Nutricato: Author. +// 08-Mar-2008 -- Alberto Morea: Test Ok. +// +// Copyright 2008 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +opoutsize = FA_SZ_OPDOTAPEX(in1size,in2size); +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_OPLOGOR.sci b/macros/FunctionAnnotation/FA_SZ_OPLOGOR.sci index f28eec2f..91d7ebd6 100644 --- a/macros/FunctionAnnotation/FA_SZ_OPLOGOR.sci +++ b/macros/FunctionAnnotation/FA_SZ_OPLOGOR.sci @@ -1,16 +1,16 @@ -function opoutsize = FA_SZ_OPLOGOR(in1size,in2size)
-// function opoutsize = FA_SZ_OPLOGOR(in1size,in2size)
-// -----------------------------------------------------------------
-// Alias of FA_SZ_OPDOTSTAR.
-//
-//
-// Status:
-// 08-Mar-2008 -- Raffaele Nutricato: Author.
-// 08-Mar-2008 -- Alberto Morea: Test Ok.
-//
-// Copyright 2008 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size);
-endfunction
+function opoutsize = FA_SZ_OPLOGOR(in1size,in2size) +// function opoutsize = FA_SZ_OPLOGOR(in1size,in2size) +// ----------------------------------------------------------------- +// Alias of FA_SZ_OPDOTSTAR. +// +// +// Status: +// 08-Mar-2008 -- Raffaele Nutricato: Author. +// 08-Mar-2008 -- Alberto Morea: Test Ok. +// +// Copyright 2008 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +opoutsize = FA_SZ_OPDOTSTAR(in1size,in2size); +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_OPMINUS.sci b/macros/FunctionAnnotation/FA_SZ_OPMINUS.sci index 5f7fc96a..fa8eaca5 100644 --- a/macros/FunctionAnnotation/FA_SZ_OPMINUS.sci +++ b/macros/FunctionAnnotation/FA_SZ_OPMINUS.sci @@ -1,51 +1,51 @@ -function opoutsize = FA_SZ_OPMINUS(in1size,in2size)
-// function opoutsize = FA_SZ_OPMINUS(in1size,in2size)
-// -----------------------------------------------------------------
-// Returns the size of the output computed by OPMINUS operator.
-//
-// 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.
-//
-// 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:
-// 08-Dec-2007 -- Raffaele Nutricato: Author.
-// 08-Dec-2007 -- Alberto Morea: Test Ok.
-//
-// Copyright 2007 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),2,2);
-
-opoutsize = FA_SZ_OPPLUSA(in1size,in2size);
-
-endfunction
+function opoutsize = FA_SZ_OPMINUS(in1size,in2size) +// function opoutsize = FA_SZ_OPMINUS(in1size,in2size) +// ----------------------------------------------------------------- +// Returns the size of the output computed by OPMINUS operator. +// +// 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. +// +// 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: +// 08-Dec-2007 -- Raffaele Nutricato: Author. +// 08-Dec-2007 -- Alberto Morea: Test Ok. +// +// Copyright 2007 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),2,2); + +opoutsize = FA_SZ_OPPLUSA(in1size,in2size); + +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_OPPLUS.sci b/macros/FunctionAnnotation/FA_SZ_OPPLUS.sci index f439e23e..8ea8d86f 100644 --- a/macros/FunctionAnnotation/FA_SZ_OPPLUS.sci +++ b/macros/FunctionAnnotation/FA_SZ_OPPLUS.sci @@ -1,93 +1,93 @@ -function opoutsize = FA_SZ_OPPLUS(in1size,in2size,in1type,in2type)
-// function opoutsize = FA_SZ_OPPLUS(in1size,in2size,in1type,in2type)
-// -----------------------------------------------------------------
-// Returns the size of the output computed by OPPLUS operator,
-// including the string operations.
-//
-// 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:
-// 08-Dec-2007 -- Raffaele Nutricato: Author.
-// 08-Dec-2007 -- Alberto Morea: Test Ok.
-//
-// Copyright 2007 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),4,4);
-
-// ------------------------
-// --- Generate Output. ---
-// ------------------------
-// --- Get dimensions of input arguments. ---
-in1size = string(in1size);
-in2size = string(in2size);
-in1type = string(in1type);
-in2type = string(in2type);
-in1dim = GetSymbolDimension(in1size);
-
-if ((in1type ~= 'g') & (in2type ~= 'g'))
- opoutsize = FA_SZ_OPPLUSA(in1size,in2size);
-elseif ((in1type == 'g') & (in2type == 'g'))
- opoutsize(1) = '1';
- if (isnum(in1size(1)) & isnum(in2size(1)))
- in1num = eval(in1size(1));
- in2num = eval(in2size(1));
- if (in1num > 1 | in2num > 1)
- 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.
- end
- end
- if (isnum(in1size(2)) & isnum(in2size(2)))
- in1num = eval(in1size(2));
- in2num = eval(in2size(2));
- opoutsize(2) = string(in1num+in2num-1);
- if isnan(opoutsize(2))
- opoutsize(2) = '__SCI2CNANSIZE';
- else
- opoutsize(2) = string(opoutsize(2));
- end
- else
- opoutsize(2) = '('+string(in1size(2))+'+'+string(in2size(2))+'-1)';
- end
-else
- error(9999, 'Unexpected type combination for ""+"" operator (type1,type2): ('+in1type+in2type+').');
-end
-
-endfunction
+function opoutsize = FA_SZ_OPPLUS(in1size,in2size,in1type,in2type) +// function opoutsize = FA_SZ_OPPLUS(in1size,in2size,in1type,in2type) +// ----------------------------------------------------------------- +// Returns the size of the output computed by OPPLUS operator, +// including the string operations. +// +// 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: +// 08-Dec-2007 -- Raffaele Nutricato: Author. +// 08-Dec-2007 -- Alberto Morea: Test Ok. +// +// Copyright 2007 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),4,4); + +// ------------------------ +// --- Generate Output. --- +// ------------------------ +// --- Get dimensions of input arguments. --- +in1size = string(in1size); +in2size = string(in2size); +in1type = string(in1type); +in2type = string(in2type); +in1dim = GetSymbolDimension(in1size); + +if ((in1type ~= 'g') & (in2type ~= 'g')) + opoutsize = FA_SZ_OPPLUSA(in1size,in2size); +elseif ((in1type == 'g') & (in2type == 'g')) + opoutsize(1) = '1'; + if (isnum(in1size(1)) & isnum(in2size(1))) + in1num = eval(in1size(1)); + in2num = eval(in2size(1)); + if (in1num > 1 | in2num > 1) + 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. + end + end + if (isnum(in1size(2)) & isnum(in2size(2))) + in1num = eval(in1size(2)); + in2num = eval(in2size(2)); + opoutsize(2) = string(in1num+in2num-1); + if isnan(opoutsize(2)) + opoutsize(2) = '__SCI2CNANSIZE'; + else + opoutsize(2) = string(opoutsize(2)); + end + else + opoutsize(2) = '('+string(in1size(2))+'+'+string(in2size(2))+'-1)'; + end +else + error(9999, 'Unexpected type combination for ""+"" operator (type1,type2): ('+in1type+in2type+').'); +end + +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_OPPLUSA.sci b/macros/FunctionAnnotation/FA_SZ_OPPLUSA.sci index 42ba90d5..5c88ea30 100644 --- a/macros/FunctionAnnotation/FA_SZ_OPPLUSA.sci +++ b/macros/FunctionAnnotation/FA_SZ_OPPLUSA.sci @@ -1,66 +1,66 @@ -function opoutsize = FA_SZ_OPPLUSA(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);
-in1dim = GetSymbolDimension(in1size);
-
-if (in1dim == 0)
- opoutsize = in2size;
-else
- opoutsize = in1size;
-end
-
-endfunction
+function opoutsize = FA_SZ_OPPLUSA(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); +in1dim = GetSymbolDimension(in1size); + +if (in1dim == 0) + opoutsize = in2size; +else + opoutsize = in1size; +end + +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_OPRC.sci b/macros/FunctionAnnotation/FA_SZ_OPRC.sci index c4da4a0f..5a01b743 100644 --- a/macros/FunctionAnnotation/FA_SZ_OPRC.sci +++ b/macros/FunctionAnnotation/FA_SZ_OPRC.sci @@ -1,40 +1,40 @@ -function opoutsize = FA_SZ_OPRC(in1size,in2size)
-// function opoutsize = FA_SZ_OPRC(in1size,in2size)
-// -----------------------------------------------------------------
-// Returns the size of the output computed by OPRC operator.
-//
-//
-// Status:
-// 08-Mar-2008 -- Raffaele Nutricato: Author.
-// 08-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);
-
-in1size = string(in1size);
-in2size = string(in2size);
-
-// ------------------------
-// --- Generate Output. ---
-// ------------------------
-// --- Get dimensions of input arguments. ---
-in1dim = GetSymbolDimension(in1size);
-in2dim = GetSymbolDimension(in2size);
-
-opoutsize(1) = in1size(1);
-
-if (isnum(in1size(2)) & isnum(in2size(2)))
- in1num = eval(in1size(2));
- in2num = eval(in2size(2));
- opoutsize(2) = string(in1num+in2num);
-else
- opoutsize(2) = '('+string(in1size(2))+'+'+string(in2size(2))+')';
-end
-
-endfunction
+function opoutsize = FA_SZ_OPRC(in1size,in2size) +// function opoutsize = FA_SZ_OPRC(in1size,in2size) +// ----------------------------------------------------------------- +// Returns the size of the output computed by OPRC operator. +// +// +// Status: +// 08-Mar-2008 -- Raffaele Nutricato: Author. +// 08-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); + +in1size = string(in1size); +in2size = string(in2size); + +// ------------------------ +// --- Generate Output. --- +// ------------------------ +// --- Get dimensions of input arguments. --- +in1dim = GetSymbolDimension(in1size); +in2dim = GetSymbolDimension(in2size); + +opoutsize(1) = in1size(1); + +if (isnum(in1size(2)) & isnum(in2size(2))) + in1num = eval(in1size(2)); + in2num = eval(in2size(2)); + opoutsize(2) = string(in1num+in2num); +else + opoutsize(2) = '('+string(in1size(2))+'+'+string(in2size(2))+')'; +end + +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_OPSLASH.sci b/macros/FunctionAnnotation/FA_SZ_OPSLASH.sci index a44057d9..565129a0 100644 --- a/macros/FunctionAnnotation/FA_SZ_OPSLASH.sci +++ b/macros/FunctionAnnotation/FA_SZ_OPSLASH.sci @@ -1,37 +1,37 @@ -function opoutsize = FA_SZ_OPSLASH(in1size,in2size)
-// function opoutsize = FA_SZ_OPSLASH(in1size,in2size)
-// -----------------------------------------------------------------
-// Returns the size of the output computed by OPSLASH operator.
-//
-// Assuming:
-// size(in1) = [in1r,in1c]
-// size(in2) = [in2r,in2c]
-// size(out) = [outr,outc]
-//
-
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),2,2);
-
-in1size = string(in1size);
-in2size = string(in2size);
-
-// ------------------------
-// --- Generate Output. ---
-// ------------------------
-// --- Get dimensions of input arguments. ---
-in1dim = GetSymbolDimension(in1size);
-in2dim = GetSymbolDimension(in2size);
-
-if (in1dim == 0)
- opoutsize = in2size;
-elseif (in2dim == 0)
- opoutsize = in1size;
-else
- opoutsize(1) = in1size(1);
- opoutsize(2) = in2size(1);
-end
-
-endfunction
+function opoutsize = FA_SZ_OPSLASH(in1size,in2size) +// function opoutsize = FA_SZ_OPSLASH(in1size,in2size) +// ----------------------------------------------------------------- +// Returns the size of the output computed by OPSLASH operator. +// +// Assuming: +// size(in1) = [in1r,in1c] +// size(in2) = [in2r,in2c] +// size(out) = [outr,outc] +// + + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),2,2); + +in1size = string(in1size); +in2size = string(in2size); + +// ------------------------ +// --- Generate Output. --- +// ------------------------ +// --- Get dimensions of input arguments. --- +in1dim = GetSymbolDimension(in1size); +in2dim = GetSymbolDimension(in2size); + +if (in1dim == 0) + opoutsize = in2size; +elseif (in2dim == 0) + opoutsize = in1size; +else + opoutsize(1) = in1size(1); + opoutsize(2) = in2size(1); +end + +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_OPSTAR.sci b/macros/FunctionAnnotation/FA_SZ_OPSTAR.sci index 12190d38..95a31760 100644 --- a/macros/FunctionAnnotation/FA_SZ_OPSTAR.sci +++ b/macros/FunctionAnnotation/FA_SZ_OPSTAR.sci @@ -1,68 +1,68 @@ -function opoutsize = FA_SZ_OPSTAR(in1size,in2size)
-// function opoutsize = FA_SZ_OPSTAR(in1size,in2size)
-// -----------------------------------------------------------------
-// Returns the size of the output computed by OPSTAR operator.
-//
-// 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 in2c
-//
-// Where S means that the input is a scalar
-// and M means that the input is a matrix.
-//
-// 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:
-// 08-Dec-2007 -- Raffaele Nutricato: Author.
-// 08-Dec-2007 -- Alberto Morea: Test Ok.
-//
-// Copyright 2007 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),2,2);
-
-in1size = string(in1size);
-in2size = string(in2size);
-
-// ------------------------
-// --- Generate Output. ---
-// ------------------------
-// --- Get dimensions of input arguments. ---
-in1dim = GetSymbolDimension(in1size);
-in2dim = GetSymbolDimension(in2size);
-
-if (in1dim == 0)
- opoutsize = in2size;
-elseif (in2dim == 0)
- opoutsize = in1size;
-else
- opoutsize(1) = in1size(1);
- opoutsize(2) = in2size(2);
-end
-
-endfunction
+function opoutsize = FA_SZ_OPSTAR(in1size,in2size) +// function opoutsize = FA_SZ_OPSTAR(in1size,in2size) +// ----------------------------------------------------------------- +// Returns the size of the output computed by OPSTAR operator. +// +// 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 in2c +// +// Where S means that the input is a scalar +// and M means that the input is a matrix. +// +// 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: +// 08-Dec-2007 -- Raffaele Nutricato: Author. +// 08-Dec-2007 -- Alberto Morea: Test Ok. +// +// Copyright 2007 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),2,2); + +in1size = string(in1size); +in2size = string(in2size); + +// ------------------------ +// --- Generate Output. --- +// ------------------------ +// --- Get dimensions of input arguments. --- +in1dim = GetSymbolDimension(in1size); +in2dim = GetSymbolDimension(in2size); + +if (in1dim == 0) + opoutsize = in2size; +elseif (in2dim == 0) + opoutsize = in1size; +else + opoutsize(1) = in1size(1); + opoutsize(2) = in2size(2); +end + +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN_CAT.sci b/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN_CAT.sci index 527217a5..7883de6d 100644 --- a/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN_CAT.sci +++ b/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN_CAT.sci @@ -1,50 +1,50 @@ -function outsize = FA_SZ_ROW_COLUMN_CAT(inval,in1size,in2size)
-//function outsize = FA_SZ_ROW_COLUMN_CAT(inval,in1size,in2size)
-// -----------------------------------------------------------------
-// Get size of row (col) of the output for cat function
-//
-// Input data:
-// inval: string specifying the value of input argument.
-// in1size: string specifying the row (col) of second input
-// in3size: string specifying the row (col) of third input
-// Output data:
-// outsize: string containing the column size for output argument.
-//
-// Copyright (C) 2017 - IIT Bombay - FOSSEE
-//
-// This file must be used under the terms of the CeCILL.
-// This source file is licensed as described in the file COPYING, which
-// you should have received as part of this distribution. The terms
-// are also available at
-// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
-// Author: Mushir
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-//
-
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),3,3);
-
-
-in1size = string(in1size);
-in2size = string(in2size);
-inval = string(inval);
-if(inval == '1') then
- in1num_r = eval(in1size);
- in2num_r = eval(in2size);
- outsize(1) = string(in1num_r + in2num_r);
- outsize(2) = string(in2num_r);
-elseif(inval == '2') then
- in1num_c = eval(in1size);
- in2num_c = eval(in2size);
- outsize(1) = string(in1num_c);
- outsize(2) = string(in1num_c + in2num_c);
-else
- error(36, "Wrong input argument "+inval+". Use 1 or 2 as first argument in cat command.");
-end
-
-endfunction
+function outsize = FA_SZ_ROW_COLUMN_CAT(inval,in1size,in2size) +//function outsize = FA_SZ_ROW_COLUMN_CAT(inval,in1size,in2size) +// ----------------------------------------------------------------- +// Get size of row (col) of the output for cat function +// +// Input data: +// inval: string specifying the value of input argument. +// in1size: string specifying the row (col) of second input +// in3size: string specifying the row (col) of third input +// Output data: +// outsize: string containing the column size for output argument. +// +// Copyright (C) 2017 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Mushir +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// + +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),3,3); + + +in1size = string(in1size); +in2size = string(in2size); +inval = string(inval); +if(inval == '1') then + in1num_r = eval(in1size); + in2num_r = eval(in2size); + outsize(1) = string(in1num_r + in2num_r); + outsize(2) = string(in2num_r); +elseif(inval == '2') then + in1num_c = eval(in1size); + in2num_c = eval(in2size); + outsize(1) = string(in1num_c); + outsize(2) = string(in1num_c + in2num_c); +else + error(36, "Wrong input argument "+inval+". Use 1 or 2 as first argument in cat command."); +end + +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_SEL1.sci b/macros/FunctionAnnotation/FA_SZ_SEL1.sci index 6071e960..08023ef5 100644 --- a/macros/FunctionAnnotation/FA_SZ_SEL1.sci +++ b/macros/FunctionAnnotation/FA_SZ_SEL1.sci @@ -1,48 +1,48 @@ -function opout = FA_SZ_SEL1(in1,in2)
-// function opout = FA_SZ_SEL1(in1,in2)
-// -----------------------------------------------------------------
-// Determines the number of rows of the output arguments
-// according to the number of rows of the first input argument and
-// the specifier in2 which can be 1,2 or 'r','c' and 'm'.
-// In this release the 'm' specifier is not supported so when it is
-// used SCI2C will issue an error.
-//
-// Input data:
-// in1: string specifying a number or a symbol.
-// in2: string specifying a number or a symbol.
-//
-// Output data:
-// opout: string containing the computed result.
-//
-// Status:
-// 16-Mar-2008 -- Raffaele Nutricato: Author.
-// 16-Mar-2008 -- Alberto Morea: Test Ok.
-//
-// Copyright 2008 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
+function opout = FA_SZ_SEL1(in1,in2) +// function opout = FA_SZ_SEL1(in1,in2) +// ----------------------------------------------------------------- +// Determines the number of rows of the output arguments +// according to the number of rows of the first input argument and +// the specifier in2 which can be 1,2 or 'r','c' and 'm'. +// In this release the 'm' specifier is not supported so when it is +// used SCI2C will issue an error. +// +// Input data: +// in1: string specifying a number or a symbol. +// in2: string specifying a number or a symbol. +// +// Output data: +// opout: string containing the computed result. +// +// Status: +// 16-Mar-2008 -- Raffaele Nutricato: Author. +// 16-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);
-ReportFileName = '';
-in2 = string(in2);
-
-if (in2 == '1' | in2 == '""rr""' ) // Where can r become rr ???
- opout = '1';
-elseif (in2 == '2' | in2 == '""c""' )
+ +SCI2CNInArgCheck(argn(2),2,2); +ReportFileName = ''; +in2 = string(in2); + +if (in2 == '1' | in2 == '""rr""' ) // Where can r become rr ??? + opout = '1'; +elseif (in2 == '2' | in2 == '""c""' ) opout = in1; -
-else
- PrintStringInfo(' ',ReportFileName,'both','y');
- PrintStringInfo('SCI2CERROR: Cannot associate the second input argument to a known specifier.',ReportFileName,'both','y');
- PrintStringInfo('SCI2CERROR: Please rearrange your code by using one of the following specifiers:',ReportFileName,'both','y');
- PrintStringInfo('SCI2CERROR: 1 or 2.',ReportFileName,'both','y');
- PrintStringInfo(' ',ReportFileName,'both','y');
- error(9999, 'SCI2CERROR: Cannot associate the second input argument to a known specifier.');
-end
-endfunction
+ +else + PrintStringInfo(' ',ReportFileName,'both','y'); + PrintStringInfo('SCI2CERROR: Cannot associate the second input argument to a known specifier.',ReportFileName,'both','y'); + PrintStringInfo('SCI2CERROR: Please rearrange your code by using one of the following specifiers:',ReportFileName,'both','y'); + PrintStringInfo('SCI2CERROR: 1 or 2.',ReportFileName,'both','y'); + PrintStringInfo(' ',ReportFileName,'both','y'); + error(9999, 'SCI2CERROR: Cannot associate the second input argument to a known specifier.'); +end +endfunction diff --git a/macros/FunctionAnnotation/FA_SZ_SEL2.sci b/macros/FunctionAnnotation/FA_SZ_SEL2.sci index b0be739f..94dbed79 100644 --- a/macros/FunctionAnnotation/FA_SZ_SEL2.sci +++ b/macros/FunctionAnnotation/FA_SZ_SEL2.sci @@ -1,44 +1,44 @@ -function opout = FA_SZ_SEL2(in1,in2)
-// function opout = FA_SZ_SEL2(in1,in2)
-// -----------------------------------------------------------------
-// Determines the number of columns of the output arguments
-// according to the number of columns of the first input argument and
-// the specifier in2 which can be 1,2 or 'r','c' and 'm'.
-// In this release the 'm' specifier is not supported so when it is
-// used SCI2C will issue an error.
-//
-// Input data:
-// in1: string specifying a number or a symbol.
-// in2: string specifying a number or a symbol.
-//
-// Output data:
-// opout: string containing the computed result.
-//
-// Status:
-// 16-Mar-2008 -- Raffaele Nutricato: Author.
-// 16-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);
-ReportFileName = '';
-in2 = string(in2);
-
-if (in2 == '1'| in2 == '""rr""')
- opout = in1;
-elseif (in2 == '2'| in2 == '""c""')
- opout = '1';
-else
- PrintStringInfo(' ',ReportFileName,'both','y');
- PrintStringInfo('SCI2CERROR: Cannot associate the second input argument to a known specifier.',ReportFileName,'both','y');
- PrintStringInfo('SCI2CERROR: Please rearrange your code by using one of the following specifiers:',ReportFileName,'both','y');
- PrintStringInfo('SCI2CERROR: 1 or 2.',ReportFileName,'both','y');
- PrintStringInfo(' ',ReportFileName,'both','y');
- error(9999, 'SCI2CERROR: Cannot associate the second input argument to a known specifier.');
-end
-endfunction
+function opout = FA_SZ_SEL2(in1,in2) +// function opout = FA_SZ_SEL2(in1,in2) +// ----------------------------------------------------------------- +// Determines the number of columns of the output arguments +// according to the number of columns of the first input argument and +// the specifier in2 which can be 1,2 or 'r','c' and 'm'. +// In this release the 'm' specifier is not supported so when it is +// used SCI2C will issue an error. +// +// Input data: +// in1: string specifying a number or a symbol. +// in2: string specifying a number or a symbol. +// +// Output data: +// opout: string containing the computed result. +// +// Status: +// 16-Mar-2008 -- Raffaele Nutricato: Author. +// 16-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); +ReportFileName = ''; +in2 = string(in2); + +if (in2 == '1'| in2 == '""rr""') + opout = in1; +elseif (in2 == '2'| in2 == '""c""') + opout = '1'; +else + PrintStringInfo(' ',ReportFileName,'both','y'); + PrintStringInfo('SCI2CERROR: Cannot associate the second input argument to a known specifier.',ReportFileName,'both','y'); + PrintStringInfo('SCI2CERROR: Please rearrange your code by using one of the following specifiers:',ReportFileName,'both','y'); + PrintStringInfo('SCI2CERROR: 1 or 2.',ReportFileName,'both','y'); + PrintStringInfo(' ',ReportFileName,'both','y'); + error(9999, 'SCI2CERROR: Cannot associate the second input argument to a known specifier.'); +end +endfunction diff --git a/macros/FunctionAnnotation/FA_TP_C.sci b/macros/FunctionAnnotation/FA_TP_C.sci index b383b5ac..5bcbbb42 100644 --- a/macros/FunctionAnnotation/FA_TP_C.sci +++ b/macros/FunctionAnnotation/FA_TP_C.sci @@ -1,32 +1,32 @@ -function typeout = FA_TP_C()
-// function typeout = FA_TP_C()
-// -----------------------------------------------------------------
-// Returns the "single complex" type specifier
-// for Function Annotations.
-//
-// Input data:
-// ---
-//
-// Output data:
-// typeout: string containing the type specifier.
-//
-// Status:
-// 26-Oct-2007 -- Raffaele Nutricato: Author.
-// 26-Oct-2007 -- Alberto Morea: Test Ok.
-//
-// Copyright 2007 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),0,0);
-
-
-// ------------------------
-// --- Generate Output. ---
-// ------------------------
-typeout = 'c';
-
-endfunction
+function typeout = FA_TP_C() +// function typeout = FA_TP_C() +// ----------------------------------------------------------------- +// Returns the "single complex" type specifier +// for Function Annotations. +// +// Input data: +// --- +// +// Output data: +// typeout: string containing the type specifier. +// +// Status: +// 26-Oct-2007 -- Raffaele Nutricato: Author. +// 26-Oct-2007 -- Alberto Morea: Test Ok. +// +// Copyright 2007 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),0,0); + + +// ------------------------ +// --- Generate Output. --- +// ------------------------ +typeout = 'c'; + +endfunction diff --git a/macros/FunctionAnnotation/FA_TP_COMPLEX.sci b/macros/FunctionAnnotation/FA_TP_COMPLEX.sci index bf3f2f9f..cb04180f 100644 --- a/macros/FunctionAnnotation/FA_TP_COMPLEX.sci +++ b/macros/FunctionAnnotation/FA_TP_COMPLEX.sci @@ -1,42 +1,42 @@ -function typeout = FA_TP_COMPLEX(in1)
-// function typeout = FA_TP_COMPLEX(in1)
-// -----------------------------------------------------------------
-// Converts into complex data type the input argument, by preserving
-// the precision of the input argument.
-// See following examples:
-// FA_TP_COMPLEX('s') = 'c'
-// FA_TP_COMPLEX('d') = 'z'
-// FA_TP_COMPLEX('c') = 'c'
-// FA_TP_COMPLEX('z') = 'z'
-//
-// Input data:
-// in1: string specifying the data type number 1.
-//
-// Output data:
-// typeout: string containing the type specifier.
-//
-// Status:
-// 26-Jan-2008 -- Raffaele Nutricato: Author.
-// 26-Jan-2008 -- Alberto Morea: Test Ok.
-//
-// Copyright 2008 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),1,1);
-
-
-// ------------------------
-// --- Generate Output. ---
-// ------------------------
-if (in1 == 's')
- typeout = 'c';
-elseif (in1 == 'd')
- typeout = 'z';
-else
- typeout = in1;
-end
-endfunction
+function typeout = FA_TP_COMPLEX(in1) +// function typeout = FA_TP_COMPLEX(in1) +// ----------------------------------------------------------------- +// Converts into complex data type the input argument, by preserving +// the precision of the input argument. +// See following examples: +// FA_TP_COMPLEX('s') = 'c' +// FA_TP_COMPLEX('d') = 'z' +// FA_TP_COMPLEX('c') = 'c' +// FA_TP_COMPLEX('z') = 'z' +// +// Input data: +// in1: string specifying the data type number 1. +// +// Output data: +// typeout: string containing the type specifier. +// +// Status: +// 26-Jan-2008 -- Raffaele Nutricato: Author. +// 26-Jan-2008 -- Alberto Morea: Test Ok. +// +// Copyright 2008 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),1,1); + + +// ------------------------ +// --- Generate Output. --- +// ------------------------ +if (in1 == 's') + typeout = 'c'; +elseif (in1 == 'd') + typeout = 'z'; +else + typeout = in1; +end +endfunction diff --git a/macros/FunctionAnnotation/FA_TP_D.sci b/macros/FunctionAnnotation/FA_TP_D.sci index 788a03fe..97932c36 100644 --- a/macros/FunctionAnnotation/FA_TP_D.sci +++ b/macros/FunctionAnnotation/FA_TP_D.sci @@ -1,32 +1,32 @@ -function typeout = FA_TP_D()
-// function typeout = FA_TP_D()
-// -----------------------------------------------------------------
-// Returns the "double" type specifier
-// for Function Annotations.
-//
-// Input data:
-// ---
-//
-// Output data:
-// typeout: string containing the type specifier.
-//
-// Status:
-// 26-Oct-2007 -- Raffaele Nutricato: Author.
-// 26-Oct-2007 -- Alberto Morea: Test Ok.
-//
-// Copyright 2007 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),0,0);
-
-
-// ------------------------
-// --- Generate Output. ---
-// ------------------------
-typeout = 'd';
-
-endfunction
+function typeout = FA_TP_D() +// function typeout = FA_TP_D() +// ----------------------------------------------------------------- +// Returns the "double" type specifier +// for Function Annotations. +// +// Input data: +// --- +// +// Output data: +// typeout: string containing the type specifier. +// +// Status: +// 26-Oct-2007 -- Raffaele Nutricato: Author. +// 26-Oct-2007 -- Alberto Morea: Test Ok. +// +// Copyright 2007 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),0,0); + + +// ------------------------ +// --- Generate Output. --- +// ------------------------ +typeout = 'd'; + +endfunction diff --git a/macros/FunctionAnnotation/FA_TP_I.sci b/macros/FunctionAnnotation/FA_TP_I.sci index 94f383f4..741cd964 100644 --- a/macros/FunctionAnnotation/FA_TP_I.sci +++ b/macros/FunctionAnnotation/FA_TP_I.sci @@ -1,32 +1,32 @@ -function typeout = FA_TP_I()
-// function typeout = FA_TP_I()
-// -----------------------------------------------------------------
-// Returns the "int" type specifier
-// for Function Annotations.
-//
-// Input data:
-// ---
-//
-// Output data:
-// typeout: string containing the type specifier.
-//
-// Status:
-// 26-Oct-2007 -- Raffaele Nutricato: Author.
-// 26-Oct-2007 -- Alberto Morea: Test Ok.
-//
-// Copyright 2007 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),0,0);
-
-
-// ------------------------
-// --- Generate Output. ---
-// ------------------------
-typeout = 'i';
-
-endfunction
+function typeout = FA_TP_I() +// function typeout = FA_TP_I() +// ----------------------------------------------------------------- +// Returns the "int" type specifier +// for Function Annotations. +// +// Input data: +// --- +// +// Output data: +// typeout: string containing the type specifier. +// +// Status: +// 26-Oct-2007 -- Raffaele Nutricato: Author. +// 26-Oct-2007 -- Alberto Morea: Test Ok. +// +// Copyright 2007 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),0,0); + + +// ------------------------ +// --- Generate Output. --- +// ------------------------ +typeout = 'i'; + +endfunction diff --git a/macros/FunctionAnnotation/FA_TP_MAX.sci b/macros/FunctionAnnotation/FA_TP_MAX.sci index 0b78f9e3..c1520794 100644 --- a/macros/FunctionAnnotation/FA_TP_MAX.sci +++ b/macros/FunctionAnnotation/FA_TP_MAX.sci @@ -1,45 +1,45 @@ -function opout = FA_TP_MAX(in1,in2)
-// function opout = FA_TP_MAX(in1,in2)
-// -----------------------------------------------------------------
-// Type-Maximum function for Function Annotations.
-// Returns the maximum between the two data types in input according
-// to a predefined priority. For example z(double complex) is
-// greater that c(single complex).
-//
-// Input data:
-// in1: string specifying the data type number 1.
-// in2: string specifying the data type number 2.
-//
-// Output data:
-// opout: string containing the computed result.
-//
-// Status:
-// 26-Oct-2007 -- Raffaele Nutricato: Author.
-// 26-Oct-2007 -- Alberto Morea: Test Ok.
-//
-// Copyright 2007 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),2,2);
-
-// ------------------------
-// --- Generate Output. ---
-// ------------------------
-in1Pin2 = in1+in2;
-opout = in1;
-
-if (in2 == 'z')
- opout = 'z';
-elseif (in1Pin2 == 'sd')
- opout = 'd';
-elseif (in1Pin2 == 'sc')
- opout = 'c';
-elseif (in1Pin2 == 'dc')
- opout = 'z';
-end
-
-endfunction
+function opout = FA_TP_MAX(in1,in2) +// function opout = FA_TP_MAX(in1,in2) +// ----------------------------------------------------------------- +// Type-Maximum function for Function Annotations. +// Returns the maximum between the two data types in input according +// to a predefined priority. For example z(double complex) is +// greater that c(single complex). +// +// Input data: +// in1: string specifying the data type number 1. +// in2: string specifying the data type number 2. +// +// Output data: +// opout: string containing the computed result. +// +// Status: +// 26-Oct-2007 -- Raffaele Nutricato: Author. +// 26-Oct-2007 -- Alberto Morea: Test Ok. +// +// Copyright 2007 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),2,2); + +// ------------------------ +// --- Generate Output. --- +// ------------------------ +in1Pin2 = in1+in2; +opout = in1; + +if (in2 == 'z') + opout = 'z'; +elseif (in1Pin2 == 'sd') + opout = 'd'; +elseif (in1Pin2 == 'sc') + opout = 'c'; +elseif (in1Pin2 == 'dc') + opout = 'z'; +end + +endfunction diff --git a/macros/FunctionAnnotation/FA_TP_REAL.sci b/macros/FunctionAnnotation/FA_TP_REAL.sci index 67a946dc..9f87f9f6 100644 --- a/macros/FunctionAnnotation/FA_TP_REAL.sci +++ b/macros/FunctionAnnotation/FA_TP_REAL.sci @@ -1,38 +1,38 @@ -function opout = FA_TP_REAL(in1)
-// function opout = FA_TP_REAL(in1)
-// -----------------------------------------------------------------
-// Type-Real function for Function Annotations.
-// Returns the real precision corresponding to the precision of
-// the input operand.
-//
-// Input data:
-// in1: string specifying the data type number 1.
-//
-// Output data:
-// opout: string containing the computed result.
-//
-// Status:
-// 26-Mar-2008 -- Raffaele Nutricato: Author.
-// 26-Mar-2008 -- Alberto Morea: Test Ok.
-//
-// Copyright 2008 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),1,1);
-
-// ------------------------
-// --- Generate Output. ---
-// ------------------------
-opout = in1;
-
-if (in1 == 'c')
- opout = 's';
-elseif (in1 == 'z')
- opout = 'd';
-end
-
-endfunction
+function opout = FA_TP_REAL(in1) +// function opout = FA_TP_REAL(in1) +// ----------------------------------------------------------------- +// Type-Real function for Function Annotations. +// Returns the real precision corresponding to the precision of +// the input operand. +// +// Input data: +// in1: string specifying the data type number 1. +// +// Output data: +// opout: string containing the computed result. +// +// Status: +// 26-Mar-2008 -- Raffaele Nutricato: Author. +// 26-Mar-2008 -- Alberto Morea: Test Ok. +// +// Copyright 2008 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),1,1); + +// ------------------------ +// --- Generate Output. --- +// ------------------------ +opout = in1; + +if (in1 == 'c') + opout = 's'; +elseif (in1 == 'z') + opout = 'd'; +end + +endfunction diff --git a/macros/FunctionAnnotation/FA_TP_S.sci b/macros/FunctionAnnotation/FA_TP_S.sci index 3de4c20c..3928c3b6 100644 --- a/macros/FunctionAnnotation/FA_TP_S.sci +++ b/macros/FunctionAnnotation/FA_TP_S.sci @@ -1,32 +1,32 @@ -function typeout = FA_TP_S()
-// function typeout = FA_TP_S()
-// -----------------------------------------------------------------
-// Returns the "float" type specifier
-// for Function Annotations.
-//
-// Input data:
-// ---
-//
-// Output data:
-// typeout: string containing the type specifier.
-//
-// Status:
-// 26-Oct-2007 -- Raffaele Nutricato: Author.
-// 26-Oct-2007 -- Alberto Morea: Test Ok.
-//
-// Copyright 2007 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),0,0);
-
-
-// ------------------------
-// --- Generate Output. ---
-// ------------------------
-typeout = 's';
-
-endfunction
+function typeout = FA_TP_S() +// function typeout = FA_TP_S() +// ----------------------------------------------------------------- +// Returns the "float" type specifier +// for Function Annotations. +// +// Input data: +// --- +// +// Output data: +// typeout: string containing the type specifier. +// +// Status: +// 26-Oct-2007 -- Raffaele Nutricato: Author. +// 26-Oct-2007 -- Alberto Morea: Test Ok. +// +// Copyright 2007 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),0,0); + + +// ------------------------ +// --- Generate Output. --- +// ------------------------ +typeout = 's'; + +endfunction diff --git a/macros/FunctionAnnotation/FA_TP_USER.sci b/macros/FunctionAnnotation/FA_TP_USER.sci index e60a8ce8..f45ee483 100644 --- a/macros/FunctionAnnotation/FA_TP_USER.sci +++ b/macros/FunctionAnnotation/FA_TP_USER.sci @@ -1,38 +1,38 @@ -function type_out = FA_TP_USER(PrecisionSpecifier,DefaultType)
-// function type_out = FA_TP_USER(PrecisionSpecifier,DefaultType)
-// -----------------------------------------------------------------
-// Generate the output type of the output argument by using the
-// output (AnnotationFnc) generated by CheckAnnotationFunction.
-// double and float functions can be used to specify the type
-// of the output argument. They are typically used in combination
-// with zeros-like function.
-//
-// Input data:
-// PrecisionSpecifier: it can be 'double' or 'float'.
-//
-// Output data:
-// type_out: specifies the type of the output argument. It can be
-// 's' for float precision or 'd' for double precision.
-//
-// Status:
-// 26-Oct-2007 -- Raffaele Nutricato: Author.
-// 26-Oct-2007 -- Alberto Morea: Test Ok.
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),2,2);
-
-if (mtlb_strcmp(PrecisionSpecifier,'int'))
- type_out = 'i';
-elseif (mtlb_strcmp(PrecisionSpecifier,'float'))
- type_out = 's';
-elseif (mtlb_strcmp(PrecisionSpecifier,'double'))
- type_out = 'd';
-elseif (mtlb_strcmp(PrecisionSpecifier,'default'))
- type_out = DefaultType;
-else
- error(9999, 'Unknown precision function: ""'+AnnotationFnc+'"".');
-end
-endfunction
+function type_out = FA_TP_USER(PrecisionSpecifier,DefaultType) +// function type_out = FA_TP_USER(PrecisionSpecifier,DefaultType) +// ----------------------------------------------------------------- +// Generate the output type of the output argument by using the +// output (AnnotationFnc) generated by CheckAnnotationFunction. +// double and float functions can be used to specify the type +// of the output argument. They are typically used in combination +// with zeros-like function. +// +// Input data: +// PrecisionSpecifier: it can be 'double' or 'float'. +// +// Output data: +// type_out: specifies the type of the output argument. It can be +// 's' for float precision or 'd' for double precision. +// +// Status: +// 26-Oct-2007 -- Raffaele Nutricato: Author. +// 26-Oct-2007 -- Alberto Morea: Test Ok. +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),2,2); + +if (mtlb_strcmp(PrecisionSpecifier,'int')) + type_out = 'i'; +elseif (mtlb_strcmp(PrecisionSpecifier,'float')) + type_out = 's'; +elseif (mtlb_strcmp(PrecisionSpecifier,'double')) + type_out = 'd'; +elseif (mtlb_strcmp(PrecisionSpecifier,'default')) + type_out = DefaultType; +else + error(9999, 'Unknown precision function: ""'+AnnotationFnc+'"".'); +end +endfunction diff --git a/macros/FunctionAnnotation/FA_TP_Z.sci b/macros/FunctionAnnotation/FA_TP_Z.sci index 2ac18dea..9c75b221 100644 --- a/macros/FunctionAnnotation/FA_TP_Z.sci +++ b/macros/FunctionAnnotation/FA_TP_Z.sci @@ -1,32 +1,32 @@ -function typeout = FA_TP_Z()
-// function typeout = FA_TP_Z()
-// -----------------------------------------------------------------
-// Returns the "double complex" type specifier
-// for Function Annotations.
-//
-// Input data:
-// ---
-//
-// Output data:
-// typeout: string containing the type specifier.
-//
-// Status:
-// 26-Oct-2007 -- Raffaele Nutricato: Author.
-// 26-Oct-2007 -- Alberto Morea: Test Ok.
-//
-// Copyright 2007 Raffaele Nutricato & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),0,0);
-
-
-// ------------------------
-// --- Generate Output. ---
-// ------------------------
-typeout = 'z';
-
-endfunction
+function typeout = FA_TP_Z() +// function typeout = FA_TP_Z() +// ----------------------------------------------------------------- +// Returns the "double complex" type specifier +// for Function Annotations. +// +// Input data: +// --- +// +// Output data: +// typeout: string containing the type specifier. +// +// Status: +// 26-Oct-2007 -- Raffaele Nutricato: Author. +// 26-Oct-2007 -- Alberto Morea: Test Ok. +// +// Copyright 2007 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),0,0); + + +// ------------------------ +// --- Generate Output. --- +// ------------------------ +typeout = 'z'; + +endfunction |