ADS
Algorithms and Data Structures
Toggle main menu visibility
Loading...
Searching...
No Matches
StringBreaking.h
Go to the documentation of this file.
1
/*--------------------------------------------------------------------------*/
2
/*------------------------- File StringBreaking.h --------------------------*/
3
/*--------------------------------------------------------------------------*/
46
/*--------------------------------------------------------------------------*/
47
/*----------------------------- DEFINITIONS --------------------------------*/
48
/*--------------------------------------------------------------------------*/
49
50
#ifndef __ADS_StringBreaking
51
#define __ADS_StringBreaking
52
/* self-identification: #endif constant */
53
54
/*--------------------------------------------------------------------------*/
55
/*------------------------------ INCLUDES ----------------------------------*/
56
/*--------------------------------------------------------------------------*/
57
58
#include "
ADS/Contract.h
"
59
60
#include <algorithm>
61
#include <cstddef>
62
#include <cstdint>
63
#include <iterator>
64
#include <set>
65
#include <type_traits>
66
#include <utility>
67
#include <vector>
68
69
/*--------------------------------------------------------------------------*/
70
/*--------------------------- NAMESPACE ------------------------------------*/
71
/*--------------------------------------------------------------------------*/
72
73
namespace
ADS
74
{
75
100
template
<
class
I >
101
[[nodiscard]] I
stringBreakingCost
(
const
std::vector< I > & cuts ,
102
std::type_identity_t< I > length );
103
106
[[nodiscard]]
inline
std::int64_t
107
stringBreakingCost
(
const
std::vector< std::int64_t > & cuts ,
108
std::int64_t length );
109
136
template
<
class
I >
137
[[nodiscard]] std::vector< I >
138
stringBreakingOrder
(
const
std::vector< I > & cuts ,
139
std::type_identity_t< I > length );
140
143
[[nodiscard]]
inline
std::vector< std::int64_t >
144
stringBreakingOrder
(
const
std::vector< std::int64_t > & cuts ,
145
std::int64_t length );
146
147
/*--------------------------------------------------------------------------*/
148
149
}
// end( namespace ADS )
150
151
/*--------------------------------------------------------------------------*/
152
/*-------------------------- IMPLEMENTATION --------------------------------*/
153
/*--------------------------------------------------------------------------*/
154
155
#include "ADS/string/impl/StringBreaking.tpp"
156
157
/*--------------------------------------------------------------------------*/
158
159
#endif
/* StringBreaking.h included */
160
161
/*--------------------------------------------------------------------------*/
162
/*----------------------- End File StringBreaking.h ------------------------*/
163
/*--------------------------------------------------------------------------*/
Contract.h
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
ADS::stringBreakingOrder
std::vector< I > stringBreakingOrder(const std::vector< I > &cuts, std::type_identity_t< I > length)
the places cuts in an order of least total cost
ADS::stringBreakingCost
I stringBreakingCost(const std::vector< I > &cuts, std::type_identity_t< I > length)
the least total cost of the cuts of a string of the given length at the places cuts
ADS
Definition
ADT.h:96
ADS
string
StringBreaking.h
Generated by
1.17.0