code 34131;
    procedure LSQSOL(A, N, M, AID, CI, B); value N, M;
    integer N, M; array A, AID, B; integer array CI;
    begin integer K, CIK;
        real W;

        for K:= 1 step 1 until M do ELMVECCOL(K, N, K, B, A,
        TAMVEC(K, N, K, A, B) / (AID[K] * A[K,K]));
        for K:= M step - 1 until 1 do B[K]:= (B[K] - MATVEC
        (K + 1, M, K, A, B)) / AID[K];
        for K:= M step - 1 until 1 do 
        begin CIK:= CI[K]; if CIK ^= K then 
            begin W:= B[K]; B[K]:= B[CIK]; B[CIK]:= W end 
        end 
    end LSQSOL;
        eop