Last change
on this file since 3066 was
2731,
checked in by Takeshi Nakazato, 11 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
|
Rev | Line | |
---|
[2720] | 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 | |
---|
| 17 | namespace asap { |
---|
| 18 | |
---|
| 19 | /** |
---|
| 20 | * Implementation of locate operation by bisection search |
---|
| 21 | * @author TakeshiNakazato |
---|
| 22 | */ |
---|
[2731] | 23 | template <class T> class BisectionLocator : public Locator<T> { |
---|
[2720] | 24 | public: |
---|
[2730] | 25 | // Default constructor. |
---|
| 26 | BisectionLocator(); |
---|
[2720] | 27 | |
---|
[2730] | 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() |
---|
[2731] | 33 | BisectionLocator(T *v, unsigned int n, bool copystorage=true); |
---|
[2730] | 34 | |
---|
| 35 | // Destructor. |
---|
[2720] | 36 | virtual ~BisectionLocator(); |
---|
| 37 | |
---|
[2730] | 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() |
---|
[2731] | 42 | unsigned int locate(T x); |
---|
[2720] | 43 | }; |
---|
| 44 | |
---|
| 45 | } |
---|
[2731] | 46 | |
---|
| 47 | #include "BisectionLocator.tcc" |
---|
| 48 | |
---|
[2720] | 49 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.