% CS 4220 (Spring 2010) Assignment 1
% Test Script P4. Checks out FirstCol
% Generate a random H and a random alfa...
randn('seed',0)
n = 20; H = randn(n,n); H = triu(H,-1);
p = 12; alfa = rand(p,1);
% Compute the first column the long way...
M = eye(n,n);
for k=1:p
    M = M*(H - alfa(k)*eye(n,n));
end
v0 = M(:,1);
% Compare with what is produced by FirstCol...
v = FirstCol(H,alfa);
clc
format long
TwoAnswers = [v0 v]