Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
22
Task/Identity-matrix/ALGOL-W/identity-matrix.alg
Normal file
22
Task/Identity-matrix/ALGOL-W/identity-matrix.alg
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
begin
|
||||
% set m to an identity matrix of size s %
|
||||
procedure makeIdentity( real array m ( *, * )
|
||||
; integer value s
|
||||
) ;
|
||||
for i := 1 until s do begin
|
||||
for j := 1 until s do m( i, j ) := 0.0;
|
||||
m( i, i ) := 1.0
|
||||
end makeIdentity ;
|
||||
|
||||
% test the makeIdentity procedure %
|
||||
begin
|
||||
real array id5( 1 :: 5, 1 :: 5 );
|
||||
makeIdentity( id5, 5 );
|
||||
r_format := "A"; r_w := 6; r_d := 1; % set output format for reals %
|
||||
for i := 1 until 5 do begin
|
||||
write();
|
||||
for j := 1 until 5 do writeon( id5( i, j ) )
|
||||
end for_i ;
|
||||
end text
|
||||
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue