From 277d1edfa17bf3719d90ddbac8e31f6181e952c3 Mon Sep 17 00:00:00 2001 From: Sandeep Gupta Date: Sun, 18 Jun 2017 23:55:40 +0530 Subject: First commit --- macros/FunctionAnnotation/FA_TP_MAX.sci | 45 +++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 macros/FunctionAnnotation/FA_TP_MAX.sci (limited to 'macros/FunctionAnnotation/FA_TP_MAX.sci') diff --git a/macros/FunctionAnnotation/FA_TP_MAX.sci b/macros/FunctionAnnotation/FA_TP_MAX.sci new file mode 100644 index 0000000..0b78f9e --- /dev/null +++ b/macros/FunctionAnnotation/FA_TP_MAX.sci @@ -0,0 +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 -- cgit