% CS 4220 (Spring 2010) Assignment 2
% Test Script P1. Checks out MatTriSol.

% Small Example...
clc
randn('seed',0)
m = 7; n = 5; S = triu(randn(m,m)); T = triu(randn(n,n)); B = randn(m,n);
X = MatTriSol(S,T,B);
fprintf('Example 1.\n\nSXT + X - B =\n\n')
disp(S*X*T +X - B)

% Bigger Example...
m = 300; n = 400; S = triu(randn(m,m)); T = triu(randn(n,n)); B = randn(m,n);
X = MatTriSol(S,T,B);
fprintf('\n\nExample 2.\n\nnorm(SXT + X - B,''fro'')/norm(X,''fro'') = %10.5e\n\n',norm(S*X*T +X - B,'fro')/norm(X,'fro'))