Infrared
Loading...
Searching...
No Matches
ired::Cluster< FunValue > Class Template Reference

Cluster (or bag) in the cluster tree. More...

#include <cluster.hpp>

Public Types

using var_idx_t = int
 
using function_t = Function< FunValue >
 
using constraint_t = Constraint
 
using assignment_t = Assignment
 

Public Member Functions

 Cluster ()
 empty constructor
 
 Cluster (const std::vector< var_idx_t > &vars)
 constructor with variables
 
 ~Cluster ()
 
const std::vector< var_idx_t > & vars () const
 Get variables.
 
bool empty () const
 Check whether cluster is empty.
 
const auto & constraints () const
 Get constraints.
 
const auto & functions () const
 Get functions.
 
void add_constraint (const constraint_t *c)
 Assign constraint to this cluster.
 
void add_function (const function_t *f)
 Assign function to this cluster.
 
auto sep_vars (const Cluster &parent) const
 Calculate separator variables.
 
auto diff_vars (const Cluster &parent) const
 Calculate difference variables.
 

Detailed Description

template<class FunValue = double>
class ired::Cluster< FunValue >

Cluster (or bag) in the cluster tree.

A cluster consists of collections

  • variables
  • constraints
  • functions

Implicitly, a cluster belongs to a cluster tree and, thus, a constraint network CN. Variables are stored/identified by their unique indices in the CN.

Member Typedef Documentation

◆ assignment_t

template<class FunValue = double>
using ired::Cluster< FunValue >::assignment_t = Assignment

◆ constraint_t

template<class FunValue = double>
using ired::Cluster< FunValue >::constraint_t = Constraint

◆ function_t

template<class FunValue = double>
using ired::Cluster< FunValue >::function_t = Function<FunValue>

◆ var_idx_t

template<class FunValue = double>
using ired::Cluster< FunValue >::var_idx_t = int

Constructor & Destructor Documentation

◆ Cluster() [1/2]

template<class FunValue = double>
ired::Cluster< FunValue >::Cluster ( )
inline

empty constructor

◆ Cluster() [2/2]

template<class FunValue = double>
ired::Cluster< FunValue >::Cluster ( const std::vector< var_idx_t > &  vars)
inlineexplicit

constructor with variables

Parameters
varsvector of indices of variables in the cluster

◆ ~Cluster()

template<class FunValue = double>
ired::Cluster< FunValue >::~Cluster ( )
inline

Member Function Documentation

◆ add_constraint()

template<class FunValue = double>
void ired::Cluster< FunValue >::add_constraint ( const constraint_t c)
inline

Assign constraint to this cluster.

◆ add_function()

template<class FunValue = double>
void ired::Cluster< FunValue >::add_function ( const function_t f)
inline

Assign function to this cluster.

◆ constraints()

template<class FunValue = double>
const auto & ired::Cluster< FunValue >::constraints ( ) const
inline

Get constraints.

Returns
vector of constraints assigned to the cluster

◆ diff_vars()

template<class FunValue = double>
auto ired::Cluster< FunValue >::diff_vars ( const Cluster< FunValue > &  parent) const
inline

Calculate difference variables.

Parameters
parentparent cluster of this object
Returns
vector of the indices of the difference variables

The difference variables are the variables of this object that are not already present in the parent.

◆ empty()

template<class FunValue = double>
bool ired::Cluster< FunValue >::empty ( ) const
inline

Check whether cluster is empty.

◆ functions()

template<class FunValue = double>
const auto & ired::Cluster< FunValue >::functions ( ) const
inline

Get functions.

Returns
vector of functions assigned to the cluster

◆ sep_vars()

template<class FunValue = double>
auto ired::Cluster< FunValue >::sep_vars ( const Cluster< FunValue > &  parent) const
inline

Calculate separator variables.

Parameters
parentparent cluster of this object
Returns
vector of the indices of the separator variables

The separator variables are the variables of this object that are already present in the parent. In other terms, the cut set of the variables of this and the parent cluster

◆ vars()

template<class FunValue = double>
const std::vector< var_idx_t > & ired::Cluster< FunValue >::vars ( ) const
inline

Get variables.

Returns
vector of indices of the variable in the cluster

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