Infrared
Loading...
Searching...
No Matches
infrared.infrared.ClusterTreeBase Class Reference

Cluster tree base class. More...

Inheritance diagram for infrared.infrared.ClusterTreeBase:

Public Member Functions

 __init__ (self, model, td, EvaluationAlgebra)
 
 evaluate (self)
 
 is_consistent (self)
 
 construct_cluster_tree (self, domains, td)
 Construct the cluster tree object of the C++ engine.
 
 get_bag_assignments (self)
 Get assignments of functions and constraints to the bags.
 
 find_all_bags (self, bvars)
 Get the indices of all bags that contain a set of variables.
 
 find_bag (self, bvars)
 Find a bag that contains a set of variables.
 
 assign_to_bags (self, constraints)
 assign constraints or functions to bags
 
 assign_to_all_bags (self, constraints)
 assign constraints or functions to all possible bags
 

Protected Attributes

 _model
 
 _td
 
 _EA
 
 _bagsets
 

Detailed Description

Cluster tree base class.

This class provides functionality to construct and populate C++ cluster trees with constraints and functions.

It is used as base of the specialized cluster tree classes, which wrap interface the C++/libinfrared cluster tree classes.

Constructor & Destructor Documentation

◆ __init__()

infrared.infrared.ClusterTreeBase.__init__ (   self,
  model,
  td,
  EvaluationAlgebra 
)

Member Function Documentation

◆ assign_to_all_bags()

infrared.infrared.ClusterTreeBase.assign_to_all_bags (   self,
  constraints 
)

assign constraints or functions to all possible bags

   Assigns constraint/function is to each bags that contains its
   dependencies.
Parameters
constraintslist of constraints
Returns
list where constraints are placed at corresponding bag indices

◆ assign_to_bags()

infrared.infrared.ClusterTreeBase.assign_to_bags (   self,
  constraints 
)

assign constraints or functions to bags

   Assigns such that each constraint/function is assigned to exactly one bag
   that contains its dependencies
Parameters
constraintslist of constraints
Returns
list where constraints are placed at corresponding bag indices
Precondition
for each constraint/function there is one bag that contains its dependencies; otherwise the constraint/function is not assigned

◆ construct_cluster_tree()

infrared.infrared.ClusterTreeBase.construct_cluster_tree (   self,
  domains,
  td 
)

Construct the cluster tree object of the C++ engine.

Parameters
domainsdescription of the domains
tdtree decomposition

◆ evaluate()

infrared.infrared.ClusterTreeBase.evaluate (   self)

◆ find_all_bags()

infrared.infrared.ClusterTreeBase.find_all_bags (   self,
  bvars 
)

Get the indices of all bags that contain a set of variables.

Parameters
bvarsthe set of variables
Returns
list of indices of the bags that contain bvars

◆ find_bag()

infrared.infrared.ClusterTreeBase.find_bag (   self,
  bvars 
)

Find a bag that contains a set of variables.

Parameters
bvarsthe set of variables
Returns
index of first bag that contains bvars (or None if there is none)

◆ get_bag_assignments()

infrared.infrared.ClusterTreeBase.get_bag_assignments (   self)

Get assignments of functions and constraints to the bags.

   straightforward non-redundant assignment of constraints and functions,
   each to some bag that contains all of their variables

   assumes constraints and functions specified in self._model

◆ is_consistent()

infrared.infrared.ClusterTreeBase.is_consistent (   self)
Returns
whether the cluster tree is consistent

Member Data Documentation

◆ _bagsets

infrared.infrared.ClusterTreeBase._bagsets
protected

◆ _EA

infrared.infrared.ClusterTreeBase._EA
protected

◆ _model

infrared.infrared.ClusterTreeBase._model
protected

◆ _td

infrared.infrared.ClusterTreeBase._td
protected

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