linal::AlPars Class Reference

#include <AlPars.h>


Public Member Functions

 AlPars ()

Static Public Member Functions

static DString getVersion ()
static DString postfixMe (const DString &)
 Returns a postfix form of the String.
static DString unPostFix (const DString &bean)
 Returns an infix expression from a postfix expression.
static bool isOperator (char ch)
 Tells whether or not a character is an operator.
static int precedence (char ch)
 Gives precedence of characters *,/,+,-,%.
static bool calculateable (const LTree &tree)
 Determines whether or not an LTree is calcuated, i.e.
static bool calculateable (const LTree &tree, LinAl &la)
 Determines whether or not an LTree is calcuated, i.e.
static double doIt (const LTree &, LinAl &)
static double doIt (const LTree &tree)
static LTree infixLTree (const DString &expression, LinAl &la)
 Creates a infix LTree from a given expression.
static utils::DArray< ObjectpostfixArrayList (const DString &expression, LinAl &la)
 Creates a postfix ArrayList of Variable's, LTree's, Characters and Doubles.
static utils::DArray< ObjectpostfixArrayList (const char *expression, LinAl &la)
static LTree simplify (const LTree &tree, LinAl &la)
 Simplifies algebraic expressions.
static Matrix matrixSimplify (const Matrix &m, LinAl &la)
static LTree getMatrixElement (DString &ex, LinAl &la) throw (DavidException)
static LTree sum (const LTree &left, const LTree &right, LinAl &la)
 Returns the sum of the two LTree's.
static LTree matrixAddition (const LTree &left, const LTree &right, LinAl &la)
static LTree difference (const LTree &left, const LTree &right, LinAl &la)
 Returns the difference of the two LTree's.
static LTree multiply (const LTree &left, const LTree &right, LinAl &la)
 Returns the products of the two LTree's.
static LTree matrixMultiply (const LTree &left, const LTree &right, LinAl &la)
static LTree exponent (const LTree &base, const LTree &exponent, LinAl &la)
 Returns the Exponent of the two LTree's.
static LTree divide (const LTree &left, const LTree &right, LinAl &la)
 Returns the quotient of the two LTree's.

Static Public Attributes

static DString op = DString("*/+-^%")


Constructor & Destructor Documentation

linal::AlPars::AlPars (  ) 


Member Function Documentation

static DString linal::AlPars::getVersion (  )  [inline, static]

DString linal::AlPars::postfixMe ( const DString &  ex  )  [static]

Returns a postfix form of the String.

Parameters:
expression String
Returns:
String

DString linal::AlPars::unPostFix ( const DString &  bean  )  [static]

Returns an infix expression from a postfix expression.

bool linal::AlPars::isOperator ( char  ch  )  [static]

Tells whether or not a character is an operator.

int linal::AlPars::precedence ( char  ch  )  [static]

Gives precedence of characters *,/,+,-,%.

Returns:
int precedence

bool linal::AlPars::calculateable ( const LTree tree  )  [static]

Determines whether or not an LTree is calcuated, i.e.

can result in a real number. This method uses a new, empty LinAl object.

Parameters:
tree LTree evaluated expression

bool linal::AlPars::calculateable ( const LTree tree,
LinAl la 
) [static]

Determines whether or not an LTree is calcuated, i.e.

can result in a real number

Parameters:
tree LTree evaluated expression
la LinAl Stores variables

double linal::AlPars::doIt ( const LTree ,
LinAl  
) [static]

static double linal::AlPars::doIt ( const LTree tree  )  [inline, static]

LTree linal::AlPars::infixLTree ( const DString &  expression,
LinAl la 
) [static]

Creates a infix LTree from a given expression.

Searches and substitutes variables from the LinAl expression

Parameters:
expression String LTree with be created from this expression
la LinAl Stores variables

utils::DArray< Object > linal::AlPars::postfixArrayList ( const DString &  expression,
LinAl la 
) [static]

Creates a postfix ArrayList of Variable's, LTree's, Characters and Doubles.

Parameters:
expression String ArrayList with be created from this expression
la LinAl Stores variables
Exceptions:
DavidEception Exception is thrown if the expression is not properly formed.

Note as of version 4, variables that point to matrix elements are treated as Variables and their values are resolved when called later. This way they are more dynamic.

static utils::DArray<Object> linal::AlPars::postfixArrayList ( const char *  expression,
LinAl la 
) [inline, static]

LTree linal::AlPars::simplify ( const LTree tree,
LinAl la 
) [static]

Simplifies algebraic expressions.

Parameters:
tree LTree expression to be simplified
la LinAl Stores variables

Matrix linal::AlPars::matrixSimplify ( const Matrix m,
LinAl la 
) [static]

LTree linal::AlPars::getMatrixElement ( DString &  ex,
LinAl la 
) throw (DavidException) [static]

LTree linal::AlPars::sum ( const LTree paramleft,
const LTree paramright,
LinAl la 
) [static]

Returns the sum of the two LTree's.

Parameters:
left LTree left part of expression
right LTree right part of expression
la LinAl Stores variables

LTree linal::AlPars::matrixAddition ( const LTree left,
const LTree right,
LinAl la 
) [static]

LTree linal::AlPars::difference ( const LTree paramleft,
const LTree paramright,
LinAl la 
) [static]

Returns the difference of the two LTree's.

Parameters:
left LTree left part of expression
right LTree right part of expression
la LinAl Stores variables

LTree linal::AlPars::multiply ( const LTree paramleft,
const LTree paramright,
LinAl la 
) [static]

Returns the products of the two LTree's.

Parameters:
left LTree left part of expression
right LTree right part of expression
la LinAl Stores variables

LTree linal::AlPars::matrixMultiply ( const LTree left,
const LTree right,
LinAl la 
) [static]

LTree linal::AlPars::exponent ( const LTree base,
const LTree exponent,
LinAl la 
) [static]

Returns the Exponent of the two LTree's.

Parameters:
base LTree base of the expression
exponent LTree exponent part of expression
la LinAl Stores variables

LTree linal::AlPars::divide ( const LTree left,
const LTree right,
LinAl la 
) [static]

Returns the quotient of the two LTree's.

Parameters:
left LTree left part of expression
right LTree right part of expression
la LinAl Stores variables


Field Documentation

DString linal::AlPars::op = DString("*/+-^%") [static]


The documentation for this class was generated from the following files:
Generated on Wed Jan 23 14:53:55 2008 by  doxygen 1.5.2