|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.math3.utils.AbstractSearchIndex org.apache.commons.math3.utils.RecordSegmentSearchIndex
public class RecordSegmentSearchIndex
Search index algorithm with previous index computation storage. This allows, in case of multiple calls in a close neighborhood (stencil with 4 points) to optimize the search by memorizing the last index found and search around it (+/- 2 points).
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.commons.math3.utils.ISearchIndex |
---|
ISearchIndex.SearchIndexIntervalConvention |
Field Summary |
---|
Fields inherited from class org.apache.commons.math3.utils.AbstractSearchIndex |
---|
convention, iMax, iMin, tab |
Constructor Summary | |
---|---|
RecordSegmentSearchIndex(ISearchIndex searchAlgorithm2)
Constructor of search index class with memorization of the last found index in order to optimize the search and find the index quickly if it belongs to a close neighborhood of the last one (+/- 2 points). |
Method Summary | |
---|---|
int |
getIndex(double x)
Returns the index of x in a tab depending on the convention used. |
int |
getIndex(double x,
int min,
int max)
Returns the index of x in the extracted tab [tab[iMin], tab[iMax]] depending on the convention used. |
int |
getIndexClosedOpen(double x)
Returns the index of x in a tab depending on the convention used. |
int |
getIndexOpenClosed(double x)
Returns the index of x in a tab depending on the convention used. |
void |
updateStencil()
The search algorithm is based on a four-point stencil. |
Methods inherited from class org.apache.commons.math3.utils.AbstractSearchIndex |
---|
getConvention, getTab |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RecordSegmentSearchIndex(ISearchIndex searchAlgorithm2)
searchAlgorithm2
- : the choice of algorithm is made directly through an instance of
a class that implements ISearchIndexMethod Detail |
---|
public void updateStencil()
public int getIndexClosedOpen(double x)
x
- : the value to search.
public int getIndexOpenClosed(double x)
x
- : the value to search.
public int getIndex(double x)
x
- : the value to search.
public int getIndex(double x, int min, int max)
x
- : the value to search.min
- : defines the lower bound of the tab for the search.max
- : defines the upper bound of the tab for the search.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |