presentation04

% Generate 100-by-4-by-4 amat object symmetric positive definite matrices:
A=fc_amat.random.randnsympd(100,4);
% determinants computation:
D=det(A); % D: 100-by-1-by-1 amat object,  det(A(k))=D(k),    for all k
% LU factorizations:
[L,U,P]=lu(A);
E1=abs(L*U-P*A);
fprintf('max of E1 elements: %.6e\n',max(E1(:)))
% Cholesky factorizations:
R=chol(A);
E2=abs(R'*R-A);
fprintf('max of E2 elements: %.6e\n',max(E2(:)))
% Solving linear systems:
b=ones(4,1); % RHS
X=A\b;   % X: 100-by-4-by-1, X(k)=A(k)\b,    for all k
E3=abs(A*X-b);
fprintf('max of E3 elements: %.6e\n',max(E3(:)))
B=fc_amat.random.randn(100,4,1); % RHS
Y=A\B;   % Y: 100-by-4-by-1, Y(k)=A(k)\B(k), for all k
E4=abs(A*Y-B);
fprintf('max of E4 elements: %.6e\n',max(E4(:)))
whos
max of E1 elements: 7.105427e-15
max of E2 elements: 7.105427e-15
max of E3 elements: 2.553513e-15
max of E4 elements: 5.107026e-15
Variables visible from the current scope:
 
variables in scope: eval_code_helper: /fcopt/OCTAVE/7.3.0/share/octave/7.3.0/m/miscellaneous/publish.m
 
  Attr   Name          Size                     Bytes  Class
  ====   ====          ====                     =====  ===== 
         A           100x4x4                        0  amat
         B           100x4x1                        0  amat
         D           100x1x1                        0  amat
         E1          100x4x4                        0  amat
         E2          100x4x4                        0  amat
         E3          100x4x1                        0  amat
         E4          100x4x1                        0  amat
         L           100x4x4                        0  amat
         P           100x4x4                        0  amat
         R           100x4x4                        0  amat
         U           100x4x4                        0  amat
         X           100x4x1                        0  amat
         Y           100x4x1                        0  amat
    f    __code__      1x742                      742  char
         b             4x1                         32  double
 
Total is 759 elements using 774 bytes