ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
IntervalCover.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/*-------------------------- File IntervalCover.h --------------------------*/
3/*--------------------------------------------------------------------------*/
42/*--------------------------------------------------------------------------*/
43/*----------------------------- DEFINITIONS --------------------------------*/
44/*--------------------------------------------------------------------------*/
45
46#ifndef __ADS_IntervalCover
47 #define __ADS_IntervalCover
48/* self-identification: #endif constant */
49
50/*--------------------------------------------------------------------------*/
51/*------------------------------ INCLUDES ----------------------------------*/
52/*--------------------------------------------------------------------------*/
53
54#include "ADS/Contract.h"
55
56#include <algorithm>
57#include <cstddef>
58#include <numeric>
59#include <optional>
60#include <utility>
61#include <vector>
62
63/*--------------------------------------------------------------------------*/
64/*--------------------------- NAMESPACE ------------------------------------*/
65/*--------------------------------------------------------------------------*/
66
67namespace ADS
68{
69
94template< class T >
95std::optional< std::vector< std::size_t > >
96minimumIntervalCover( const std::vector< std::pair< T , T > > & I , T lo ,
97 T hi );
98
99/*--------------------------------------------------------------------------*/
100
101} // end( namespace ADS )
102
103/*--------------------------------------------------------------------------*/
104/*-------------------------- IMPLEMENTATION --------------------------------*/
105/*--------------------------------------------------------------------------*/
106
107#include "ADS/optimization/impl/IntervalCover.tpp"
108
109/*--------------------------------------------------------------------------*/
110
111#endif /* IntervalCover.h included */
112
113/*--------------------------------------------------------------------------*/
114/*------------------------ End File IntervalCover.h ------------------------*/
115/*--------------------------------------------------------------------------*/
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
std::optional< std::vector< std::size_t > > minimumIntervalCover(const std::vector< std::pair< T, T > > &I, T lo, T hi)
the places of the fewest closed intervals whose union contains , by increasing left end; nothing if ...
Definition ADT.h:96