|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.singularsys.jepexamples.diagnostics.SpeedTest
public class SpeedTest
Compares the speed of evaluation between different evaluation schemes. The standard class compares BigDecimal, Jep (with default Fast evaluator), the old StandardEvaluator, and RealEvaluator.
If you have some nice complicated examples, I'd love to hear about them to see if we can tune things up. - rich
Nested Class Summary | |
---|---|
static class |
SpeedTest.BDConfig
Configuration using the BDConfig |
static class |
SpeedTest.EvaluationConfig
Basic class to set the evaluation context |
static class |
SpeedTest.JepConfig
Standard Jep configuration (with FastEvaluator) |
static class |
SpeedTest.OldConfig
Configuration using the StandardEvaluator |
static class |
SpeedTest.Outputter
Different output methods |
static class |
SpeedTest.RatioOutputter
Print detailed ratios for each run. |
static class |
SpeedTest.RealConfig
Configuration using the RealEvaluator |
static class |
SpeedTest.TabOutputter
Print output tab separated. |
Field Summary | |
---|---|
int |
nDeriv
|
int |
num_itts
|
int |
num_vals
|
protected SpeedTest.Outputter |
outputter
|
protected long[] |
totalTimes
|
Constructor Summary | |
---|---|
SpeedTest(SpeedTest.Outputter outputter)
|
Method Summary | |
---|---|
void |
addConfig(SpeedTest.EvaluationConfig config)
Adds a new EvaluationConfig to be be run for comparison. |
void |
doAll(java.lang.String[] eqns,
java.lang.String[] varNames)
Run speed comparison for a set of equations. |
void |
doAll(java.lang.String eqn,
java.lang.String[] varNames)
Run speed comparison for a single equation. |
void |
fini()
|
static java.lang.String |
hornerExpression(java.lang.String varName,
int nDeriv)
Generate a string giving an approximation to log using Horner form "x*(1/1-x*(1/2-x*(1/3-x*(1/4 ...))))" |
void |
init()
|
static java.lang.String |
lnExpression(java.lang.String varName,
int nDeriv)
Generate string giving approximation to log |
static void |
main(java.lang.String[] args)
Main method, executes all speed tests. |
static void |
runTests(SpeedTest st)
A standard set of tests. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int num_itts
public int num_vals
public int nDeriv
protected SpeedTest.Outputter outputter
protected long[] totalTimes
Constructor Detail |
---|
public SpeedTest(SpeedTest.Outputter outputter)
outputter
- Method Detail |
---|
public void init()
public void fini()
public void doAll(java.lang.String eqn, java.lang.String[] varNames)
eqn
- The equation to testvarNames
- an array of variable names which will be set to random values.public void doAll(java.lang.String[] eqns, java.lang.String[] varNames)
eqns
- varNames
- public void addConfig(SpeedTest.EvaluationConfig config)
config
- public static java.lang.String lnExpression(java.lang.String varName, int nDeriv)
public static java.lang.String hornerExpression(java.lang.String varName, int nDeriv)
public static void main(java.lang.String[] args)
args
- public static void runTests(SpeedTest st)
st
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |