ADS
Algorithms and Data Structures
Toggle main menu visibility
Loading...
Searching...
No Matches
InterpolationSearch.h
Go to the documentation of this file.
1
/*--------------------------------------------------------------------------*/
2
/*----------------------- File InterpolationSearch.h -----------------------*/
3
/*--------------------------------------------------------------------------*/
39
/*--------------------------------------------------------------------------*/
40
/*----------------------------- DEFINITIONS --------------------------------*/
41
/*--------------------------------------------------------------------------*/
42
43
#ifndef __ADS_InterpolationSearch
44
#define __ADS_InterpolationSearch
45
/* self-identification: #endif constant */
46
47
/*--------------------------------------------------------------------------*/
48
/*------------------------------ INCLUDES ----------------------------------*/
49
/*--------------------------------------------------------------------------*/
50
51
#include "
ADS/Contract.h
"
52
53
#include <algorithm>
54
#include <vector>
55
56
/*--------------------------------------------------------------------------*/
57
/*--------------------------- NAMESPACE ------------------------------------*/
58
/*--------------------------------------------------------------------------*/
59
60
namespace
ADS
61
{
62
85
template
<
class
T ,
class
F >
86
long
interpolationSearch
(
const
std::vector< T > & A ,
const
T & v ,
87
F && trace );
88
90
template
<
class
T >
91
long
interpolationSearch
(
const
std::vector< T > & A ,
const
T & v );
92
93
/*--------------------------------------------------------------------------*/
94
95
}
// end( namespace ADS )
96
97
/*--------------------------------------------------------------------------*/
98
/*-------------------------- IMPLEMENTATION --------------------------------*/
99
/*--------------------------------------------------------------------------*/
100
101
#include "ADS/search/impl/InterpolationSearch.tpp"
102
103
/*--------------------------------------------------------------------------*/
104
105
#endif
/* InterpolationSearch.h included */
106
107
/*--------------------------------------------------------------------------*/
108
/*--------------------- End File InterpolationSearch.h ---------------------*/
109
/*--------------------------------------------------------------------------*/
Contract.h
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
ADS::interpolationSearch
long interpolationSearch(const std::vector< T > &A, const T &v, F &&trace)
the place of in the sorted , or -1; trace( i , j , m ) on each probe (the ricercaInterpolata() of th...
ADS
Definition
ADT.h:96
ADS
search
InterpolationSearch.h
Generated by
1.17.0