From b22f596ce449869bffd8e0f63baee1c53e20fa06 Mon Sep 17 00:00:00 2001 From: jofret Date: Tue, 28 Apr 2009 07:11:01 +0000 Subject: Moving macros here --- macros/FunctionAnnotation/FA_TP_USER.sci | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 macros/FunctionAnnotation/FA_TP_USER.sci (limited to 'macros/FunctionAnnotation/FA_TP_USER.sci') diff --git a/macros/FunctionAnnotation/FA_TP_USER.sci b/macros/FunctionAnnotation/FA_TP_USER.sci new file mode 100644 index 00000000..3b306a9f --- /dev/null +++ b/macros/FunctionAnnotation/FA_TP_USER.sci @@ -0,0 +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 + SCI2Cerror('Unknown precision function: ""'+AnnotationFnc+'"".'); +end +endfunction -- cgit