Class TestMatrix

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

public class TestMatrix
extends Project
Test the MatrixD 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 MatrixD.dll (compiled by Microsoft Visual C++ Developer Studio, 1995 version). The test was run under WinNT on a 200 MHz Pentium Pro.

    MatrixF: exp=0, iter=5000, size= 30 seconds(with/without DLL)= 3.484 17.735
    MatrixD: exp=0, iter=5000, size= 30 seconds(with/without DLL)= 3.906 18.062
    MatrixF: exp=1, iter=5000, size= 30 seconds(with/without DLL)= 3.453 17.735
    MatrixD: exp=1, iter=5000, size= 30 seconds(with/without DLL)= 3.89  18.047
    MatrixF: exp=2, iter=5000, size= 30 seconds(with/without DLL)= 3.344 17.39
    MatrixD: exp=2, iter=5000, size= 30 seconds(with/without DLL)= 3.719 17.625
    MatrixF: exp=3, iter= 200, size= 30 seconds(with/without DLL)= 0.125  0.672
    MatrixD: exp=3, iter= 200, size= 30 seconds(with/without DLL)= 0.14   0.688
    MatrixF: exp=0, iter=   4, size=300 seconds(with/without DLL)= 5.985 18.141
    MatrixD: exp=0, iter=   4, size=300 seconds(with/without DLL)=10.203 21.938
    MatrixF: exp=1, iter=   4, size=300 seconds(with/without DLL)= 5.985 18.125
    MatrixD: exp=1, iter=   4, size=300 seconds(with/without DLL)=10.219 22.016
    MatrixF: exp=2, iter=   4, size=300 seconds(with/without DLL)= 5.766 17.921
    MatrixD: exp=2, iter=   4, size=300 seconds(with/without DLL)= 9.969 21.844
    MatrixF: exp=3, iter=   4, size=300 seconds(with/without DLL)= 5.719 17.875
    MatrixD: exp=3, iter=   4, size=300 seconds(with/without DLL)= 9.937 21.766
                                                                            
MatrixD is used throughout WebSim. 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 MatrixD and MatrixF with and without DLL
 o testD(int, int, int, boolean)
test the MatrixD class.
 o testF(int, int, int, boolean)
test the MatrixF 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 MatrixD and MatrixF with and without DLL

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

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