From 3c1fc3e2ce4d1e0a2feeb0115684fc9fadded58b Mon Sep 17 00:00:00 2001 From: Arun Giridhar Date: Thu, 23 Nov 2023 14:35:05 -0500 Subject: [PATCH] Update deprecated `shift` to `circshift` in BISTs for chol() and qr() --- libinterp/corefcn/chol.cc | 20 ++++++++++---------- libinterp/corefcn/qr.cc | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/libinterp/corefcn/chol.cc b/libinterp/corefcn/chol.cc index 8b8978fa77..52c7ccb099 100644 --- a/libinterp/corefcn/chol.cc +++ b/libinterp/corefcn/chol.cc @@ -1187,9 +1187,9 @@ Given a Cholesky@tie{}factorization of a real symmetric or complex Hermitian 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 @@ triangular, return the Cholesky@tie{}factorization of %!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 @@ triangular, return the Cholesky@tie{}factorization of %!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 @@ triangular, return the Cholesky@tie{}factorization of %!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 @@ triangular, return the Cholesky@tie{}factorization of %!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); diff --git a/libinterp/corefcn/qr.cc b/libinterp/corefcn/qr.cc index 49eb7f918d..6194061796 100644 --- a/libinterp/corefcn/qr.cc +++ b/libinterp/corefcn/qr.cc @@ -1923,9 +1923,9 @@ Given a QR@tie{}factorization of a real or complex matrix @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 @@ of @w{@var{A}(:,p)}, where @w{p} is the permutation @* /* %!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 @@ of @w{@var{A}(:,p)}, where @w{p} is the permutation @* %! 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 @@ of @w{@var{A}(:,p)}, where @w{p} is the permutation @* %! %!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 @@ of @w{@var{A}(:,p)}, where @w{p} is the permutation @* %! 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 @@ of @w{@var{A}(:,p)}, where @w{p} is the permutation @* %!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 @@ of @w{@var{A}(:,p)}, where @w{p} is the permutation @* %! 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 @@ of @w{@var{A}(:,p)}, where @w{p} is the permutation @* %! %!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 @@ of @w{@var{A}(:,p)}, where @w{p} is the permutation @* %! 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);