Public Member Functions | Protected Attributes | Private Member Functions | List of all members
o2scl::search_vec_ext< vec_t > Class Template Reference

An extended search_vec which is allowed to return the last element. More...

#include <search_vec.h>

Public Member Functions

 search_vec_ext ()
 Create a blank searching object.
 
 search_vec_ext (size_t nn, const vec_t &x)
 Create a searching object for vector x of size nn. More...
 
size_t find (const double x0) const
 Search an increasing or decreasing vector for the interval containing x0
 
size_t find_inc (const double x0) const
 Search an increasing vector for the interval containing x0
 
size_t find_dec (const double x0) const
 Search a decreasing vector for the interval containing x0
 

Protected Attributes

size_t cache
 Storage for the most recent index. More...
 
const vec_t * v
 The vector to be searched.
 
size_t n
 The vector size.
 

Private Member Functions

 search_vec_ext (const search_vec_ext< vec_t > &)
 
search_vec_ext< vec_t > & operator= (const search_vec_ext< vec_t > &)
 

Detailed Description

template<class vec_t>
class o2scl::search_vec_ext< vec_t >

Definition at line 261 of file search_vec.h.

Constructor & Destructor Documentation

◆ search_vec_ext()

template<class vec_t>
o2scl::search_vec_ext< vec_t >::search_vec_ext ( size_t  nn,
const vec_t &  x 
)
inline
Idea for Future:
Ensure this is fully tested for vectors with only one element.

Definition at line 301 of file search_vec.h.

Member Data Documentation

◆ cache

template<class vec_t>
size_t o2scl::search_vec_ext< vec_t >::cache
mutableprotected
Note
This is marked mutable to ensure const-correctness is straightforward.

Definition at line 272 of file search_vec.h.


The documentation for this class was generated from the following file:

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).