Last change
on this file since 3121 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.2 KB
|
Line | |
---|
1 | //
|
---|
2 | // C++ Interface: BufferedBisectionLocator
|
---|
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_BUFFERED_BISECTION_LOCATOR_H
|
---|
13 | #define ASAP_BUFFERED_BISECTION_LOCATOR_H
|
---|
14 |
|
---|
15 | #include "Locator.h"
|
---|
16 |
|
---|
17 | namespace asap {
|
---|
18 |
|
---|
19 | /**
|
---|
20 | * Implementation of locate operation by bisection search with
|
---|
21 | * some buffer.
|
---|
22 | * @author TakeshiNakazato
|
---|
23 | */
|
---|
24 | template <class T> class BufferedBisectionLocator : public Locator<T> {
|
---|
25 | public:
|
---|
26 | // Default constructor.
|
---|
27 | BufferedBisectionLocator();
|
---|
28 |
|
---|
29 | // Construct with data
|
---|
30 | // @param[in] v pointer to input data.
|
---|
31 | // @param[in] n length of the data.
|
---|
32 | // @param[in] copystorage whether allocate internal memory or not.
|
---|
33 | // @see Locator::set()
|
---|
34 | BufferedBisectionLocator(T *v, unsigned int n, bool copystorage=true);
|
---|
35 |
|
---|
36 | // Destructor.
|
---|
37 | virtual ~BufferedBisectionLocator();
|
---|
38 |
|
---|
39 | // Return right hand side index of location using bisection search.
|
---|
40 | // @param[in] x input value to be located.
|
---|
41 | // @return location as an index j.
|
---|
42 | // @see Locator::locate()
|
---|
43 | unsigned int locate(T x);
|
---|
44 | private:
|
---|
45 |
|
---|
46 | // Previous location index.
|
---|
47 | unsigned int prev_;
|
---|
48 | };
|
---|
49 |
|
---|
50 | }
|
---|
51 |
|
---|
52 | #include "BufferedBisectionLocator.tcc"
|
---|
53 |
|
---|
54 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.