IN
- The type of the samples to be interpolatedOUT
- The type of the interpolation result.public class TimeStampedInterpolableEphemeris<IN extends TimeStamped,OUT> extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
TimeStampedInterpolableEphemeris.SearchMethod
Enumerate to specify the search method used to find the correct samples interval given a certain date.
|
Constructor and Description |
---|
TimeStampedInterpolableEphemeris(IN[] samples,
int order,
TimeStampedInterpolationFunctionBuilder<IN,OUT> interpolationFunctionBuilder,
boolean acceptOutOfOptimalRange)
Simplified constructor.
By default, the given samples are copied to be stored, plus they are checked to be strictly sorted (in increasing order and no samples with the same date) and a cache size of FIFOThreadSafeCache.DEFAULT_MAX_SIZE is
used. |
TimeStampedInterpolableEphemeris(IN[] samples,
int order,
TimeStampedInterpolationFunctionBuilder<IN,OUT> interpolationFunctionBuilder,
boolean acceptOutOfOptimalRange,
boolean copySamples,
boolean checkStrictlySorted,
int cacheSize)
Standard constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
getCacheReusabilityRatio()
Provides the ratio of reusability of the internal cache.
|
int |
getCeilingIndex(AbsoluteDate date)
Getter for the ceiling index for the given date.
If the provided date is after the last sample, -1 is returned. |
IN |
getCeilingSample(AbsoluteDate date)
Getter for the ceiling sample for the given date.
|
AbsoluteDate |
getFirstDate()
Getter for the first date.
|
IN |
getFirstSample()
Getter for the first sample.
|
int |
getFloorIndex(AbsoluteDate date)
Getter for the floor index for the given date.
If the provided date is before the first sample, -1 is returned. |
IN |
getFloorSample(AbsoluteDate date)
Getter for the floor sample for the given date.
|
AbsoluteDate |
getLastDate()
Getter for the last date.
|
IN |
getLastSample()
Getter for the last sample.
|
IN[] |
getSamples(boolean copy)
Getter for the samples array.
|
int |
getSampleSize()
Getter for the sample size.
|
TimeStampedInterpolableEphemeris.SearchMethod |
getSearchMethod()
Getter for the search method.
|
OUT |
interpolate(AbsoluteDate date)
Returns an interpolated instance at the required date.
|
boolean |
isAcceptOutOfOptimalRange()
Indicates whether accept dates outside of the optimal interval which is a sub-interval from the full interval
interval required for interpolation with respect to the interpolation order.
|
void |
setSearchMethod(TimeStampedInterpolableEphemeris.SearchMethod searchMethod)
Setter for the search method.
|
public TimeStampedInterpolableEphemeris(IN[] samples, int order, TimeStampedInterpolationFunctionBuilder<IN,OUT> interpolationFunctionBuilder, boolean acceptOutOfOptimalRange)
FIFOThreadSafeCache.DEFAULT_MAX_SIZE
is
used.
Note: The interpolation function builder has to implement Serializable
if the interpolable ephemeris
should be serializable (not required).
samples
- The array of samplesorder
- Interpolation order (number of points to use for the interpolation). It must be even.interpolationFunctionBuilder
- The function that can build an interpolation functionacceptOutOfOptimalRange
- Indicates whether accept dates outside of the optimal interval which is a sub-interval from the full
interval interval
required for interpolation with respect to the interpolation orderNullArgumentException
- if samples
is nullIllegalArgumentException
- if the samples aren't sorted
if the order isn't an even number or is lower than 2
if the interpolable ephemeris length is lower than the orderpublic TimeStampedInterpolableEphemeris(IN[] samples, int order, TimeStampedInterpolationFunctionBuilder<IN,OUT> interpolationFunctionBuilder, boolean acceptOutOfOptimalRange, boolean copySamples, boolean checkStrictlySorted, int cacheSize)
Note: The interpolation function builder has to implement Serializable
if the interpolable ephemeris
should be serializable (not required).
samples
- The array of samplesorder
- Interpolation order (number of points to use for the interpolation). It must be even.interpolationFunctionBuilder
- The function that can build an interpolation functionacceptOutOfOptimalRange
- Indicates whether accept dates outside of the optimal interval which is a sub-interval from the full
interval interval required for interpolation with respect to the interpolation ordercopySamples
- Indicates whether the given samples should be copied or stored directlycheckStrictlySorted
- Indicates whether the given samples should be checked to be strictly sorted (in increasing order and no
samples with the same date) or if it's not necessarycacheSize
- The size of the cache. 0 is a legitimate value emulating the absence of cache.NullArgumentException
- if samples
or interpolationFunctionBuilder
is nullIllegalArgumentException
- if the samples should be sorted (checkStrictlySorted = true
) and aren't
if the order is an odd number or is lower than 2
if the samples array length is lower than the orderNotPositiveException
- if cacheSize < 0
public OUT interpolate(AbsoluteDate date)
date
- The date of the interpolationIllegalStateException
- if the date is outside the supported interval
if the instance has the setting acceptOutOfRange = false
and the date is outside the optimal
interval which is a sub-interval from the full interval interval required for interpolation with respect
to the interpolation orderpublic int getFloorIndex(AbsoluteDate date)
date
- The date to look forpublic int getCeilingIndex(AbsoluteDate date)
date
- The date to look forpublic IN getFloorSample(AbsoluteDate date)
date
- The date to look forIllegalStateException
- if the provided date is before the first samplepublic IN getCeilingSample(AbsoluteDate date)
date
- The date to look forIllegalStateException
- if the provided date is after the last samplepublic IN getFirstSample()
public IN getLastSample()
public AbsoluteDate getFirstDate()
public AbsoluteDate getLastDate()
public int getSampleSize()
public IN[] getSamples(boolean copy)
copy
- if true
return a copy of the samples array, otherwise return the stored arraypublic double getCacheReusabilityRatio()
public boolean isAcceptOutOfOptimalRange()
true
if the dates outside of the optimal interval are accepted, false
otherwisepublic TimeStampedInterpolableEphemeris.SearchMethod getSearchMethod()
public void setSearchMethod(TimeStampedInterpolableEphemeris.SearchMethod searchMethod)
searchMethod
- the search method to setNullArgumentException
- if searchMethod
is nullCopyright © 2023 CNES. All rights reserved.