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

Sum of two terms. More...

#include <TermSum.h>

Inheritance diagram for TermSum:
Inheritance graph
Collaboration diagram for TermSum:
Collaboration graph

Public Member Functions

Termdifferentiate (TermVariable *variable) throw (ProblemMismatchException)
 Determines the partial derivative of the term.
bool less (const Term *term) const
 Compares this term to an other term.
std::string toString () const
 Convert term to string.

Static Public Member Functions

static Termcreate (Problem *problem, Term *summand1, Term *summand2)
 Creates sum.

Protected Member Functions

double eval (const DoubleVector *variableValues, TermValueSet *termValues)
 Evaluates term.
 TermSum (Problem *problem, Term *summand1, Term *summand2)
 Creates sum.
virtual ~TermSum ()
 Destroys sum.
- Protected Member Functions inherited from TermBinary
 TermBinary (Problem *problem)
 Creates a binary term.
virtual ~TermBinary ()
 Destroys a binary term.
- Protected Member Functions inherited from Term
void setTermIndex (const int termIndex)
 Set term index.
 Term (Problem *problem)
 Creates a term.
virtual ~Term ()
 Destroys a term.

Additional Inherited Members

- Static Public Attributes inherited from Term
static const int INVALID_INDEX = -1

Detailed Description

Sum of two terms.

Definition at line 27 of file TermSum.h.

Constructor & Destructor Documentation

TermSum::TermSum ( Problem problem,
Term summand1,
Term summand2 
)
protected

Creates sum.

Parameters
problemproblem to which the term belongs
summand1first summand
summand2second summand

Definition at line 32 of file TermSum.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Function Documentation

Term * TermSum::create ( Problem problem,
Term summand1,
Term summand2 
)
static

Creates sum.

Parameters
problemproblem to which the term belongs
summand1first summand
summand2second summand
Returns
sum

Definition at line 57 of file TermSum.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

Term * TermSum::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 from Term.

Definition at line 81 of file TermSum.cc.

Here is the call graph for this function:

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

Evaluates term.

Parameters
variableValuesvalues of the variables
termValuesvalues of the terms
Returns

Reimplemented from Term.

Definition at line 93 of file TermSum.cc.

Here is the call graph for this function:

bool TermSum::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 from Term.

Definition at line 99 of file TermSum.cc.

Here is the call graph for this function:

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

Convert term to string.

Returns
string

Reimplemented from Term.

Definition at line 119 of file TermSum.cc.


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