source: trunk/src/BisectionLocator.h@ 2896

Last change on this file since 2896 was 2731, checked in by Takeshi Nakazato, 12 years ago

New Development: No

JIRA Issue: Yes CAS-4770

Ready for Test: Yes

Interface Changes: Yes/No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No

Module(s): Module Names change impacts.

Description: Describe your changes here...

Redefined Locator and its derived classes as template class.


File size: 1.1 KB
Line 
1//
2// C++ Interface: BisectionLocator
3//
4// Description:
5//
6//
7// Author: Takeshi Nakazato <takeshi.nakazato@nao.ac.jp>, (C) 2012
8//
9// Copyright: See COPYING file that comes with this distribution
10//
11//
12#ifndef ASAP_BISECTION_LOCATOR_H
13#define ASAP_BISECTION_LOCATOR_H
14
15#include "Locator.h"
16
17namespace asap {
18
19/**
20 * Implementation of locate operation by bisection search
21 * @author TakeshiNakazato
22 */
23template <class T> class BisectionLocator : public Locator<T> {
24public:
25 // Default constructor.
26 BisectionLocator();
27
28 // Construct with data
29 // @param[in] v pointer to input data.
30 // @param[in] n length of the data.
31 // @param[in] copystorage whether allocate internal memory or not.
32 // @see Locator::set()
33 BisectionLocator(T *v, unsigned int n, bool copystorage=true);
34
35 // Destructor.
36 virtual ~BisectionLocator();
37
38 // Return right hand side index of location using bisection search.
39 // @param[in] x input value to be located.
40 // @return location as an index j.
41 // @see Locator::locate()
42 unsigned int locate(T x);
43};
44
45}
46
47#include "BisectionLocator.tcc"
48
49#endif
Note: See TracBrowser for help on using the repository browser.