Skip to content

Commit

Permalink
Rename RungeKutta(Field)Integrator as FixedStepRungeKutta(Field)Integ…
Browse files Browse the repository at this point in the history
…rator
  • Loading branch information
Serrof committed Feb 7, 2025
1 parent 301273d commit ea3a499
Show file tree
Hide file tree
Showing 39 changed files with 83 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void testStackVariable() {
// THEN
Assertions.assertEquals(gradient.getValue(), gradientWithMoreVariable.getValue());
Assertions.assertEquals(gradient.getFreeParameters() + 1, gradientWithMoreVariable.getFreeParameters());
Assertions.assertEquals(0., gradientWithMoreVariable.getGradient[gradient.getFreeParameters().getReal()]);
Assertions.assertEquals(0., gradientWithMoreVariable.getGradient()[gradient.getFreeParameters()].getReal());
Assertions.assertArrayEquals(gradient.getGradient(), Arrays.copyOfRange(gradientWithMoreVariable.getGradient(),
0, gradient.getFreeParameters()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void testStackVariable() {
// THEN
Assertions.assertEquals(gradient.getValue(), gradientWithMoreVariable.getValue());
Assertions.assertEquals(gradient.getFreeParameters() + 1, gradientWithMoreVariable.getFreeParameters());
Assertions.assertEquals(0., gradientWithMoreVariable.getGradient[gradient.getFreeParameters()]);
Assertions.assertEquals(0., gradientWithMoreVariable.getGradient()[gradient.getFreeParameters()]);
Assertions.assertArrayEquals(gradient.getGradient(), Arrays.copyOfRange(gradientWithMoreVariable.getGradient(),
0, gradient.getFreeParameters()));
}
Expand Down
11 changes: 6 additions & 5 deletions hipparchus-ode/src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,20 @@ If the output is not quite correct, check for invisible trailing spaces!
<properties>
<title>Hipparchus ODE Release Notes</title>
</properties>
<release version="4.0" date="TBD" description="TBD">
<action dev="vincent" type="update" issue="issues/285">
Migrated tests from JUnit 4 to JUnit 5
</action>
</release>
<body>
<release version="4.0" date="TBD" description="TBD">
<action dev="serrof" type="update" issue="issues/372">
Rename RungeKutta(Field)Integrator as FixedStepRungeKutta(Field)Integrator.
</action>
<action dev="serrof" type="update" issue="issues/361">
Rename DEFAULT_MAXCHECK as DEFAULT_MAX_CHECK.
</action>
<action dev="serrof" type="add" issue="issues/335">
Add boolean for propagation direction in (Field)AdaptableInterval.
</action>
<action dev="vincent" type="update" issue="issues/285">
Migrated tests from JUnit 4 to JUnit 5
</action>
</release>
<release version="3.1" date="2024-04-05" description="This is a maintenance release. It includes one
bugfixes and adds two features on existing integrators.">
Expand Down
2 changes: 1 addition & 1 deletion hipparchus-ode/src/conf/spotbugs-exclude-filter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
<Bug pattern="EI_EXPOSE_REP2" />
</Match>
<Match>
<Class name="org.hipparchus.ode.nonstiff.RungeKuttaFieldIntegrator"/>
<Class name="org.hipparchus.ode.nonstiff.FixedStepRungeKuttaFieldIntegrator"/>
<Method name="getDefaultStep"/>
<Bug pattern="EI_EXPOSE_REP" />
</Match>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package org.hipparchus.ode.nonstiff;

/** This interface represents an integrator based on Butcher arrays.
* @see RungeKuttaIntegrator
* @see FixedStepRungeKuttaIntegrator
* @see EmbeddedRungeKuttaIntegrator
*/
public interface ButcherArrayProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
*/

public class ClassicalRungeKuttaFieldIntegrator<T extends CalculusFieldElement<T>>
extends RungeKuttaFieldIntegrator<T> {
extends FixedStepRungeKuttaFieldIntegrator<T> {

/** Name of integration scheme. */
public static final String METHOD_NAME = ClassicalRungeKuttaIntegrator.METHOD_NAME;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* @see LutherIntegrator
*/

public class ClassicalRungeKuttaIntegrator extends RungeKuttaIntegrator {
public class ClassicalRungeKuttaIntegrator extends FixedStepRungeKuttaIntegrator {

/** Name of integration scheme. */
public static final String METHOD_NAME = "classical Runge-Kutta";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
* @param <T> the type of the field elements
*/

public class EulerFieldIntegrator<T extends CalculusFieldElement<T>> extends RungeKuttaFieldIntegrator<T> {
public class EulerFieldIntegrator<T extends CalculusFieldElement<T>> extends FixedStepRungeKuttaFieldIntegrator<T> {

/** Name of integration scheme. */
public static final String METHOD_NAME = EulerIntegrator.METHOD_NAME;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* @see LutherIntegrator
*/

public class EulerIntegrator extends RungeKuttaIntegrator {
public class EulerIntegrator extends FixedStepRungeKuttaIntegrator {

/** Name of integration scheme. */
public static final String METHOD_NAME = "Euler";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* </pre>
*
* @see ButcherArrayProvider
* @see RungeKuttaIntegrator
* @see FixedStepRungeKuttaIntegrator
* @see EmbeddedRungeKuttaIntegrator
* @since 3.1
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.hipparchus.CalculusFieldElement;

/** This interface represents an integrator based on Butcher arrays.
* @see RungeKuttaFieldIntegrator
* @see FixedStepRungeKuttaFieldIntegrator
* @see EmbeddedRungeKuttaFieldIntegrator
* @param <T> the type of the field elements
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* </pre>
*
* @see FieldButcherArrayProvider
* @see RungeKuttaFieldIntegrator
* @see FixedStepRungeKuttaFieldIntegrator
* @see EmbeddedRungeKuttaFieldIntegrator
* @param <T> the type of the field elements
* @since 3.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
* @param <T> the type of the field elements
*/

public abstract class RungeKuttaFieldIntegrator<T extends CalculusFieldElement<T>>
public abstract class FixedStepRungeKuttaFieldIntegrator<T extends CalculusFieldElement<T>>
extends AbstractFieldIntegrator<T> implements FieldExplicitRungeKuttaIntegrator<T> {

/** Time steps from Butcher array (without the first zero). */
Expand Down Expand Up @@ -91,7 +91,7 @@ public abstract class RungeKuttaFieldIntegrator<T extends CalculusFieldElement<T
* @param name name of the method
* @param step integration step
*/
protected RungeKuttaFieldIntegrator(final Field<T> field, final String name, final T step) {
protected FixedStepRungeKuttaFieldIntegrator(final Field<T> field, final String name, final T step) {
super(field, name);
this.c = getC();
this.a = getA();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
* @see MidpointIntegrator
*/

public abstract class RungeKuttaIntegrator extends AbstractIntegrator implements ExplicitRungeKuttaIntegrator {
public abstract class FixedStepRungeKuttaIntegrator extends AbstractIntegrator
implements ExplicitRungeKuttaIntegrator {

/** Time steps from Butcher array (without the first zero). */
private final double[] c;
Expand All @@ -70,7 +71,7 @@ public abstract class RungeKuttaIntegrator extends AbstractIntegrator implements
* @param name name of the method
* @param step integration step
*/
protected RungeKuttaIntegrator(final String name, final double step) {
protected FixedStepRungeKuttaIntegrator(final String name, final double step) {
super(name);
this.c = getC();
this.a = getA();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
*/

public class GillFieldIntegrator<T extends CalculusFieldElement<T>>
extends RungeKuttaFieldIntegrator<T> {
extends FixedStepRungeKuttaFieldIntegrator<T> {

/** Name of integration scheme. */
public static final String METHOD_NAME = GillIntegrator.METHOD_NAME;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
* @see LutherIntegrator
*/

public class GillIntegrator extends RungeKuttaIntegrator {
public class GillIntegrator extends FixedStepRungeKuttaIntegrator {

/** Name of integration scheme. */
public static final String METHOD_NAME = "Gill";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
*/

public class LutherFieldIntegrator<T extends CalculusFieldElement<T>>
extends RungeKuttaFieldIntegrator<T> {
extends FixedStepRungeKuttaFieldIntegrator<T> {

/** Name of integration scheme. */
public static final String METHOD_NAME = LutherIntegrator.METHOD_NAME;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
* @see ThreeEighthesIntegrator
*/

public class LutherIntegrator extends RungeKuttaIntegrator {
public class LutherIntegrator extends FixedStepRungeKuttaIntegrator {

/** Name of integration scheme. */
public static final String METHOD_NAME = "Luther";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
* @param <T> the type of the field elements
*/

public class MidpointFieldIntegrator<T extends CalculusFieldElement<T>> extends RungeKuttaFieldIntegrator<T> {
public class MidpointFieldIntegrator<T extends CalculusFieldElement<T>> extends FixedStepRungeKuttaFieldIntegrator<T> {

/** Name of integration scheme. */
public static final String METHOD_NAME = MidpointIntegrator.METHOD_NAME;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*
*/

public class MidpointIntegrator extends RungeKuttaIntegrator {
public class MidpointIntegrator extends FixedStepRungeKuttaIntegrator {

/** Name of integration scheme. */
public static final String METHOD_NAME = "midpoint";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/** This class represents an interpolator over the last step during an
* ODE integration for Runge-Kutta and embedded Runge-Kutta integrators.
*
* @see RungeKuttaFieldIntegrator
* @see FixedStepRungeKuttaFieldIntegrator
* @see EmbeddedRungeKuttaFieldIntegrator
*
* @param <T> the type of the field elements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/** This class represents an interpolator over the last step during an
* ODE integration for Runge-Kutta and embedded Runge-Kutta integrators.
*
* @see RungeKuttaIntegrator
* @see FixedStepRungeKuttaIntegrator
* @see EmbeddedRungeKuttaIntegrator
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
*/

public class ThreeEighthesFieldIntegrator<T extends CalculusFieldElement<T>>
extends RungeKuttaFieldIntegrator<T> {
extends FixedStepRungeKuttaFieldIntegrator<T> {

/** Name of integration scheme. */
public static final String METHOD_NAME = ThreeEighthesIntegrator.METHOD_NAME;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* @see LutherIntegrator
*/

public class ThreeEighthesIntegrator extends RungeKuttaIntegrator {
public class ThreeEighthesIntegrator extends FixedStepRungeKuttaIntegrator {

/** Name of integration scheme. */
public static final String METHOD_NAME = "3/8";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

class ClassicalRungeKuttaFieldIntegratorTest extends RungeKuttaFieldIntegratorAbstractTest {

protected <T extends CalculusFieldElement<T>> RungeKuttaFieldIntegrator<T>
protected <T extends CalculusFieldElement<T>> FixedStepRungeKuttaFieldIntegrator<T>
createIntegrator(Field<T> field, T step) {
return new ClassicalRungeKuttaFieldIntegrator<T>(field, step);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

class ClassicalRungeKuttaIntegratorTest extends RungeKuttaIntegratorAbstractTest {

protected RungeKuttaIntegrator createIntegrator(double step) {
protected FixedStepRungeKuttaIntegrator createIntegrator(double step) {
return new ClassicalRungeKuttaIntegrator(step);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

class EulerFieldIntegratorTest extends RungeKuttaFieldIntegratorAbstractTest {

protected <T extends CalculusFieldElement<T>> RungeKuttaFieldIntegrator<T>
protected <T extends CalculusFieldElement<T>> FixedStepRungeKuttaFieldIntegrator<T>
createIntegrator(Field<T> field, T step) {
return new EulerFieldIntegrator<T>(field, step);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

class EulerIntegratorTest extends RungeKuttaIntegratorAbstractTest {

protected RungeKuttaIntegrator createIntegrator(double step) {
protected FixedStepRungeKuttaIntegrator createIntegrator(double step) {
return new EulerIntegrator(step);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

class GillFieldIntegratorTest extends RungeKuttaFieldIntegratorAbstractTest {

protected <T extends CalculusFieldElement<T>> RungeKuttaFieldIntegrator<T>
protected <T extends CalculusFieldElement<T>> FixedStepRungeKuttaFieldIntegrator<T>
createIntegrator(Field<T> field, T step) {
return new GillFieldIntegrator<T>(field, step);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

class GillIntegratorTest extends RungeKuttaIntegratorAbstractTest {

protected RungeKuttaIntegrator createIntegrator(double step) {
protected FixedStepRungeKuttaIntegrator createIntegrator(double step) {
return new GillIntegrator(step);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

class LutherFieldIntegratorTest extends RungeKuttaFieldIntegratorAbstractTest {

protected <T extends CalculusFieldElement<T>> RungeKuttaFieldIntegrator<T>
protected <T extends CalculusFieldElement<T>> FixedStepRungeKuttaFieldIntegrator<T>
createIntegrator(Field<T> field, T step) {
return new LutherFieldIntegrator<T>(field, step);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

class LutherIntegratorTest extends RungeKuttaIntegratorAbstractTest {

protected RungeKuttaIntegrator createIntegrator(double step) {
protected FixedStepRungeKuttaIntegrator createIntegrator(double step) {
return new LutherIntegrator(step);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

class MidpointFieldIntegratorTest extends RungeKuttaFieldIntegratorAbstractTest {

protected <T extends CalculusFieldElement<T>> RungeKuttaFieldIntegrator<T>
protected <T extends CalculusFieldElement<T>> FixedStepRungeKuttaFieldIntegrator<T>
createIntegrator(Field<T> field, T step) {
return new MidpointFieldIntegrator<T>(field, step);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

class MidpointIntegratorTest extends RungeKuttaIntegratorAbstractTest {

protected RungeKuttaIntegrator createIntegrator(double step) {
protected FixedStepRungeKuttaIntegrator createIntegrator(double step) {
return new MidpointIntegrator(step);
}

Expand Down
Loading

0 comments on commit ea3a499

Please sign in to comment.