ADS
Algorithms and Data Structures
Toggle main menu visibility
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
80
namespace
ADS
81
{
82
107
template
<
class
T ,
class
C = std::less<> >
108
std::size_t
findPeak
(
const
std::vector< T > & A , C less = C() );
109
126
template
<
class
T ,
class
C = std::less<> >
127
std::size_t
localMinimum
(
const
std::vector< T > & A , C less = C() );
128
153
template
<
class
T ,
class
C = std::less<> >
154
BinaryTree< T >
*
localMinimum
(
BinaryTree< T >
* t , C less = C() );
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
/*--------------------------------------------------------------------------*/
BinaryTree.h
The binary TREE of the book: an ordered tree where each node has at most two children,...
Contract.h
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
Sorted.h
The checks of the contracts of the sorts [see Contract.h]: a copy of the input kept only when the aud...
ADS::BinaryTree
a binary tree with pointers to the parent and to the two children
Definition
BinaryTree.h:104
ADS::findPeak
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
ADS::localMinimum
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
ADS
Definition
ADT.h:96
ADS
search
LocalOptima.h
Generated by
1.17.0