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

Problem instance. More...

#include <Problem.h>

Collaboration diagram for Problem:
Collaboration graph

Public Member Functions

 Problem ()
 Creates problem.
virtual ~Problem ()
 Destroys problem.
TermsetObjectiveFunction (Term *term)
 Sets objective function.
TermgetObjectiveFunction ()
 Get objective function.
TermaddTerm (Term *term)
 Adds term to problem.
TermVariableaddVariable (TermVariable *variable)
 Adds variable to problem.
TermPointerVector * getGradient ()
 Calculates gradient.
TermPointerVector * getHessian ()
 Gets terms of Hessian.
TermVariablePointerVector * getVariables ()
 Gets variables.
bool gradient (const DoubleVector *values, DoubleVector **gradient)
 Calculates the gradient.
bool hessian (const DoubleVector *values, DoubleVector **hessian)
 Calculates Hessian matrix.
size_t numberOfTerms ()
 Gets number of terms.
size_t numberOfVariables ()
 Gets number of variables.
bool objective (const DoubleVector *values, double *obj)
 Calculates objective.

Detailed Description

Problem instance.

Definition at line 34 of file Problem.h.

Member Function Documentation

Term * Problem::addTerm ( Term term)

Adds term to problem.

The method checks if an equivalent term already exists on the list. If so the equivalent term is returned and the term passed as argument is deleted.

Parameters
termterm to be added
Returns
equivalent term

Definition at line 60 of file Problem.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

TermVariable * Problem::addVariable ( TermVariable variable)

Adds variable to problem.

The method checks if an equivalent variable already exists on the list. If so the equivalent variable is returned and the variable passed as argument is deleted. The argument is set to the equivalent variable.

Parameters
variablevariable to be added
Returns
equivalent variable

Definition at line 85 of file Problem.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

TermPointerVector * Problem::getGradient ( )

Calculates gradient.

Parameters
valuesvalues of variables
gradientgradient
Returns
success Gets terms of gradient.
gradient

Definition at line 138 of file Problem.cc.

TermPointerVector * Problem::getHessian ( )

Gets terms of Hessian.

Returns
Hessian

Definition at line 149 of file Problem.cc.

Term * Problem::getObjectiveFunction ( )

Get objective function.

Returns
objective function.

Definition at line 123 of file Problem.cc.

TermVariablePointerVector * Problem::getVariables ( )

Gets variables.

Returns
variables

Definition at line 160 of file Problem.cc.

bool Problem::gradient ( const DoubleVector *  values,
DoubleVector **  gradient 
)

Calculates the gradient.

Caller is responsible for deleting gradient.

Parameters
valuesvalues of variables
gradientgradient
Returns
success

Definition at line 174 of file Problem.cc.

bool Problem::hessian ( const DoubleVector *  values,
DoubleVector **  hessian 
)

Calculates Hessian matrix.

Caller is responsible for deleting Hessian.

Parameters
valuesvalues of variables
hessian
Returns
success

Definition at line 197 of file Problem.cc.

size_t Problem::numberOfTerms ( )

Gets number of terms.

Returns
number of terms

Definition at line 217 of file Problem.cc.

size_t Problem::numberOfVariables ( )

Gets number of variables.

Returns
number of variables

Definition at line 225 of file Problem.cc.

bool Problem::objective ( const DoubleVector *  values,
double *  obj 
)

Calculates objective.

Parameters
values
obj
Returns

Definition at line 235 of file Problem.cc.

Here is the call graph for this function:

Term * Problem::setObjectiveFunction ( Term term)

Sets objective function.

Parameters
termobjective function
Returns
objective function

Definition at line 100 of file Problem.cc.

Here is the call graph for this function:


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