ADS
Algorithms and Data Structures
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
73namespace ADS
74{
75
100template< 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
107stringBreakingCost( const std::vector< std::int64_t > & cuts ,
108 std::int64_t length );
109
136template< class I >
137[[nodiscard]] std::vector< I >
138stringBreakingOrder( const std::vector< I > & cuts ,
139 std::type_identity_t< I > length );
140
143[[nodiscard]] inline std::vector< std::int64_t >
144stringBreakingOrder( 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/*--------------------------------------------------------------------------*/
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
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
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
Definition ADT.h:96