diff options
Diffstat (limited to '2.3-1/macros/FunctionAnnotation/FA_TP_MAX.sci')
-rw-r--r-- | 2.3-1/macros/FunctionAnnotation/FA_TP_MAX.sci | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/2.3-1/macros/FunctionAnnotation/FA_TP_MAX.sci b/2.3-1/macros/FunctionAnnotation/FA_TP_MAX.sci new file mode 100644 index 00000000..0b78f9e3 --- /dev/null +++ b/2.3-1/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
|