changeset 32485:22c90d779a24

Update deprecated `shift` to `circshift` in BISTs for chol() and qr()
author Arun Giridhar <arungiridhar@gmail.com>
date Thu, 23 Nov 2023 14:35:05 -0500
parents f8953d6fee2d
children 3531e4090f94
files libinterp/corefcn/chol.cc libinterp/corefcn/qr.cc
diffstat 2 files changed, 20 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/chol.cc	Wed Nov 22 16:54:04 2023 -0800
+++ b/libinterp/corefcn/chol.cc	Thu Nov 23 14:35:05 2023 -0500
@@ -1187,9 +1187,9 @@
 positive definite matrix @w{@var{A} = @var{R}'*@var{R}}, @var{R}@tie{}upper
 triangular, return the Cholesky@tie{}factorization of
 @w{@var{A}(p,p)}, where @w{p} is the permutation @*
-@code{p = [1:i-1, shift(i:j, 1), j+1:n]} if @w{@var{i} < @var{j}} @*
+@code{p = [1:i-1, circshift(i:j, 1), j+1:n]} if @w{@var{i} < @var{j}} @*
  or @*
-@code{p = [1:j-1, shift(j:i,-1), i+1:n]} if @w{@var{j} < @var{i}}.  @*
+@code{p = [1:j-1, circshift(j:i,-1), i+1:n]} if @w{@var{j} < @var{i}}.  @*
 
 @seealso{chol, cholupdate, cholinsert, choldelete}
 @end deftypefn */)
@@ -1276,13 +1276,13 @@
 %!test
 %! R = chol (A);
 %!
