100#ifndef __ADS_MaximumSegments
101 #define __ADS_MaximumSegments
117#include <type_traits>
339[[nodiscard]]
inline std::vector< int >
gcIndicator(
const std::string & dna );
349#include "ADS/algorithm/impl/MaximumSegments.tpp"
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
Two problems on a sequence solved by the dynamic programming of chapter 13:
The arithmetic of two words that C++20 does not spell, in one form for every compiler: the product of...
Segment< T > longestSegmentAverageAtLeast(const std::vector< T > &D, T p, T q)
the longest segment of average at least , length 0 if none
Segment< T > maxSumSegmentPrefix(const std::vector< T > &D)
a nonempty segment of largest sum, by the minimum prefix sum,
std::vector< int > gcIndicator(const std::string &dna)
1 for the nucleotides C and G, in either case, and 0 for the others
Segment< T > longestSegmentAtLeast(const std::vector< T > &D, T t)
the longest segment of sum at least , length 0 if none,
Segment< T > maxSumSegmentLength(const std::vector< T > &D, std::size_t L, std::size_t U)
a segment of largest sum among those of length in ,
Segment< T > maxSumSegment(const std::vector< T > &D)
a nonempty segment of largest sum, by one scan,
Segment< T > maxDensitySegment(const std::vector< T > &D, std::size_t L)
a segment of largest average among those of length at least , its sum in the result,
Segment< T > maxSumSegmentCubic(const std::vector< T > &D)
a nonempty segment of largest sum, by all the pairs,
Segment< T > maxSumSegmentQuadratic(const std::vector< T > &D)
a nonempty segment of largest sum, by all the pairs,
a segment of the array and its sum, with the place first and the length
Definition MaximumSegments.h:131
T sum
the sum of its items
Definition MaximumSegments.h:132
std::size_t first
the place of its first item
Definition MaximumSegments.h:133
std::size_t length
0 for no segment
Definition MaximumSegments.h:134