Class TestMatrix

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----GWin
                                   |
                                   +----Project
                                           |
                                           +----TestMatrix

public class TestMatrix
extends Project
Test the Matrix object (useful for debugging native-code implementations).

This code is (c) 1997 Leemon Baird <leemon@cs.cmu.edu>, http://www.cs.cmu.edu/~baird
The source and object code may be redistributed freely. If the code is modified, please state so in the comments.

This was tested with Symantec Cafe 1.51 with JIT 3.0 beta 3, with both pure Java, and with the Matrix.dll (compiled by Microsoft Visual C++ Developer Studio, 1995 version). The test was run under WinNT on a 200 MHz Pentium Pro.

The last four numbers on each row are # seconds to run on:
   200 MHz 100MB Pentium Pro with     DLL
   200 MHz 100MB Pentium Pro without  DLL
   166 MHz  16MB Pentium     with     DLL
   166 MHz  16MB Pentium     without  DLL
 MatrixF is the WebSim Matrix object modified to use floats instead of doubles,
 and the DLL was also modified to use floats instead of doubles.  Floats appear
 to be only very slightly faster than doubles, even for these extremely
 floating-point-intensive benchmarks.
    MatrixF: exp=0, iter=5000, size= 30     3.484 17.735     6.21 26.59
    Matrix:  exp=0, iter=5000, size= 30     3.906 18.062     7.41 28.28
    MatrixF: exp=1, iter=5000, size= 30     3.453 17.735     6.26 27.74
    Matrix:  exp=1, iter=5000, size= 30     3.89  18.047     7.42 28.28
    MatrixF: exp=2, iter=5000, size= 30     3.344 17.39      5.99 26.86
    Matrix:  exp=2, iter=5000, size= 30     3.719 17.625     6.97 28.18
    MatrixF: exp=3, iter= 200, size= 30     0.125  0.672     0.27 1.04
    Matrix:  exp=3, iter= 200, size= 30     0.14   0.688     0.28 1.1
    MatrixF: exp=0, iter=   4, size=300     5.985 18.141    17.03 33.67
    Matrix:  exp=0, iter=   4, size=300    10.203 21.938    27.63 42.46
    MatrixF: exp=1, iter=   4, size=300     5.985 18.125    17.19 33.17
    Matrix:  exp=1, iter=   4, size=300    10.219 22.016    27.19 42.46
    MatrixF: exp=2, iter=   4, size=300     5.766 17.921    17.08 32.95
    Matrix:  exp=2, iter=   4, size=300     9.969 21.844    27.02 42.3
    MatrixF: exp=3, iter=   4, size=300     5.719 17.875    17.08 32.95
    Matrix:  exp=3, iter=   4, size=300     9.937 21.766    26.97 42.18
                                                                            
These numbers were checked with Cafe's compiler set for "debug" and "release", and the speed was equal in both cases.

Version:
1.0, 15 Apr 97
Author:
Leemon Baird

Constructor Index

 o TestMatrix()

Method Index

 o BNF(int)
 o parse(Parser, int)
Parse the input file to get the parameters for this object.
 o run()
Run the project in a separate thread, and let the thread die when done.
 o test(int, int, int)
run a series of tests comparing Matrix with and without DLL
 o testD(int, int, int, boolean)
test the Matrix class.
 o unparse(Unparser, int)
Output a description of this object that can be parsed with parse().

Constructors

 o TestMatrix
 public TestMatrix()

Methods

 o BNF
 public String BNF(int lang)
Overrides:
BNF in class Project
 o unparse
 public void unparse(Unparser u,
                     int lang)
Output a description of this object that can be parsed with parse().

Overrides:
unparse in class Project
See Also:
Parsable
 o parse
 public Object parse(Parser p,
                     int lang) throws ParserException
Parse the input file to get the parameters for this object.

Throws: ParserException
parser didn't find the required token
Overrides:
parse in class Project
 o run
 public void run()
Run the project in a separate thread, and let the thread die when done.

Overrides:
run in class Project
 o test
 public void test(int exp,
                  int iter,
                  int size)
run a series of tests comparing Matrix with and without DLL

 o testD
 public void testD(int exp,
                   int iter,
                   int size,
                   boolean useNative)
test the Matrix class. iter=# iterations for timing test, exp=which experiment to run, size=size of arrays/vectors.