-%! i = 1;  j = 3;  p = [1:i-1, shift(i:j,-1), j+1:4];
+%! i = 1;  j = 3;  p = [1:i-1, circshift(i:j,-1), j+1:4];
 %! R1 = cholshift (R, i, j);
 %!
 %! assert (norm (triu (R1)-R1, Inf), 0);
 %! assert (norm (R1'*R1 - A(p,p), Inf), 0, 1e1*eps);
 %!
-%! j = 1;  i = 3;  p = [1:j-1, shift(j:i,+1), i+1:4];
+%! j = 1;  i = 3;  p = [1:j-1, circshift(j:i,+1), i+1:4];
 %! R1 = cholshift (R, i, j);
 %!
 %! assert (norm (triu (R1) - R1, Inf), 0);
@@ -1291,13 +1291,13 @@
 %!test
 %! R = chol (Ac);
 %!
-%! i = 1;  j = 3;  p = [1:i-1, shift(i:j,-1), j+1:4];
+%! i = 1;  j = 3;  p = [1:i-1, circshift(i:j,-1), j+1:4];
 %! R1 = cholshift (R, i, j);
 %!
 %! assert (norm (triu (R1)-R1, Inf), 0);
 %! assert (norm (R1'*R1 - Ac(p,p), Inf), 0, 1e1*eps);
 %!
-%! j = 1;  i = 3;  p = [1:j-1, shift(j:i,+1), i+1:4];
+%! j = 1;  i = 3;  p = [1:j-1, circshift(j:i,+1), i+1:4];
 %! R1 = cholshift (R, i, j);
 %!
 %! assert (norm (triu (R1)-R1, Inf), 0);
@@ -1306,13 +1306,13 @@
 %!test
 %! R = chol (single (A));
 %!
-%! i = 1;  j = 3;  p = [1:i-1, shift(i:j,-1), j+1:4];
+%! i = 1;  j = 3;  p = [1:i-1, circshift(i:j,-1), j+1:4];
 %! R1 = cholshift (R, i, j);
 %!
 %! assert (norm (triu (R1)-R1, Inf), 0);
 %! assert (norm (R1'*R1 - single (A(p,p)), Inf), 0, 1e1* eps ("single"));
 %!
-%! j = 1;  i = 3;  p = [1:j-1, shift(j:i,+1), i+1:4];
+%! j = 1;  i = 3;  p = [1:j-1, circshift(j:i,+1), i+1:4];
 %! R1 = cholshift (R, i, j);
 %!
 %! assert (norm (triu (R1)-R1, Inf), 0);
@@ -1321,13 +1321,13 @@
 %!test
 %! R = chol (single (Ac));
 %!
-%! i = 1;  j = 3;  p = [1:i-1, shift(i:j,-1), j+1:4];
+%! i = 1;  j = 3;  p = [1:i-1, circshift(i:j,-1), j+1:4];
 %! R1 = cholshift (R, i, j);
 %!
 %! assert (norm (triu (R1)-R1, Inf), 0);
 %! assert (norm (R1'*R1 - single (Ac(p,p)), Inf), 0, 1e1* eps ("single"));
 %!
-%! j = 1; i = 3; p = [1:j-1, shift(j:i,+1), i+1:4];
+%! j = 1; i = 3; p = [1:j-1, circshift(j:i,+1), i+1:4];
 %! R1 = cholshift (R, i, j);
 %!
 %! assert (norm (triu (R1)-R1, Inf), 0);
--- a/libinterp/corefcn/qr.cc	Wed Nov 22 16:54:04 2023 -0800
+++ b/libinterp/corefcn/qr.cc	Thu Nov 23 14:35:05 2023 -0500
@@ -1923,9 +1923,9 @@
 @w{@var{A} = @var{Q}*@var{R}}, @var{Q}@tie{}unitary and
 @var{R}@tie{}upper trapezoidal, return the QR@tie{}factorization
 of @w{@var{A}(:,p)}, where @w{p} is the permutation @*
-@code{p = [1:i-1, shift(i:j, 1), j+1:n]} if @w{@var{i} < @var{j}} @*
+@code{p = [1:i-1, circshift(i:j, 1), j+1:n]} if @w{@var{i} < @var{j}} @*
  or @*
-@code{p = [1:j-1, shift(j:i,-1), i+1:n]} if @w{@var{j} < @var{i}}.  @*
+@code{p = [1:j-1, circshift(j:i,-1), i+1:n]} if @w{@var{j} < @var{i}}.  @*
 
 @seealso{qr, qrupdate, qrinsert, qrdelete}
 @end deftypefn */)
@@ -2009,7 +2009,7 @@
 /*
 %!test
 %! AA = A.';
-%! i = 2;  j = 4;  p = [1:i-1, shift(i:j,-1), j+1:5];
+%! i = 2;  j = 4;  p = [1:i-1, circshift(i:j,-1), j+1:5];
 %!
 %! [Q,R] = qr (AA);
 %! [Q,R] = qrshift (Q, R, i, j);
@@ -2017,7 +2017,7 @@
 %! assert (norm (vec (triu (R) - R), Inf), 0);
 %! assert (norm (vec (Q*R - AA(:,p)), Inf), 0, norm (AA)*1e1*eps);
 %!
-%! j = 2;  i = 4;  p = [1:j-1, shift(j:i,+1), i+1:5];
+%! j = 2;  i = 4;  p = [1:j-1, circshift(j:i,+1), i+1:5];
 %!
 %! [Q,R] = qr (AA);
 %! [Q,R] = qrshift (Q, R, i, j);
@@ -2027,7 +2027,7 @@
 %!
 %!test
 %! AA = Ac.';
-%! i = 2;  j = 4;  p = [1:i-1, shift(i:j,-1), j+1:5];
+%! i = 2;  j = 4;  p = [1:i-1, circshift(i:j,-1), j+1:5];
 %!
 %! [Q,R] = qr (AA);
 %! [Q,R] = qrshift (Q, R, i, j);
@@ -2035,7 +2035,7 @@
 %! assert (norm (vec (triu (R) - R), Inf), 0);
 %! assert (norm (vec (Q*R - AA(:,p)), Inf), 0, norm (AA)*1e1*eps);
 %!
-%! j = 2;  i = 4;  p = [1:j-1, shift(j:i,+1), i+1:5];
+%! j = 2;  i = 4;  p = [1:j-1, circshift(j:i,+1), i+1:5];
 %!
 %! [Q,R] = qr (AA);
 %! [Q,R] = qrshift (Q, R, i, j);
@@ -2045,7 +2045,7 @@
 
 %!test
 %! AA = single (A).';
-%! i = 2;  j = 4;  p = [1:i-1, shift(i:j,-1), j+1:5];
+%! i = 2;  j = 4;  p = [1:i-1, circshift(i:j,-1), j+1:5];
 %!
 %! [Q,R] = qr (AA);
 %! [Q,R] = qrshift (Q, R, i, j);
@@ -2055,7 +2055,7 @@
 %! assert (norm (vec (Q*R - AA(:,p)), Inf), single (0), ...
 %!         norm (AA)*1e1 * eps ("single"));
 %!
-%! j = 2;  i = 4;  p = [1:j-1, shift(j:i,+1), i+1:5];
+%! j = 2;  i = 4;  p = [1:j-1, circshift(j:i,+1), i+1:5];
 %!
 %! [Q,R] = qr (AA);
 %! [Q,R] = qrshift (Q, R, i, j);
@@ -2067,7 +2067,7 @@
 %!
 %!test
 %! AA = single (Ac).';
-%! i = 2;  j = 4;  p = [1:i-1, shift(i:j,-1), j+1:5];
+%! i = 2;  j = 4;  p = [1:i-1, circshift(i:j,-1), j+1:5];
 %!
 %! [Q,R] = qr (AA);
 %! [Q,R] = qrshift (Q, R, i, j);
@@ -2077,7 +2077,7 @@
 %! assert (norm (vec (Q*R - AA(:,p)), Inf), single (0), ...
 %!         norm (AA)*1e1 * eps ("single"));
 %!
-%! j = 2;  i = 4;  p = [1:j-1, shift(j:i,+1), i+1:5];
+%! j = 2;  i = 4;  p = [1:j-1, circshift(j:i,+1), i+1:5];
 %!
 %! [Q,R] = qr (AA);
 %! [Q,R] = qrshift (Q, R, i, j);