ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
Intervals.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/*---------------------------- File Intervals.h ----------------------------*/
3/*--------------------------------------------------------------------------*/
37/*--------------------------------------------------------------------------*/
38/*----------------------------- DEFINITIONS --------------------------------*/
39/*--------------------------------------------------------------------------*/
40
41#ifndef __ADS_Intervals
42 #define __ADS_Intervals
43/* self-identification: #endif constant */
44
45/*--------------------------------------------------------------------------*/
46/*------------------------------ INCLUDES ----------------------------------*/
47/*--------------------------------------------------------------------------*/
48
49#include "ADS/Contract.h"
50
51#include <algorithm>
52#include <cmath>
53#include <cstddef>
54#include <numeric>
55#include <utility>
56#include <vector>
57
58/*--------------------------------------------------------------------------*/
59/*--------------------------- NAMESPACE ------------------------------------*/
60/*--------------------------------------------------------------------------*/
61
62namespace ADS
63{
64
83inline std::vector< std::size_t >
84independentSet( const std::vector< std::pair< long , long > > & I );
85
112inline std::vector< int >
113intervalColoring( const std::vector< std::pair< long , long > > & I );
114
134inline std::vector< double > towers( std::vector< double > k , double d );
135
136/*--------------------------------------------------------------------------*/
137
138} // end( namespace ADS )
139
140/*--------------------------------------------------------------------------*/
141/*-------------------------- IMPLEMENTATION --------------------------------*/
142/*--------------------------------------------------------------------------*/
143
144#include "ADS/optimization/impl/Intervals.tpp"
145
146/*--------------------------------------------------------------------------*/
147
148#endif /* Intervals.h included */
149
150/*--------------------------------------------------------------------------*/
151/*-------------------------- End File Intervals.h --------------------------*/
152/*--------------------------------------------------------------------------*/
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
std::optional< Nodes > independentSet(const Adjacency &G, int k)
nodes no two adjacent, or nothing
std::vector< double > towers(std::vector< double > k, double d)
the fewest towers such that each house is within of one (the torri() of the book)
std::vector< int > intervalColoring(const std::vector< std::pair< long, long > > &I)
the colors, from 0, of the intervals , the fewest possible
Definition ADT.h:96