Program Listing for File Reductions.h

↰ Return to documentation for file (ADS/complexity/Reductions.h)

/*--------------------------------------------------------------------------*/
/*--------------------------- File Reductions.h ----------------------------*/
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
/*----------------------------- DEFINITIONS --------------------------------*/
/*--------------------------------------------------------------------------*/

#ifndef __ADS_Reductions
 #define __ADS_Reductions
                      /* self-identification: #endif constant */

/*--------------------------------------------------------------------------*/
/*------------------------------ INCLUDES ----------------------------------*/
/*--------------------------------------------------------------------------*/

#include "ADS/Contract.h"
#include "ADS/complexity/Domino.h"
#include "ADS/complexity/Problems.h"
#include "ADS/geometry/ConvexHull.h"

#include <array>
#include <cstddef>
#include <limits>
#include <numeric>
#include <tuple>
#include <utility>
#include <vector>

/*--------------------------------------------------------------------------*/
/*--------------------------- NAMESPACE ------------------------------------*/
/*--------------------------------------------------------------------------*/

namespace ADS {

inline int tileVar( int h , int i , int j , int n );

inline std::pair< Adjacency , int > dominoToClique(
                                   const std::vector< Tile > & D , int n );

inline Cnf dominoToSat( const std::vector< Tile > & D , int n );

inline std::pair< std::vector< std::vector< long > > , std::vector< long > >
dominoToLp01( const std::vector< Tile > & D , int n );

inline Adjacency complement( const Adjacency & G );

inline std::vector< std::vector< long > > hamiltonToTsp( const Adjacency & G );

inline long halfSum( const std::vector< long > & A );

inline Adjacency cycleToPath( const Adjacency & G );

inline Adjacency cycleToChain( const Adjacency & G );

inline std::vector< Point > sortToHull( const std::vector< long > & a );

/*--------------------------------------------------------------------------*/

}  // end( namespace ADS )

/*--------------------------------------------------------------------------*/
/*-------------------------- IMPLEMENTATION --------------------------------*/
/*--------------------------------------------------------------------------*/

#include "ADS/complexity/impl/Reductions.tpp"

/*--------------------------------------------------------------------------*/

#endif  /* Reductions.h included */

/*--------------------------------------------------------------------------*/
/*------------------------- End File Reductions.h --------------------------*/
/*--------------------------------------------------------------------------*/