How well does ChroMathsome - Linear Algebra Pro perform?
========================================================
To measure performance, two factors come into play:
a. accuracy
b. speed.

To get an idea of both, we ran the following test.
We took a (semi-) large sized matrix, inverted it and then multiplied the
result matrix with the original matrix and looked at the final resulting matrix.

This test shows how accurate the following algorithms are:
1. Gauss reduction
2. Hermite reduction
3. multiplication of 2 matrices.
Note: the algorithm used to invert a matrix is the Gauss-Jordan elimination scheme wich works
as follows.
1. create the augmented matrix M|In where M is the original matrix and In an identity matrix
   of order M.Row
2. reduce this matrix to hermite normal form (aka. as Gauss-Jordan elimination)
   Step1: Gauss elimination
   Step2: further reduction to hermite normal form
3. return the augmented block (= inverse of original matrix).

The test was ran with two types of matrices.

A. Real matrix
--------------
Test matrix: a 300 * 300 random matrix defined as Random_RealMatrix(M, 10000).
Code (Note: look at the code for inverting a complex matrix in the demonstration program):
var M, M1, M2: RealMatrix;
begin
      InitRealMatrix(M, 300, 300);
      InitRealMatrix(M1, 3, 3); { the 3's are dummy values, ChroMathsome will update the dimensions }
      InitRealMatrix(M2, 5, 5); { idem for the 5's } 
      try
      Random_RealMatrix(M, 10000);
      { Lines marked with $$ are optional. They are not important to run the test. }
      Write_MatrixToFile(M, 'MOrig.TXT'); {$$}
      Copy_RealMatrix(M1, M); { Use M1 to test the inverse. }
      RealMatrix_Inverse(M);
      Write_MatrixToFile(M, 'Inverse.TXT'); {$$}
      RealMatrix_Multiplication(M2, M1, M); { M2 = original * inverse }
      Write_MatrixToFile(M2, 'Identity.TXT'); { Is M2 an identity matrix? }
      finally
      DestroyRealMatrix(M);
      DestroyRealMatrix(M1);
      DestroyRealMatrix(M2);
      end;
end;     

In the above, we write the matrices to a file.
Here's a possible implementation to do this.
Note that strings (Delphi 1) can only have maximum 256 characters.
We only write those values that aren't equal to 0 to the file so that the string length is < 256.

procedure TForm1.Write_MatrixToFile(M: RealMatrix; FileName: string);
var a,b:integer;
    matt,mats,mattt:string;
    F: TextFile;
begin
    AssignFile(F, FileName);
    Rewrite(F);
    mattt:= '';
    for a:= 1  to M.Row do
    begin
    mats:= '[ ';
    for b:= 1 to M.Col do
    begin
    if abs(M.Matrix^[a]^[b]) < 1E-10 then
    begin
    M.Matrix^[a]^[b]:= 0;
    matt:= ''; { if the values are almost 0, ignore them }
    end
    else
    matt:= FloatToStrF(M.Matrix^[a]^[b], ffexponent,5,2);
    mattt:= mattt + matt;
    end;
    mats:= mats + mattt + ']';
    mattt:= '';
    writeln(F, mats);
    end;
    CloseFile(F);
end;


B. Complex matrix
-----------------
Test matrix: a 200 * 200 random matrix defined as Random_ComplexMatrix(M, 10000).
The code to perform this test is the same 
(only this time for complex matrices -> see demonstration program).


What do these tests show?
A. Accuracy
-----------
The resulting matrix in the tests above is in both cases an almost perfect identity matrix
abs(round-off errors) < 1E-10)!
Thus, the accuracy is very good.
(To give you an idea:
Maple V release 3 for Windows (a 'professional' mathematics package) gives
an identity matrix with abs(round-off errors) > 1E-10 (even for a 'small' 35*35 matrix).)

B. Speed
--------
The tests above take approximately 5 minutes to perform.
Is this fast or slow?
To answer this question do a 'manual' step-by-step analysis of the real matrix test:
Starting from a 300 * 300 matrix we created the augmented matrix wich results in a 300 * 600 matrix.
1. Gauss reduction
   -> reducing a 300 * 600 matrix to Gauss normal form.
2. Hermite reduction
   -> reducing a 300 * 600 matrix to hermite normal form.
3. Multiplying both matrices
4. Testing the result (and write them to a file)

Try the above calculations for a small (5*5) matrix by hand to get an idea of how many
row and column operations this takes (and thus, of the speed of ChroMathsome - Linear Algebra).

We could, of course, test the speed against Maple V but those who know this program
know that this isn't a "fair" test (why? ...).
(ChroMathsome runs at mach speed compared to Maple V, but this is "very" relative).


Test system
===========
The test was ran on a P90 system with 32mb and running Windows 95.
ChroMathsome - Linear Algebra was compiled using Delphi 1.0.
If you wish, you can perform the same test but for larger matrices.
Take the following into account:
A (300*600) real matrix takes: 300*600*10 + 4 + 4 bytes = 1.8mb (ignore the 8 bytes)
Note that for this test you need atleast 4 matrices (1 300*600 and 3 300*300):
M, M1, M2 (for the interface) and one in the inversion algorithm (the inverse matrix block
in the augmented matrix).

(for the complex test:
 Highest global memory use:	9619976 bytes
 Highest stack memory use:	   6582 bytes)


