summaryrefslogtreecommitdiff
path: root/macros/FunctionAnnotation/FA_SZ_OPRC.sci
blob: c4da4a0f5c15e39714ad8e5cefc4eb1764359d5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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