ADS
Algorithms and Data Structures
Toggle main menu visibility
Loading...
Searching...
No Matches
WeightedIntervals.h
Go to the documentation of this file.
1
/*--------------------------------------------------------------------------*/
2
/*------------------------ File WeightedIntervals.h ------------------------*/
3
/*--------------------------------------------------------------------------*/
33
/*--------------------------------------------------------------------------*/
34
/*----------------------------- DEFINITIONS --------------------------------*/
35
/*--------------------------------------------------------------------------*/
36
37
#ifndef __ADS_WeightedIntervals
38
#define __ADS_WeightedIntervals
39
/* self-identification: #endif constant */
40
41
/*--------------------------------------------------------------------------*/
42
/*------------------------------ INCLUDES ----------------------------------*/
43
/*--------------------------------------------------------------------------*/
44
45
#include "
ADS/Contract.h
"
46
47
#include <algorithm>
48
#include <cstddef>
49
#include <numeric>
50
#include <utility>
51
#include <vector>
52
53
/*--------------------------------------------------------------------------*/
54
/*--------------------------- NAMESPACE ------------------------------------*/
55
/*--------------------------------------------------------------------------*/
56
57
namespace
ADS
58
{
59
61
template
<
class
W >
62
struct
WeightedInterval
63
{
64
long
long
a
,
65
b
;
66
W
w
;
67
};
68
100
template
<
class
W >
101
std::pair< std::vector< std::size_t > , W >
102
maxinterval
(
const
std::vector<
WeightedInterval< W >
> & I );
103
104
/*--------------------------------------------------------------------------*/
105
106
}
// end( namespace ADS )
107
108
/*--------------------------------------------------------------------------*/
109
/*-------------------------- IMPLEMENTATION --------------------------------*/
110
/*--------------------------------------------------------------------------*/
111
112
#include "ADS/optimization/impl/WeightedIntervals.tpp"
113
114
/*--------------------------------------------------------------------------*/
115
116
#endif
/* WeightedIntervals.h included */
117
118
/*--------------------------------------------------------------------------*/
119
/*---------------------- End File WeightedIntervals.h ----------------------*/
120
/*--------------------------------------------------------------------------*/
Contract.h
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
ADS::maxinterval
std::pair< std::vector< std::size_t >, W > maxinterval(const std::vector< WeightedInterval< W > > &I)
the places of the intervals of a largest independent set, in increasing order, and its weight
ADS
Definition
ADT.h:96
ADS::WeightedInterval
an interval of weight
Definition
WeightedIntervals.h:63
ADS::WeightedInterval::w
W w
the weight
Definition
WeightedIntervals.h:66
ADS::WeightedInterval::a
long long a
the left end, included
Definition
WeightedIntervals.h:64
ADS::WeightedInterval::b
long long b
the right end, excluded
Definition
WeightedIntervals.h:65
ADS
optimization
WeightedIntervals.h
Generated by
1.17.0