comparison toolbox/invol.m @ 2:c124219d7bfa draft

Re-add the 1995 toolbox after noticing the statement in the ~higham/mctoolbox/ webpage.
author Antonio Pino Robles <data.script93@gmail.com>
date Thu, 07 May 2015 18:36:24 +0200
parents 8f23314345f4
children
comparison
equal deleted inserted replaced
1:e471a92d17be 2:c124219d7bfa
1 function A = invol(n)
2 %INVOL An involutory matrix.
3 % A = INVOL(N) is an N-by-N involutory (A*A = EYE(N)) and
4 % ill-conditioned matrix.
5 % It is a diagonally scaled version of HILB(N).
6 % NB: B = (EYE(N)-A)/2 and B = (EYE(N)+A)/2 are idempotent (B*B = B).
7
8 % Reference:
9 % A.S. Householder and J.A. Carpenter, The singular values
10 % of involutory and of idempotent matrices, Numer. Math. 5 (1963),
11 % pp. 234-237.
12
13 A = hilb(n);
14
15 d = -n;
16 A(:, 1) = d*A(:, 1);
17
18 for i = 1:n-1
19 d = -(n+i)*(n-i)*d/(i*i);
20 A(i+1, :) = d*A(i+1, :);
21 end