gridripper::math::expr::ExprOptimizer Class Reference

Optimizes the internal code of an expression. More...

List of all members.

Static Public Member Functions

static StkConst reuseConst (List< StkConst > nums, String name, double value)
 Tries to reuse an already existing constant.
static void performAll (List< StkOp > program, List< StkConst > nums, double[] stack, StkOpRepository rep)
 Performs all optimizations.
static void inlineExprs (List< StkOp > program)
 Make everything inline if possible.
static void precalc (List< StkOp > program, List< StkConst > nums, double[] stack)
 Precalculates constant subexpressions.
static void optimizePow (List< StkOp > program, StkOpRepository rep)
 Replaces x^(+-y) by one-argument functions.
static void optimizeMult (List< StkOp > program, StkOpRepository rep)
 Replaces (.
static void optimizeDiv (List< StkOp > program, StkOpRepository rep)
 Replaces const/(.
static void optimizePlus (List< StkOp > program, StkOpRepository rep)
 Replaces const+(.
static void optimizeMinus (List< StkOp > program, StkOpRepository rep)
 Replaces const-(.

Classes

class  Fdivx
class  Fminusx
class  Fpowx
class  Fxdiv
class  Fxminus
class  Fxmult
class  Fxplus
class  Fxpow


Detailed Description

Optimizes the internal code of an expression.

Version:
GridRipper 0.5, 11/16/2008
Since:
GROMIT 0.2 (2001)
Author:
Peter Csizmadia

Member Function Documentation

static StkConst gridripper::math::expr::ExprOptimizer::reuseConst ( List< StkConst nums,
String  name,
double  value 
) [inline, static]

Tries to reuse an already existing constant.

It creates a new object only if the constant is not found in the repository.

Parameters:
nums a repository of existing constants
name the constant name
value the constant value
Returns:
the constant

static void gridripper::math::expr::ExprOptimizer::inlineExprs ( List< StkOp program  )  [inline, static]

Make everything inline if possible.

static void gridripper::math::expr::ExprOptimizer::precalc ( List< StkOp program,
List< StkConst nums,
double[]  stack 
) [inline, static]

Precalculates constant subexpressions.

static void gridripper::math::expr::ExprOptimizer::optimizePow ( List< StkOp program,
StkOpRepository  rep 
) [inline, static]

Replaces x^(+-y) by one-argument functions.

Optimized y values: 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 5, 6, 7, 8.

static void gridripper::math::expr::ExprOptimizer::optimizeMult ( List< StkOp program,
StkOpRepository  rep 
) [inline, static]

Replaces (.

..)*(...), const*(...), and (...)*const by one-argument functions.

static void gridripper::math::expr::ExprOptimizer::optimizeDiv ( List< StkOp program,
StkOpRepository  rep 
) [inline, static]

Replaces const/(.

..) and (...)/const by one-argument functions, 1/(...) by (...)^-1.

static void gridripper::math::expr::ExprOptimizer::optimizePlus ( List< StkOp program,
StkOpRepository  rep 
) [inline, static]

Replaces const+(.

..) and (...)+const by one-argument functions.

static void gridripper::math::expr::ExprOptimizer::optimizeMinus ( List< StkOp program,
StkOpRepository  rep 
) [inline, static]

Replaces const-(.

..) and (...)-const by one-argument functions.


The documentation for this class was generated from the following file:

Generated on Wed Jun 17 18:47:29 2009 for GridRipper by  doxygen 1.5.6