Diff of /inst/istrellis.m [658f98] .. [a1dcba] Maximize Restore

  Switch to side-by-side view

--- a/inst/istrellis.m
+++ b/inst/istrellis.m
@@ -34,12 +34,12 @@
   status = false;
   text = "";
 
-  if (! (isstruct (t) &&
-         isfield (t, "numInputSymbols") &&
-         isfield (t, "numOutputSymbols") &&
-         isfield (t, "numStates") &&
-         isfield (t, "nextStates") &&
-         isfield (t, "outputs")))
+  if (! (isstruct (t)
+         && isfield (t, "numInputSymbols")
+         && isfield (t, "numOutputSymbols")
+         && isfield (t, "numStates")
+         && isfield (t, "nextStates")
+         && isfield (t, "outputs")))
     text = "t is not a valid trellis structure";
   else
     try
@@ -61,14 +61,14 @@
       text = "nextStates is not a numStates-by-numInputSymbols matrix";
     elseif (any (size (t.outputs) != [t.numStates t.numInputSymbols]))
       text = "outputs is not a numStates-by-numInputSymbols matrix";
-    elseif ( any (t.nextStates(:) != fix (t.nextStates(:))) ||
-             any (t.nextStates(:) < 0) ||
-             any (t.nextStates(:) > t.numStates - 1) )
+    elseif (! (all (t.nextStates(:) == fix (t.nextStates(:)))
+               && all (t.nextStates(:) >= 0)
+               && all (t.nextStates(:) < t.numStates)))
       text = "nextStates must contain integers from 0 to numStates-1";
-    elseif ( !outputs_is_octal ||
-             any (t.outputs(:) != fix (t.outputs(:))) ||
-             any (t.outputs(:) < 0) ||
-             any (outputs(:) > t.numOutputSymbols - 1) )
+    elseif (! (outputs_is_octal
+               && all (t.outputs(:) == fix (t.outputs(:)))
+               && all (t.outputs(:) >= 0)
+               && all (outputs(:) < t.numOutputSymbols)))
       text = "outputs must contain octal integers from 0 to numOutputSymbols-1";
     else
       status = true;