Add ability to truncate IntegratedEphemeris
This is a memory optimization, particularly useful when IntegratedEphemeris
is used with AggregateBoundedPropagator
and there are overlapping intervals. The data in the overlapping intervals will never be used and is therefore a memory leak of sorts.
This could be implemented within the existing API, probably within a minor release, by specializing getGeneratedEphemeris()
to return a new copy of IntegratedEphemeris
with only the data needed for the new time interval. The when the original IntegratedEphemeris
is garbage collected the unneeded data could be garbage collected as well. Draw back is that the copy operation would be slower and use more memory when not needed.
Another approach is leaving the existing getGeneratedEphemeris()
as is and to add a dedicated public IntegratedEphemeris copy(AbsoluteDate start, AbsoluteDate end) {...}
method. Would need to change the return type of AbstractIntegratedPropagator.getGeneratedEphemeris()
from BoundedPropagator
to IntegratedEphemeris
. Also could be added in a minor release.
Currently IntegratedEphemeris
is immutable, don't think we want to change that.