Camargue
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
CMR::Sep::HyperGraph Class Reference

External representation of a cut added to the lp relaxation. More...

#include <hypergraph.hpp>

Collaboration diagram for CMR::Sep::HyperGraph:
Collaboration graph
[legend]

Public Types

enum  Type {
  Domino = 0, Subtour = 1, Comb = 2, Non = 3,
  Branch = 3
}
 Enumeration for the types of HyperGraph inequalities. More...
 

Public Member Functions

 HyperGraph ()
 Default construct an empty Type::Non HyperGraph cut.
 
 HyperGraph (CliqueBank &bank, const CCtsp_lpcut_in &cc_lpcut, const std::vector< int > &tour)
 Construct a HyperGraph from a Concorde cut.
 
 HyperGraph (CliqueBank &bank, ToothBank &tbank, const dominoparity &dp_cut, double _rhs, const std::vector< int > &tour)
 Construct a HyperGraph from a simple tooth inequality. More...
 
 HyperGraph (CliqueBank &bank, const std::vector< int > &blossom_handle, const std::vector< std::vector< int >> &tooth_edges)
 Construct a HyperGraph from ex_blossom handle/tooth indices.
 
 HyperGraph (HyperGraph &&H) noexcept
 The moved-from Hypergraph H is left in a null but valid state, as if it had been default constructed.
 
HyperGraphoperator= (HyperGraph &&H) noexcept
 The move-assigned-from HyperGraph H is left null but valid as if default constructed.
 
void transfer_source (CliqueBank &new_source_bank)
 Change the source_bank to new_source_bank. More...
 
CCtsp_lpcut_in to_lpcut_in (const std::vector< int > &active_perm, bool with_skeleton) const
 Turn this cut into a CCtsp_lpcut_in. More...
 
 ~HyperGraph ()
 Destruct and decrement/delete Clique/Tooth refs.
 
Type cut_type () const
 
int tour_age () const
 
int piv_age () const
 
bool fresh_cut () const
 
double get_coeff (int end0, int end1) const
 Get the coefficient of an edge specified by endpoints.
 
template<typename EndPt_type >
void get_coeffs (const std::vector< EndPt_type > &edges, std::vector< int > &rmatind, std::vector< double > &rmatval) const
 Get sparse coefficient row for a list of endpoints. More...
 
char get_sense () const
 
double get_rhs () const
 
const std::vector< Clique::Ptr > & get_cliques () const
 
const std::vector< Tooth::Ptr > & get_teeth () const
 

Private Attributes

char sense
 The inequality sense of the cut.
 
double rhs
 The righthand-side of the cut.
 
std::vector< Clique::Ptrcliques
 The cliques comprising the cut.
 
std::vector< Tooth::Ptrteeth
 The teeth comprising the cut.
 
CliqueBanksource_bank
 The CliqueBank for dereferencing the cliques.
 
ToothBanksource_toothbank
 The ToothBank for the teeth.
 
int t_age
 
int p_age
 

Friends

class ExternalCuts
 

Detailed Description

External representation of a cut added to the lp relaxation.

Member Enumeration Documentation

Enumeration for the types of HyperGraph inequalities.

Enumerator
Domino 

A domino parity inequality.

Subtour 

An SEC.

Comb 

A comb-like constraint.

Non 

Non HyperGraph cut: Gomory cut or branching constraint.

Branch 

A constraint to enforce branching.

Constructor & Destructor Documentation

CMR::Sep::HyperGraph::HyperGraph ( CliqueBank bank,
ToothBank tbank,
const dominoparity dp_cut,
double  _rhs,
const std::vector< int > &  tour 
)

Construct a HyperGraph from a simple tooth inequality.

The cut corresponding to dp_cut will be represented using Clique pointers from bank and Tooth pointers from tbank, assuming the cut was found with tour as the resident best tour.

The righthand side of the cut stored shall be _rhs.

Member Function Documentation

template<typename EndPt_type >
void CMR::Sep::HyperGraph::get_coeffs ( const std::vector< EndPt_type > &  edges,
std::vector< int > &  rmatind,
std::vector< double > &  rmatval 
) const

Get sparse coefficient row for a list of endpoints.

Template Parameters
EndPt_typea structure derived from EndPts that stores an edge e as a length-two array accessed as e.end[0] and e.end[1]
Parameters
[in]edgesthe list of edges for which to generate coefficients.
[in,out]rmatindthe indices of edges with nonzero coefficients.
[in,out]rmatvalthe coefficients corresponding to entries of rmatind.
CCtsp_lpcut_in CMR::Sep::HyperGraph::to_lpcut_in ( const std::vector< int > &  active_perm,
bool  with_skeleton 
) const

Turn this cut into a CCtsp_lpcut_in.

Parameters
active_permthe permutation vector for the active best tour.
with_skeletontrue iff a skeleton should be constructed for the cut as well.
Returns
a CCtsp_lpcut_in representation of this HyperGraph cut.
void CMR::Sep::HyperGraph::transfer_source ( CliqueBank new_source_bank)

Change the source_bank to new_source_bank.

Ownership of the cliques in this HyperGraph is transferred to new_source_bank, and new_source_bank becomes source_bank.


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