ADS
Algorithms and Data Structures
Toggle main menu visibility
Loading...
Searching...
No Matches
LinearPartition.h
Go to the documentation of this file.
1
/*--------------------------------------------------------------------------*/
2
/*------------------------- File LinearPartition.h -------------------------*/
3
/*--------------------------------------------------------------------------*/
55
/*--------------------------------------------------------------------------*/
56
/*----------------------------- DEFINITIONS --------------------------------*/
57
/*--------------------------------------------------------------------------*/
58
59
#ifndef __ADS_LinearPartition
60
#define __ADS_LinearPartition
61
/* self-identification: #endif constant */
62
63
/*--------------------------------------------------------------------------*/
64
/*------------------------------ INCLUDES ----------------------------------*/
65
/*--------------------------------------------------------------------------*/
66
67
#include "
ADS/Contract.h
"
68
69
#include <algorithm>
70
#include <concepts>
71
#include <cstddef>
72
#include <utility>
73
#include <vector>
74
75
/*--------------------------------------------------------------------------*/
76
/*--------------------------- NAMESPACE ------------------------------------*/
77
/*--------------------------------------------------------------------------*/
78
79
namespace
ADS
80
{
81
110
template
<
class
T >
111
std::pair< T , std::vector< std::size_t > >
112
linearPartition
(
const
std::vector< T > & A , std::size_t k );
113
139
template
< std::
int
egral T >
140
T
painterPartition
(
const
std::vector< T > & A , std::size_t k );
141
142
/*--------------------------------------------------------------------------*/
143
144
}
// end( namespace ADS )
145
146
/*--------------------------------------------------------------------------*/
147
/*-------------------------- IMPLEMENTATION --------------------------------*/
148
/*--------------------------------------------------------------------------*/
149
150
#include "ADS/optimization/impl/LinearPartition.tpp"
151
152
/*--------------------------------------------------------------------------*/
153
154
#endif
/* LinearPartition.h included */
155
156
/*--------------------------------------------------------------------------*/
157
/*----------------------- End File LinearPartition.h -----------------------*/
158
/*--------------------------------------------------------------------------*/
Contract.h
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
ADS::painterPartition
T painterPartition(const std::vector< T > &A, std::size_t k)
the least largest sum of a part over the splits of in at most contiguous parts; 0 for empty
ADS::linearPartition
std::pair< T, std::vector< std::size_t > > linearPartition(const std::vector< T > &A, std::size_t k)
the least largest sum of a part over the splits of in nonempty contiguous parts,...
ADS
Definition
ADT.h:96
ADS
optimization
LinearPartition.h
Generated by
1.17.0