C# Class MathParserDataStructures.MathObj

Mostrar archivo Open project: FlorianRappl/YAMP

Public Methods

Method Description
Evaluate ( string mathInput, char vars, double varsValues ) : double

Evaluate the mathematical expression.

GetPolishPostfixExpression ( ) : MathParserDataStructures.Operation[]

Polish postfix expression.

GetVariables ( ) : char[]

Gets the array of variables

GetVariablesValues ( ) : double[]

Gets the array of variable's values

MathObj ( ) : System

Create new MathObj object

Protected Methods

Method Description
CalculateValue ( ) : double

Calculate the value of the polish postfix notation

GeneratePolishPostfixExpression ( ) : void

Generates polish postfix expression.

SemanticTransform ( ) : void

Perform semantic transform of the introduced expression. Check if the expression is valid and build BinaryTree needed for polish postfix expression.

Private Methods

Method Description
Acos ( Stack stack ) : void

Acos

Acot ( Stack stack ) : void

Acot

Asin ( Stack stack ) : void

Asin

Atan ( Stack stack ) : void

Atan

Cos ( Stack stack ) : void

Consine

Cot ( Stack stack ) : void

Cotangent

Csc ( Stack stack ) : void

Cosecant

End ( Stack stack ) : void

End of the input stream.

Exp ( Stack stack ) : void

Exp

ExpressionToTermW ( Stack stack ) : void

Expression to TermW (E->TW)

Factor ( Stack stack ) : void

Factor

FindValueOfSubstring ( ) : double

Finds the value of substring in the input string.

KtoYKorKtoEps ( Stack stack ) : void

K->YK or K->eps

Log ( Stack stack ) : void

Logarithm

ParanthesisClose ( Stack stack ) : void

Closing paranthesis.

PowerToFactoV ( Stack stack ) : void

Power->FactorV

Sec ( Stack stack ) : void

Secant

Sin ( Stack stack ) : void

Sine

Sqrt ( Stack stack ) : void

Sqrt

Tan ( Stack stack ) : void

Tangent

TermToPowerK ( Stack stack ) : void

Term -> PowerK

VtoZVorVtoEps ( Stack stack ) : void

V->ZV or V->eps

WtoXWorEps ( Stack stack ) : void

W->XW or W->eps

XtoMinusTermOrXtoPlusTerm ( Stack stack ) : void

X->-T or X->+T

YtoMultiplyPowerOrYtoDividePower ( Stack stack ) : void

Y->*P or Y->/P

ZtoPowerFactor ( Stack stack ) : void

Z->^Factor

Method Details

CalculateValue() protected method

Calculate the value of the polish postfix notation
protected CalculateValue ( ) : double
return double

Evaluate() public method

Evaluate the mathematical expression.
MathParserException ArgumentException
public Evaluate ( string mathInput, char vars, double varsValues ) : double
mathInput string Mathematical expression
vars char Character variables contained within the expression[x,y,z etc.]
varsValues double Coresponding values of character variables within the expression
return double

GeneratePolishPostfixExpression() protected method

Generates polish postfix expression.
protected GeneratePolishPostfixExpression ( ) : void
return void

GetPolishPostfixExpression() public method

Polish postfix expression.
public GetPolishPostfixExpression ( ) : MathParserDataStructures.Operation[]
return MathParserDataStructures.Operation[]

GetVariables() public method

Gets the array of variables
public GetVariables ( ) : char[]
return char[]

GetVariablesValues() public method

Gets the array of variable's values
public GetVariablesValues ( ) : double[]
return double[]

MathObj() public method

Create new MathObj object
public MathObj ( ) : System
return System

SemanticTransform() protected method

Perform semantic transform of the introduced expression. Check if the expression is valid and build BinaryTree needed for polish postfix expression.
MathParserException
protected SemanticTransform ( ) : void
return void