changeset 26805:11bf2c815469

maint: Merge stable to default.
author Kai T. Ohlhus <k.ohlhus@gmail.com>
date Tue, 26 Feb 2019 15:46:59 +0100
parents 14815cb62fbe (current diff) 41efc737ceb9 (diff)
children 59bd02077bf3
files
diffstat 2 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/doc/interpreter/octave.texi	Mon Feb 25 15:20:59 2019 -0800
+++ b/doc/interpreter/octave.texi	Tue Feb 26 15:46:59 2019 +0100
@@ -66,7 +66,7 @@
 
 @ifnottex
 
-Copyright @copyright{} 1996-2018 John W. Eaton.
+Copyright @copyright{} 1996-2019 John W. Eaton.
 
 Permission is granted to make and distribute verbatim copies of
 this manual provided the copyright notice and this permission notice
--- a/scripts/linear-algebra/ordeig.m	Mon Feb 25 15:20:59 2019 -0800
+++ b/scripts/linear-algebra/ordeig.m	Tue Feb 26 15:46:59 2019 +0100
@@ -99,10 +99,14 @@
 
 endfunction
 
-# Checks whether a matrix is quasi-triangular
+## Check whether a matrix is quasi-triangular
 function retval = isquasitri (A)
-  v = diag (A, -1) != 0;
-  retval = all (tril (A, -2)(:) == 0) && all (v(1:end-1) + v(2:end) < 2);
+  if (length (A) <= 2)
+    retval = true;
+  else
+    v = diag (A, -1) != 0;
+    retval = (all (tril (A, -2)(:) == 0) && all (v(1:end-1) + v(2:end) < 2));
+  endif
 endfunction
 
 
@@ -124,6 +128,11 @@
 %! lambda = ordeig (AA, BB);
 %! assert (lambda, diag (AA) ./ diag (BB));
 
+## Check trivial 1x1 case
+%!test <*55779>
+%! lambda = ordeig ([6], [2]);
+%! assert (lambda, 3);
+
 ## Test input validation
 %!error ordeig ()
 %!error ordeig (1,2,3)