From c76ca1b96e718c7ebfa986be8bf67663a2c468ae Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 6 Aug 2009 14:00:00 +0000 Subject: added FA_SZ_FROM_VAL to handle functions who determine the size of the ouput with the input arguments updated INIT_FillSCI2LibCDirs --- macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci | 26 ++++++++++++++++++++++ .../ToolInitialization/INIT_FillSCI2LibCDirs.sci | 6 ++--- 2 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci (limited to 'macros') diff --git a/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci b/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci new file mode 100644 index 00000000..e9d88650 --- /dev/null +++ b/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci @@ -0,0 +1,26 @@ +function opout = FA_SZ_FROM_VAL(in1) +// function opout = FA_SZ_FROM_VAL(in1) +// ----------------------------------------------------------------- +// Return a size according to the floored value of the first argument +// +// Input data: +// in1: string specifying a number . // +// +// Output data: +// opout: string containing the computed result. +// +// ----------------------------------------------------------------- + +SCI2CNInArgCheck(argn(2),1,1); + +in1num = eval(in1) ; + +if ( in1num < 0 ) + opout= '0' ; +else + opout = string ( floor (abs(in1num))) ; +end + + + +endfunction diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index 2de3fadb..0aac9f18 100644 --- a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -493,8 +493,8 @@ PrintStringInfo('NOUT= 1',ClassFileName,'file','y'); //Was FA_TP_USER //Cause some trouble if user specify some precision and if input(and also output) is complex. PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y'); -PrintStringInfo('OUT(1).SZ(1)= IN(1).VAL',ClassFileName,'file','y'); -PrintStringInfo('OUT(1).SZ(2)= IN(2).VAL',ClassFileName,'file','y'); +PrintStringInfo('OUT(1).SZ(1)= FA_SZ_FROM_VAL(IN(1).VAL)',ClassFileName,'file','y'); +PrintStringInfo('OUT(1).SZ(2)= FA_SZ_FROM_VAL(IN(2).VAL)',ClassFileName,'file','y'); // --- Function List Class. --- ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls); @@ -2057,7 +2057,7 @@ PrintStringInfo('NIN= 3',ClassFileName,'file','y'); PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y'); PrintStringInfo('OUT(1).TP= FA_TP_USER',ClassFileName,'file','y'); PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y'); -PrintStringInfo('OUT(1).SZ(2)= FA_SZ_RTMAX(IN(1).VAL)',ClassFileName,'file','y'); +PrintStringInfo('OUT(1).SZ(2)= FA_SZ_RTMAX(FA_SZ_FROM_VAL(IN(1).VAL))',ClassFileName,'file','y'); // --- Function List Class. --- ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls); -- cgit