Generated on Sat Feb 7 2015 02:01:45 for Gecode by doxygen 1.8.9.1
Gecode::Int::TaskTree< TaskView, Node > Class Template Reference

Task trees for task views with node type Node. More...

#include <task.hh>

Protected Member Functions

int n_inner (void) const
 Return number of inner nodes. More...
 
int n_nodes (void) const
 Return number of nodes for balanced binary tree. More...
 
bool n_leaf (int i) const
 Whether node i is leaf. More...
 
Node & leaf (int i)
 Return leaf for task i. More...
 
const Node & root (void) const
 Return root node. More...
 
void update (int i, bool l=true)
 Update tree after leaf for task i has changed (l whether i refers to a leaf) More...
 
void init (void)
 Initialize tree after leaves have been initialized. More...
 
void update (void)
 Update all inner nodes of tree after leaves have been initialized. More...
 
 TaskTree (Region &r, const TaskViewArray< TaskView > &t)
 Initialize tree for tasks t. More...
 
template<class Node2 >
 TaskTree (Region &r, const TaskTree< TaskView, Node2 > &t)
 Initialize tree using tree t. More...
 

Static Protected Member Functions

static bool n_root (int i)
 Whether node i is index of root. More...
 
static int n_left (int i)
 Return index of left child of node i. More...
 
static bool left (int i)
 Test whether node i is a left child. More...
 
static int n_right (int i)
 Return index of right child of node i. More...
 
static bool right (int i)
 Test whether node i is a right child. More...
 
static int n_parent (int i)
 Return index of parent of node i. More...
 

Protected Attributes

const TaskViewArray< TaskView > & tasks
 The tasks from which the tree is computed. More...
 
Node * node
 Task nodes. More...
 
int * _leaf
 Map task number to leaf node number in right order. More...
 

Detailed Description

template<class TaskView, class Node>
class Gecode::Int::TaskTree< TaskView, Node >

Task trees for task views with node type Node.

Definition at line 365 of file task.hh.

Constructor & Destructor Documentation

template<class TaskView, class Node >
Gecode::Int::TaskTree< TaskView, Node >::TaskTree ( Region r,
const TaskViewArray< TaskView > &  t 
)
inlineprotected

Initialize tree for tasks t.

Definition at line 145 of file tree.hpp.

template<class TaskView, class Node >
template<class Node2 >
Gecode::Int::TaskTree< TaskView, Node >::TaskTree ( Region r,
const TaskTree< TaskView, Node2 > &  t 
)
inlineprotected

Initialize tree using tree t.

Definition at line 172 of file tree.hpp.

Member Function Documentation

template<class TaskView , class Node >
int Gecode::Int::TaskTree< TaskView, Node >::n_inner ( void  ) const
inlineprotected

Return number of inner nodes.

Definition at line 56 of file tree.hpp.

template<class TaskView , class Node >
int Gecode::Int::TaskTree< TaskView, Node >::n_nodes ( void  ) const
inlineprotected

Return number of nodes for balanced binary tree.

Definition at line 61 of file tree.hpp.

template<class TaskView , class Node >
bool Gecode::Int::TaskTree< TaskView, Node >::n_root ( int  i)
inlinestaticprotected

Whether node i is index of root.

Definition at line 67 of file tree.hpp.

template<class TaskView , class Node >
bool Gecode::Int::TaskTree< TaskView, Node >::n_leaf ( int  i) const
inlineprotected

Whether node i is leaf.

Definition at line 72 of file tree.hpp.

template<class TaskView , class Node >
int Gecode::Int::TaskTree< TaskView, Node >::n_left ( int  i)
inlinestaticprotected

Return index of left child of node i.

Definition at line 77 of file tree.hpp.

template<class TaskView , class Node >
bool Gecode::Int::TaskTree< TaskView, Node >::left ( int  i)
inlinestaticprotected

Test whether node i is a left child.

Definition at line 82 of file tree.hpp.

template<class TaskView , class Node >
int Gecode::Int::TaskTree< TaskView, Node >::n_right ( int  i)
inlinestaticprotected

Return index of right child of node i.

Definition at line 89 of file tree.hpp.

template<class TaskView , class Node >
bool Gecode::Int::TaskTree< TaskView, Node >::right ( int  i)
inlinestaticprotected

Test whether node i is a right child.

Definition at line 94 of file tree.hpp.

template<class TaskView , class Node >
int Gecode::Int::TaskTree< TaskView, Node >::n_parent ( int  i)
inlinestaticprotected

Return index of parent of node i.

Definition at line 101 of file tree.hpp.

template<class TaskView , class Node >
Node & Gecode::Int::TaskTree< TaskView, Node >::leaf ( int  i)
inlineprotected

Return leaf for task i.

Definition at line 107 of file tree.hpp.

template<class TaskView , class Node >
const Node & Gecode::Int::TaskTree< TaskView, Node >::root ( void  ) const
inlineprotected

Return root node.

Definition at line 113 of file tree.hpp.

template<class TaskView , class Node >
void Gecode::Int::TaskTree< TaskView, Node >::update ( int  i,
bool  l = true 
)
inlineprotected

Update tree after leaf for task i has changed (l whether i refers to a leaf)

Definition at line 133 of file tree.hpp.

template<class TaskView , class Node >
void Gecode::Int::TaskTree< TaskView, Node >::init ( void  )
inlineprotected

Initialize tree after leaves have been initialized.

Definition at line 119 of file tree.hpp.

template<class TaskView , class Node >
void Gecode::Int::TaskTree< TaskView, Node >::update ( void  )
inlineprotected

Update all inner nodes of tree after leaves have been initialized.

Definition at line 126 of file tree.hpp.

Member Data Documentation

template<class TaskView, class Node>
const TaskViewArray<TaskView>& Gecode::Int::TaskTree< TaskView, Node >::tasks
protected

The tasks from which the tree is computed.

Definition at line 369 of file task.hh.

template<class TaskView, class Node>
Node* Gecode::Int::TaskTree< TaskView, Node >::node
protected

Task nodes.

Definition at line 371 of file task.hh.

template<class TaskView, class Node>
int* Gecode::Int::TaskTree< TaskView, Node >::_leaf
protected

Map task number to leaf node number in right order.

Definition at line 373 of file task.hh.


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