All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions
o2scl::search_vec_ext< vec_t > Class Template Reference

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

Detailed Description

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

Todo:
The constructor is too restrictive, as it actually calls the parent search_vec constructor and thus requires nn<2 instead of nn<1. Fix this.

Definition at line 264 of file search_vec.h.

#include <search_vec.h>

Inheritance diagram for o2scl::search_vec_ext< vec_t >:
o2scl::search_vec< vec_t >

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
 
- Public Member Functions inherited from o2scl::search_vec< vec_t >
 search_vec ()
 Create a blank searching object.
 
 search_vec (size_t nn, const vec_t &x)
 Create a searching object with vector x of size nn.
 
void set_vec (size_t nn, const vec_t &x)
 Set the vector to be searched.
 
size_t find (const double x0) const
 Search an increasing or decreasing vector for the interval containing x0 More...
 
size_t find_inc (const double x0) const
 Search an increasing vector for the interval containing x0 More...
 
size_t find_dec (const double x0) const
 Search a decreasing vector for the interval containing x0 More...
 
size_t ordered_lookup (const double x0) const
 Find the index of x0 in the ordered array x. More...
 

Private Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from o2scl::search_vec< vec_t >
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.
 

Constructor & Destructor Documentation

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 280 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).
Hosted at Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads..