Algol libraries

Some math libraries were originally in Algol, more often Algol 60 than Algol 68, which is now supported by gcc. The Algol libaries were translated to Fortran 77, and sometimes from Fortran 77 to modern Fortran, but I wonder if translating from the original Algol to modern Fortran would make sense as a hobby project. ChatGPT answered some of my questions about Algol.

1 Like

Michael Wirth from has a few posts about Algol 68 on his “Craft of Coding” blog:

Here is an Algol 60 procedure for back-substitution using the LU factorization of a banded matrix:

procedure bansol1 (n,m1,m2) data: (e, r, a, m, int) data and result: (b);
value n, m1, m2, e, r; integer n, m1, m2, e, r; array a, m, b;
    integer array int;

comment When e = 0 this procedure solves (A-lambda*I)x=b,
        where A is a band matrix of order n and (A - lambda*I)
        has previously been factorized using bandet1. Here, b is an
        n * r matrix consisting of r right-hand sides. Each right-
        hand side requires one forward substitution and one back-
        substitution. When e = 1, a back-substitution only is used.
        This varient should be used as the first step in inverse
        iteration for the eigenvector corresponding to lambda;

begin   integer i, i, k, l, w;
        real x;
        l := m1;
        if e = 0 then
        for k := 1 step 1 until n do
        begin i := int[k];
            if i /= k then
            for j:= 1 step 1 until r do
            begin x:=b[k,j]; b[k,j]:=b[i,j]; b[i,j]:= x
            end j;
            if l < n then l:=l+1;
            for i:=k+1 step 1 until l do
            begin x:= m[k,i-k]
                for j:=1 step 1 until r do
                b[i,j] := b[i,j] - x * b[k,j]
            end i
        end k
        for j:= 1 step 1 until r do
        begin l:=-m1
            for i:=n step -1 until 1 do
            begin x:=b[i,j]; w:=i+m1;
                for k:=1-m1 step 1 until l do
                x := x - a[i,k]*b[k+w,j];
                b[i,j] := x/a[i,-m1];
                if (l<m2) then l:=l+1
            end i
        end j
end bansol1

The dummy arguments of the function are,

  • n order of the band matrix A - lambda I which has been factorized using
    bandet1.
  • m1 number of sub-diagonal lines in A.
  • m2 number of super-diagonal lines in A.
  • e parameter which modifies the procedure for use in inverse iteration
  • r number of right-hand sides.
  • a upper-triangle of factorization of A - lambda I as given by bandet1.
  • m lower-triangle of factorization of A - lambda I as given by bandet1.
  • int an array giving details of pivoting as provided by bandet1.
  • b on input an n Ă— r array consisting of the r right-hand sides; on output consists of the r solutions

Source: Solution of symmetric and unsymmetric band equations and the calculation of eigenvectors of band matrices | Numerische Mathematik | Springer Nature Link

The LAPACK routine serving a similar purpose, but with a different banded matrix format, is ?GBTRS.

1 Like

The Mathematical Centre in Amsterdam, Netherlands, hosts a digital archive of mathematical reports, many of them using Algol 60 and Algol 68:

1 Like

I think there are some old ACM reports that have published ALGOL code in them. Some very early ALGOL 60 code is still available on the ACM CALGO site. Plus I think most if not all of the ACM articles etc are now Open Access (but I could be wrong).

You are not wrong, most are indeed open-access.