Cut< CutType > Class Template Reference

Represents a Cut in the CutPool. More...

#include <cuts.h>

Collaboration diagram for Cut< CutType >:
Collaboration graph
[legend]

List of all members.

Classes

class  NodeInfo

Public Member Functions

 Cut (Pointer< CutType > cut_, Pointer< MinlpNode > node=NULL)
 Cut (const Cut< CutType > &cut_)
virtual ~Cut ()
bool valid (const Pointer< MinlpNode > &node=NULL) const
void add_node (Pointer< MinlpNode > node)
void duplicate_nodeinfo (Pointer< MinlpNode > oldnode, Pointer< MinlpNode > newnode)
 Duplicates a CutNodeInfo and uses it for a new node.
bool remove_node (Pointer< MinlpNode > node)
 Removed a node from the nodes-list, if it exists there.
pair< bool, bool > set_inactivetime (Pointer< MinlpNode > node, bool increase, int limit)
 Increases or resets the inactivity time for a node or global.
const CutType & get_cut () const

Private Attributes

Pointer< CutType > cut
 The cut.
map< Pointer< MinlpNode >
, NodeInfo
nodes
 The nodes, which use this cut.
bool global
 Indicates, whether this is a global cut (valid for all nodes).
int inactive_time_global
 If global, the time, this cut was inactive now.
bool tagged
 Used to distinguish between cuts, which were added recently, and cuts, which existed "from the beginning".

Friends

class CutPool

Detailed Description

template<class CutType>
class Cut< CutType >

Represents a Cut in the CutPool.

Definition at line 144 of file cuts.h.


Constructor & Destructor Documentation

template<class CutType>
Cut< CutType >::Cut ( Pointer< CutType >  cut_,
Pointer< MinlpNode node = NULL 
) [inline]

Definition at line 184 of file cuts.h.

template<class CutType>
Cut< CutType >::Cut ( const Cut< CutType > &  cut_  )  [inline]

Definition at line 190 of file cuts.h.

template<class CutType>
virtual Cut< CutType >::~Cut (  )  [virtual]

Member Function Documentation

template<class CutType>
bool Cut< CutType >::valid ( const Pointer< MinlpNode > &  node = NULL  )  const [inline]

Definition at line 196 of file cuts.h.

template<class CutType>
void Cut< CutType >::add_node ( Pointer< MinlpNode node  )  [inline]

Definition at line 200 of file cuts.h.

template<class CutType>
void Cut< CutType >::duplicate_nodeinfo ( Pointer< MinlpNode oldnode,
Pointer< MinlpNode newnode 
)

Duplicates a CutNodeInfo and uses it for a new node.

Needed, when a node is splitted into new nodes.

template<class CutType>
bool Cut< CutType >::remove_node ( Pointer< MinlpNode node  ) 

Removed a node from the nodes-list, if it exists there.

Returns:
True, if the cut was local and this was the last node, which used this cut. False, else.
template<class CutType>
pair<bool, bool> Cut< CutType >::set_inactivetime ( Pointer< MinlpNode node,
bool  increase,
int  limit 
)

Increases or resets the inactivity time for a node or global.

If this time exceeds a limit, the node is removed from the nodes set. For a global cut, the value of node is nonrelevant.

Parameters:
increase Whether to increase the inactive timer or to set it to 0.
limit The limit for inactivity.
Returns:
If the cut isn't used by any node anymore or was global and the time limit is exceeded, the first return value is true. False otherwise. If the cut is invalid for the node now, true is returned in second return value. False otherwise.
template<class CutType>
const CutType& Cut< CutType >::get_cut (  )  const [inline]

Definition at line 223 of file cuts.h.


Friends And Related Function Documentation

template<class CutType>
friend class CutPool [friend]

Definition at line 145 of file cuts.h.


Member Data Documentation

template<class CutType>
Pointer<CutType> Cut< CutType >::cut [private]

The cut.

Definition at line 166 of file cuts.h.

template<class CutType>
map<Pointer<MinlpNode>, NodeInfo> Cut< CutType >::nodes [private]

The nodes, which use this cut.

Definition at line 170 of file cuts.h.

template<class CutType>
bool Cut< CutType >::global [private]

Indicates, whether this is a global cut (valid for all nodes).

Definition at line 174 of file cuts.h.

template<class CutType>
int Cut< CutType >::inactive_time_global [private]

If global, the time, this cut was inactive now.

Definition at line 177 of file cuts.h.

template<class CutType>
bool Cut< CutType >::tagged [private]

Used to distinguish between cuts, which were added recently, and cuts, which existed "from the beginning".

Definition at line 181 of file cuts.h.


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

Generated on 10 Mar 2013 for LaGO by  doxygen 1.6.1