Crevice  0.1
 All Classes Functions Variables Pages
Public Member Functions | Static Public Attributes | Protected Member Functions | Friends | List of all members
Term Class Reference

Mathematical expression. More...

#include <Term.h>

Inheritance diagram for Term:
Inheritance graph
Collaboration diagram for Term:
Collaboration graph

Public Member Functions

virtual Termdifferentiate (TermVariable *variable) throw (ProblemMismatchException)
 Determines the partial derivative of the term.
double evaluate (const DoubleVector *variableValues)
 Evaluates term.
double evaluate (const DoubleVector *variableValues, TermValueSet *termValues)
 Evaluates term.
virtual ProblemgetProblem () const
 Returns the problem to which the term belongs.
const int getTermIndex ()
 Get term index.
virtual bool less (const Term *term) const
 Compares this term to an other term.
virtual std::string toString () const
 Convert term to string.

Static Public Attributes

static const int INVALID_INDEX = -1

Protected Member Functions

virtual double eval (const DoubleVector *variableValues, TermValueSet *termValues)
 Evaluates term.
void setTermIndex (const int termIndex)
 Set term index.
 Term (Problem *problem)
 Creates a term.
virtual ~Term ()
 Destroys a term.

Friends

class Problem

Detailed Description

Mathematical expression.

Definition at line 42 of file Term.h.

Constructor & Destructor Documentation

Term::Term ( Problem problem)
protected

Creates a term.

Parameters
problemproblem to which the term is added

Definition at line 30 of file Term.cc.

Member Function Documentation

Term * Term::differentiate ( TermVariable variable) throw (ProblemMismatchException)
virtual

Determines the partial derivative of the term.

Parameters
variablevariable with respect to which the derivative shall be calculated
Returns
partial derivative

Reimplemented in TermVariable, TermAbs, TermConstant, TermProduct, TermSign, and TermSum.

Definition at line 47 of file Term.cc.

Here is the caller graph for this function:

double Term::eval ( const DoubleVector *  variableValues,
TermValueSet *  termValues 
)
protectedvirtual

Evaluates term.

Parameters
variableValuesvalues of the variables
termValuesvalues of the terms
Returns

Reimplemented in TermVariable, TermAbs, TermConstant, TermSign, TermProduct, and TermSum.

Definition at line 93 of file Term.cc.

Here is the caller graph for this function:

double Term::evaluate ( const DoubleVector *  variableValues)

Evaluates term.

Parameters
variableValuesvalues of the variables
Returns
value of the term

Definition at line 57 of file Term.cc.

Here is the caller graph for this function:

double Term::evaluate ( const DoubleVector *  variableValues,
TermValueSet *  termValues 
)

Evaluates term.

Parameters
variableValuesvalues of the variables
termValuesvalues of the terms
Returns

Definition at line 72 of file Term.cc.

Here is the call graph for this function:

Problem * Term::getProblem ( ) const
virtual

Returns the problem to which the term belongs.

Returns
problem

Definition at line 103 of file Term.cc.

const int Term::getTermIndex ( )

Get term index.

Returns
term index

Definition at line 120 of file Term.cc.

bool Term::less ( const Term term) const
virtual

Compares this term to an other term.

Parameters
termterm to compare this term with
Returns
true if this term is before the other term

Reimplemented in TermVariable, TermAbs, TermConstant, TermSign, TermProduct, and TermSum.

Definition at line 112 of file Term.cc.

Here is the caller graph for this function:

void Term::setTermIndex ( const int  termIndex)
protected

Set term index.

Parameters
termIndexterm index

Definition at line 128 of file Term.cc.

Here is the caller graph for this function:

std::string Term::toString ( ) const
virtual

Convert term to string.

Returns
string

Reimplemented in TermVariable, TermAbs, TermConstant, TermSign, TermProduct, and TermSum.

Definition at line 136 of file Term.cc.

Here is the caller graph for this function:


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