summaryrefslogtreecommitdiff
path: root/macros/FunctionAnnotation/FA_SZ_OPSLASH.sci
diff options
context:
space:
mode:
Diffstat (limited to 'macros/FunctionAnnotation/FA_SZ_OPSLASH.sci')
-rw-r--r--macros/FunctionAnnotation/FA_SZ_OPSLASH.sci48
1 files changed, 20 insertions, 28 deletions
diff --git a/macros/FunctionAnnotation/FA_SZ_OPSLASH.sci b/macros/FunctionAnnotation/FA_SZ_OPSLASH.sci
index 78ddecec..a44057d9 100644
--- a/macros/FunctionAnnotation/FA_SZ_OPSLASH.sci
+++ b/macros/FunctionAnnotation/FA_SZ_OPSLASH.sci
@@ -3,43 +3,35 @@ function opoutsize = FA_SZ_OPSLASH(in1size,in2size)
// -----------------------------------------------------------------
// Returns the size of the output computed by OPSLASH operator.
//
+// Assuming:
+// size(in1) = [in1r,in1c]
+// size(in2) = [in2r,in2c]
+// size(out) = [outr,outc]
//
-// Status:
-// 28-May-2008 -- Alberto Morea: Author.
-// 28-May-2008 -- Raffaele Nutricato: 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. ---
// ------------------------
-in1size=string(in1size);
-in2size=string(in2size);
-
-// knowing that
-// b/a = (a' \ b')'
-
-// a'
-in1sizetmp(1) = in1size(2);
-in1sizetmp(2) = in1size(1);
-
-// b'
-in2sizetmp(1) = in2size(2);
-in2sizetmp(2) = in2size(1);
-
-// a'\b'
-opoutsizetmp = FA_SZ_OPBACKSLASH(in2sizetmp,in1sizetmp);
-
-// (a'\b')'
-opoutsize(1) = opoutsizetmp(2);
-opoutsize(2) = opoutsizetmp(1);
-
+// --- Get dimensions of input arguments. ---
+in1dim = GetSymbolDimension(in1size);
+in2dim = GetSymbolDimension(in2size);
+
+if (in1dim == 0)
+ opoutsize = in2size;
+elseif (in2dim == 0)
+ opoutsize = in1size;
+else
+ opoutsize(1) = in1size(1);
+ opoutsize(2) = in2size(1);
+end
endfunction