ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
Segmentations.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/*-------------------------- File Segmentations.h --------------------------*/
3/*--------------------------------------------------------------------------*/
46/*--------------------------------------------------------------------------*/
47/*----------------------------- DEFINITIONS --------------------------------*/
48/*--------------------------------------------------------------------------*/
49
50#ifndef __ADS_Segmentations
51 #define __ADS_Segmentations
52/* self-identification: #endif constant */
53
54/*--------------------------------------------------------------------------*/
55/*------------------------------ INCLUDES ----------------------------------*/
56/*--------------------------------------------------------------------------*/
57
58#include "ADS/Contract.h"
59
60#include <cstddef>
61#include <cstdint>
62#include <string>
63#include <type_traits>
64#include <vector>
65
66/*--------------------------------------------------------------------------*/
67/*--------------------------- NAMESPACE ------------------------------------*/
68/*--------------------------------------------------------------------------*/
69
70namespace ADS
71{
72
90template< class S >
91 requires std::is_class_v< S >
92[[nodiscard]] std::uint64_t
93countSegmentations( const S & X , const std::vector< S > & words );
94
97[[nodiscard]] inline std::uint64_t
98countSegmentations( const std::string & X ,
99 const std::vector< std::string > & words );
100
124[[nodiscard]] inline std::uint64_t
125countDecodings( const std::vector< int > & digits );
126
127/*--------------------------------------------------------------------------*/
128
129} // end( namespace ADS )
130
131/*--------------------------------------------------------------------------*/
132/*-------------------------- IMPLEMENTATION --------------------------------*/
133/*--------------------------------------------------------------------------*/
134
135#include "ADS/string/impl/Segmentations.tpp"
136
137/*--------------------------------------------------------------------------*/
138
139#endif /* Segmentations.h included */
140
141/*--------------------------------------------------------------------------*/
142/*------------------------ End File Segmentations.h ------------------------*/
143/*--------------------------------------------------------------------------*/
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
std::uint64_t countSegmentations(const S &X, const std::vector< S > &words)
the number of ways of writing as a sequence of the words, modulo ; a word repeated in the list count...
std::uint64_t countDecodings(const std::vector< int > &digits)
the number of readings of the digits as letters , modulo ; 1 for no digits
Definition ADT.h:96