Repository: commons-math Updated Branches: refs/heads/master f8e6bc8ec -> 45ae5c7e4
Added getInterpolatedSecondaryDerivatives to ContinuousOutputModel. This method is a close relative to getInterpolatedDerivatives, but is associated with the secondary state. JIRA: MATH-1160 Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/45ae5c7e Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/45ae5c7e Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/45ae5c7e Branch: refs/heads/master Commit: 45ae5c7e42b07ff24e2385de57f70e9484a46ae3 Parents: f8e6bc8 Author: Luc Maisonobe <l...@apache.org> Authored: Wed Oct 22 21:40:32 2014 +0200 Committer: Luc Maisonobe <l...@apache.org> Committed: Wed Oct 22 21:40:32 2014 +0200 ---------------------------------------------------------------------- .../math3/ode/ContinuousOutputModel.java | 25 ++++++++++++++++++++ 1 file changed, 25 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-math/blob/45ae5c7e/src/main/java/org/apache/commons/math3/ode/ContinuousOutputModel.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math3/ode/ContinuousOutputModel.java b/src/main/java/org/apache/commons/math3/ode/ContinuousOutputModel.java index 6d324d1..75e4979 100644 --- a/src/main/java/org/apache/commons/math3/ode/ContinuousOutputModel.java +++ b/src/main/java/org/apache/commons/math3/ode/ContinuousOutputModel.java @@ -346,6 +346,7 @@ public class ContinuousOutputModel * @see #setInterpolatedTime(double) * @see #getInterpolatedDerivatives() * @see #getInterpolatedSecondaryState(int) + * @see #getInterpolatedSecondaryDerivatives(int) */ public double[] getInterpolatedState() throws MaxCountExceededException { return steps.get(index).getInterpolatedState(); @@ -362,6 +363,7 @@ public class ContinuousOutputModel * @see #setInterpolatedTime(double) * @see #getInterpolatedState() * @see #getInterpolatedSecondaryState(int) + * @see #getInterpolatedSecondaryDerivatives(int) * @since 3.4 */ public double[] getInterpolatedDerivatives() throws MaxCountExceededException { @@ -381,6 +383,7 @@ public class ContinuousOutputModel * @see #setInterpolatedTime(double) * @see #getInterpolatedState() * @see #getInterpolatedDerivatives() + * @see #getInterpolatedSecondaryDerivatives(int) * @since 3.2 * @exception MaxCountExceededException if the number of functions evaluations is exceeded */ @@ -389,6 +392,28 @@ public class ContinuousOutputModel return steps.get(index).getInterpolatedSecondaryState(secondaryStateIndex); } + /** Get the interpolated secondary derivatives corresponding to the secondary equations. + * <p>The returned vector is a reference to a reused array, so + * it should not be modified and it should be copied if it needs + * to be preserved across several calls to the associated + * {@link #setInterpolatedTime(double)} method.</p> + * @param secondaryStateIndex index of the secondary set, as returned by {@link + * org.apache.commons.math3.ode.ExpandableStatefulODE#addSecondaryEquations( + * org.apache.commons.math3.ode.SecondaryEquations) + * ExpandableStatefulODE.addSecondaryEquations(SecondaryEquations)} + * @return interpolated secondary derivatives at the current interpolation date + * @see #setInterpolatedTime(double) + * @see #getInterpolatedState() + * @see #getInterpolatedDerivatives() + * @see #getInterpolatedSecondaryState(int) + * @since 3.4 + * @exception MaxCountExceededException if the number of functions evaluations is exceeded + */ + public double[] getInterpolatedSecondaryDerivatives(final int secondaryStateIndex) + throws MaxCountExceededException { + return steps.get(index).getInterpolatedSecondaryDerivatives(secondaryStateIndex); + } + /** Compare a step interval and a double. * @param time point to locate * @param interval step interval