ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
LocalOptima.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/*--------------------------- File LocalOptima.h ---------------------------*/
3/*--------------------------------------------------------------------------*/
55/*--------------------------------------------------------------------------*/
56/*----------------------------- DEFINITIONS --------------------------------*/
57/*--------------------------------------------------------------------------*/
58
59#ifndef __ADS_LocalOptima
60 #define __ADS_LocalOptima
61/* self-identification: #endif constant */
62
63/*--------------------------------------------------------------------------*/
64/*------------------------------ INCLUDES ----------------------------------*/
65/*--------------------------------------------------------------------------*/
66
67#include "ADS/Contract.h"
68#include "ADS/sort/Sorted.h"
69#include "ADS/tree/BinaryTree.h"
70
71#include <cstddef>
72#include <functional>
73#include <initializer_list>
74#include <vector>
75
76/*--------------------------------------------------------------------------*/
77/*--------------------------- NAMESPACE ------------------------------------*/
78/*--------------------------------------------------------------------------*/
79
80namespace ADS
81{
82
107template< class T , class C = std::less<> >
108std::size_t findPeak( const std::vector< T > & A , C less = C() );
109
126template< class T , class C = std::less<> >
127std::size_t localMinimum( const std::vector< T > & A , C less = C() );
128
153template< class T , class C = std::less<> >
155
156/*--------------------------------------------------------------------------*/
157
158} // end( namespace ADS )
159
160/*--------------------------------------------------------------------------*/
161/*-------------------------- IMPLEMENTATION --------------------------------*/
162/*--------------------------------------------------------------------------*/
163
164#include "ADS/search/impl/LocalOptima.tpp"
165
166/*--------------------------------------------------------------------------*/
167
168#endif /* LocalOptima.h included */
169
170/*--------------------------------------------------------------------------*/
171/*------------------------- End File LocalOptima.h -------------------------*/
172/*--------------------------------------------------------------------------*/
The binary TREE of the book: an ordered tree where each node has at most two children,...
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The checks of the contracts of the sorts [see Contract.h]: a copy of the input kept only when the aud...
a binary tree with pointers to the parent and to the two children
Definition BinaryTree.h:104
std::size_t findPeak(const std::vector< T > &A, C less=C())
the place of an item of not smaller than its neighbors, by a binary search; comparisons
std::size_t localMinimum(const std::vector< T > &A, C less=C())
the place of an item of not larger than its neighbors, by a binary search; comparisons
Definition ADT.h:96