ADS
Algorithms and Data Structures
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
79namespace ADS
80{
81
110template< class T >
111std::pair< T , std::vector< std::size_t > >
112linearPartition( const std::vector< T > & A , std::size_t k );
113
139template< std::integral T >
140T 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/*--------------------------------------------------------------------------*/
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
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
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,...
Definition ADT.h:96