Program Listing for File KnuthSearches.h
↰ Return to documentation for file (ADS/search/KnuthSearches.h)
/*--------------------------------------------------------------------------*/
/*-------------------------- File KnuthSearches.h --------------------------*/
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
/*----------------------------- DEFINITIONS --------------------------------*/
/*--------------------------------------------------------------------------*/
#ifndef __ADS_KnuthSearches
#define __ADS_KnuthSearches
/* self-identification: #endif constant */
/*--------------------------------------------------------------------------*/
/*------------------------------ INCLUDES ----------------------------------*/
/*--------------------------------------------------------------------------*/
#include "ADS/Contract.h"
#include <algorithm>
#include <cstddef>
#include <vector>
/*--------------------------------------------------------------------------*/
/*--------------------------- NAMESPACE ------------------------------------*/
/*--------------------------------------------------------------------------*/
namespace ADS {
template< class T >
long fibonacciSearch( const std::vector< T > & A , const T & v ,
long * cmp = nullptr );
template< class T >
long uniformBinarySearch( const std::vector< T > & A , const T & v ,
long * cmp = nullptr );
/*--------------------------------------------------------------------------*/
} // end( namespace ADS )
/*--------------------------------------------------------------------------*/
/*-------------------------- IMPLEMENTATION --------------------------------*/
/*--------------------------------------------------------------------------*/
#include "ADS/search/impl/KnuthSearches.tpp"
/*--------------------------------------------------------------------------*/
#endif /* KnuthSearches.h included */
/*--------------------------------------------------------------------------*/
/*------------------------ End File KnuthSearches.h ------------------------*/
/*--------------------------------------------------------------------------*/