Last change
on this file since 3045 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
|
Rev | Line | |
---|
[2727] | 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 | /**
|
---|
[2730] | 20 | * Implementation of locate operation by bisection search with
|
---|
| 21 | * some buffer.
|
---|
[2727] | 22 | * @author TakeshiNakazato
|
---|
| 23 | */
|
---|
[2731] | 24 | template <class T> class BufferedBisectionLocator : public Locator<T> {
|
---|
[2727] | 25 | public:
|
---|
[2730] | 26 | // Default constructor.
|
---|
| 27 | BufferedBisectionLocator();
|
---|
[2727] | 28 |
|
---|
[2730] | 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()
|
---|
[2731] | 34 | BufferedBisectionLocator(T *v, unsigned int n, bool copystorage=true);
|
---|
[2730] | 35 |
|
---|
| 36 | // Destructor.
|
---|
[2727] | 37 | virtual ~BufferedBisectionLocator();
|
---|
| 38 |
|
---|
[2730] | 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()
|
---|
[2731] | 43 | unsigned int locate(T x);
|
---|
[2727] | 44 | private:
|
---|
[2730] | 45 |
|
---|
| 46 | // Previous location index.
|
---|
[2727] | 47 | unsigned int prev_;
|
---|
| 48 | };
|
---|
| 49 |
|
---|
| 50 | }
|
---|
[2731] | 51 |
|
---|
| 52 | #include "BufferedBisectionLocator.tcc"
|
---|
| 53 |
|
---|
[2727] | 54 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.