TVM  0.9.4
tvm::scheme::internal::ProblemComputationData Class Referenceabstract

#include <tvm/scheme/internal/ProblemComputationData.h>

Inheritance diagram for tvm::scheme::internal::ProblemComputationData:
Collaboration diagram for tvm::scheme::internal::ProblemComputationData:

Classes

class  EventQueue
 

Public Member Functions

virtual ~ProblemComputationData ()=default
 
int solverId () const
 
bool addVariable (VariablePtr var)
 
void addVariable (const VariableVector &vars)
 
bool removeVariable (Variable *v)
 
void removeVariable (const VariableVector &vars)
 
const VariableVectorvariables () const
 
void setVariablesToSolution ()
 
void addEvent (const ProblemDefinitionEvent &e)
 
ProblemDefinitionEvent popEvent ()
 
bool hasEvents () const
 
const EventQueue::container_type & events () const
 
void clearEvents ()
 
void clearVariables ()
 

Protected Member Functions

 ProblemComputationData (int solverId)
 
 ProblemComputationData ()=delete
 
virtual void setVariablesToSolution_ (tvm::internal::VariableCountingVector &x)=0
 

Protected Attributes

tvm::internal::VariableCountingVector variables_
 
EventQueue events_
 

Detailed Description

Base class to be derived by each resolution scheme to hold all of the temporary memories and states related to the resolution of a problem. The rationale is that a resolution scheme is stateless, and when given for the first time a problem to solve, creates a ProblemComputationData that it gives to the problem and retrieves at each further resolution. A problem computation data further act as a queue of events changing the problem definition.

Constructor & Destructor Documentation

◆ ~ProblemComputationData()

virtual tvm::scheme::internal::ProblemComputationData::~ProblemComputationData ( )
virtualdefault

◆ ProblemComputationData() [1/2]

tvm::scheme::internal::ProblemComputationData::ProblemComputationData ( int  solverId)
inlineprotected

◆ ProblemComputationData() [2/2]

tvm::scheme::internal::ProblemComputationData::ProblemComputationData ( )
protecteddelete

Member Function Documentation

◆ addEvent()

void tvm::scheme::internal::ProblemComputationData::addEvent ( const ProblemDefinitionEvent e)
inline

Adding an event changing the problem definition, that needs to be handled by the resolution scheme. Events are stored in a queue (FIFO).

◆ addVariable() [1/2]

void tvm::scheme::internal::ProblemComputationData::addVariable ( const VariableVector vars)
inline

Add a set of variables, calling addVariable(VariablePtr var) on each variable.

◆ addVariable() [2/2]

bool tvm::scheme::internal::ProblemComputationData::addVariable ( VariablePtr  var)
inline

Add a variable if not already present. Return true if the variable was effectively added. The class counts how many time a variable was added.

◆ clearEvents()

void tvm::scheme::internal::ProblemComputationData::clearEvents ( )
inline

Clear the list of events.

◆ clearVariables()

void tvm::scheme::internal::ProblemComputationData::clearVariables ( )
inline

Clear the variable vector.

◆ events()

const ProblemComputationData::EventQueue::container_type & tvm::scheme::internal::ProblemComputationData::events ( ) const
inline

List of events.

◆ hasEvents()

bool tvm::scheme::internal::ProblemComputationData::hasEvents ( ) const
inline

Is the queue not empty?

◆ popEvent()

ProblemDefinitionEvent tvm::scheme::internal::ProblemComputationData::popEvent ( )
inline

Read and remove the first event in the queue. Need the queue to be non-empty.

◆ removeVariable() [1/2]

void tvm::scheme::internal::ProblemComputationData::removeVariable ( const VariableVector vars)
inline

Remove a set of variables, calling removeVariable(Variable* v) on each variable.

◆ removeVariable() [2/2]

bool tvm::scheme::internal::ProblemComputationData::removeVariable ( Variable v)
inline

Effectively remove a variable if as many calls were made to this method as to addVariable, for the given variable. Return true if the variable was really removed.

◆ setVariablesToSolution()

void tvm::scheme::internal::ProblemComputationData::setVariablesToSolution ( )
inline

Set the value of the variables to that of the solution.

◆ setVariablesToSolution_()

virtual void tvm::scheme::internal::ProblemComputationData::setVariablesToSolution_ ( tvm::internal::VariableCountingVector x)
protectedpure virtual

Need to put in x the solution of the computation.

◆ solverId()

int tvm::scheme::internal::ProblemComputationData::solverId ( ) const
inline

◆ variables()

const VariableVector & tvm::scheme::internal::ProblemComputationData::variables ( ) const
inline

Get the variables of the problem.

Member Data Documentation

◆ events_

EventQueue tvm::scheme::internal::ProblemComputationData::events_
protected

Problem definition events

◆ variables_

tvm::internal::VariableCountingVector tvm::scheme::internal::ProblemComputationData::variables_
protected

The problem variable


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