Commit 088bec84 authored by Luc Maisonobe's avatar Luc Maisonobe

Switched from Apache Commons Math to Hipparchus.

parent cfc6f296
......@@ -22,10 +22,10 @@ Building with Ant:
to configure ant to use it. This is explained
in the ant documentation here:
http://ant.apache.org/manual/proxy.html
- either download the commons-math jar from apache and
- either download the Hipparchus jars from the Hipparchus project and
put it in a lib directory just below the top-level orekit
directory or edit the ant build.xml file to edit the get-apache-commons-math
target that can automatically download commons-math
directory or edit the ant build.xml file to edit the get-hipparchus
target that can automatically download Hipparchus
- run "ant jar" to create a file named
build/orekit-x.y.jar where x.y is the version number
......@@ -40,7 +40,6 @@ Building with Eclipse:
orekit/src/test/resources, orekit/src/tutorials in
the source tab of the Configure Build Path dialog
- set the external libraries to JRE system library (provided by Eclipse),
Junit 4.x (provided by Eclipse) and Apache Commons Math (available at
Apache Software Foundation commons-math
http://commons.apache.org/proper/commons-math/download_math.cgi
in the libraries tab of the Configure Build Path dialog
Junit 4.x (provided by Eclipse) and Hipparchus (available at
https://hipparchus.org/) in the libraries tab of the Configure
Build Path dialog
......@@ -30,3 +30,6 @@ The Apache Software Foundation (http://www.apache.org/)
This product depends on software developed by
The Apache Software Foundation (http://www.apache.org/)
This product depends on software developed by
The Hipparchus project (https://hipparchus.org/)
......@@ -20,9 +20,9 @@ business friendly free licenses.
compile-time/run-time dependency:
- Apache Commons Math from the Apache Software Foundation
http://commons.apache.org/math/
released under the Apache license, version 2
- Hipparchus from the Hipparchus project
https://hipparchus.org/
released under the Apache Software License, version 2
test-time dependency:
......
......@@ -18,15 +18,19 @@
<property name="lib.dir" location="lib" />
<property name="commons-math.version" value="3.6" />
<property name="commons-math.jar" value="commons-math3-${commons-math.version}.jar" />
<property name="commons-math.maven.path" value="org/apache/commons/commons-math3" />
<property name="maven.repository" value="http://repo1.maven.org/maven2" />
<property name="hipparchus.version" value="1.0" />
<property name="hipparchus.core.jar" value="hipparchus-core-${hipparchus.version}.jar" />
<property name="hipparchus.geometry.jar" value="hipparchus-geometry-${hipparchus.version}.jar" />
<property name="hipparchus.ode.jar" value="hipparchus-ode-${hipparchus.version}.jar" />
<property name="hipparchus.fitting.jar" value="hipparchus-fitting-${hipparchus.version}.jar" />
<property name="hipparchus.optim.jar" value="hipparchus-optim-${hipparchus.version}.jar" />
<property name="hipparchus.maven.path" value="org/hipparchus" />
<property name="maven.repository" value="http://repo1.maven.org/maven2" />
<property name="copyright" value="2002-2016 CS Syst&#232;mes d&#039;Information" />
<available classname="org.junit.Test" property="junit4.present" />
<available file="${lib.dir}/${commons-math.jar}" property="apache-commons-math.present" />
<available classname="org.junit.Test" property="junit4.present" />
<available file="${lib.dir}/${hipparchus.core.jar}" property="hipparchus.present" />
<target name="clean" description="Clean the build directory">
<delete dir="${build.dir}"/>
......@@ -40,22 +44,30 @@
description="Clean the build and lib directories">
</target>
<target name="get-apache-commons-math" description="Get Apache commons-math"
unless="apache-commons-math.present">
<target name="get-hipparchus" description="Get Hipparchus"
unless="hipparchus.present">
<!-- if you need to set up a proxy to download artifacts,
uncomment and edit the following setproxy task -->
<!-- <setproxy proxyhost="my-proxy.my-company.com" proxyport="8080"
proxyUser="username" proxyPassword="password"/> -->
<mkdir dir="${lib.dir}"/>
<get src="${maven.repository}/${commons-math.maven.path}/${commons-math.version}/${commons-math.jar}"
dest="${lib.dir}/${commons-math.jar}"/>
<get src="${maven.repository}/${hipparchus.maven.path}/${hipparchus.version}/${hipparchus.core.jar}"
dest="${lib.dir}/${hipparchus.core.jar}"/>
<get src="${maven.repository}/${hipparchus.maven.path}/${hipparchus.version}/${hipparchus.geometry.jar}"
dest="${lib.dir}/${hipparchus.geometry.jar}"/>
<get src="${maven.repository}/${hipparchus.maven.path}/${hipparchus.version}/${hipparchus.ode.jar}"
dest="${lib.dir}/${hipparchus.ode.jar}"/>
<get src="${maven.repository}/${hipparchus.maven.path}/${hipparchus.version}/${hipparchus.fitting.jar}"
dest="${lib.dir}/${hipparchus.fitting.jar}"/>
<get src="${maven.repository}/${hipparchus.maven.path}/${hipparchus.version}/${hipparchus.optim.jar}"
dest="${lib.dir}/${hipparchus.optim.jar}"/>
</target>
<target name="compile" depends="get-apache-commons-math" description="Compile the code">
<target name="compile" depends="get-hipparchus" description="Compile the code">
<mkdir dir="${main.classes.dir}"/>
<javac srcdir="${main.src.dir}" destdir="${main.classes.dir}"
classpath="${lib.dir}/${commons-math.jar}"
deprecation="true" target="1.6" source="1.6">
classpath="${lib.dir}/${hipparchus.core.jar}:${lib.dir}/${hipparchus.geometry.jar}:${lib.dir}/${hipparchus.ode.jar}:${lib.dir}/${hipparchus.fitting.jar}:${lib.dir}/${hipparchus.optim.jar}"
deprecation="true" target="1.8" source="1.8">
</javac>
<copy todir="${main.classes.dir}">
<fileset dir="${main.resources.dir}"/>
......@@ -66,8 +78,8 @@
description="Compile the test code" if="junit4.present">
<mkdir dir="${test.classes.dir}"/>
<javac srcdir="${test.src.dir}" destdir="${test.classes.dir}"
classpath="${main.classes.dir}:${lib.dir}/${commons-math.jar}"
deprecation="true" target="1.6" source="1.6">
classpath="${lib.dir}/${hipparchus.core.jar}:${lib.dir}/${hipparchus.geometry.jar}:${lib.dir}/${hipparchus.ode.jar}:${lib.dir}/${hipparchus.fitting.jar}:${lib.dir}/${hipparchus.optim.jar}"
deprecation="true" target="1.8" source="1.8">
</javac>
<copy todir="${test.classes.dir}">
<fileset dir="${test.resources.dir}"/>
......@@ -80,7 +92,7 @@
<classpath>
<pathelement location="${main.classes.dir}" />
<pathelement location="${test.classes.dir}" />
<pathelement location="${lib.dir}/${commons-math.jar}" />
<pathelement location="${lib.dir}/${hipparchus.jar}" />
</classpath>
<formatter type="brief"/>
<batchtest todir="${tests.reports}">
......@@ -103,8 +115,8 @@
encoding="UTF-8" version="true" use="true" author="true"
charset="UTF-8" docencoding="UTF-8"
bottom="&lt;i&gt;Copyright &#169; ${copyright}. All Rights Reserved.&lt;/i&gt;">
<link href="http://docs.oracle.com/javase/6/docs/api/"/>
<link href="http://commons.apache.org/proper/commons-math/javadocs/api-${commons-math.version}/"/>
<link href="http://docs.oracle.com/javase/8/docs/api/"/>
<link href="https://hipparchis.org/version-${hipparchus.version}/apidoc/"/>
</javadoc>
</target>
......
......@@ -5,7 +5,7 @@
<groupId>org.orekit</groupId>
<artifactId>orekit</artifactId>
<packaging>jar</packaging>
<version>7.3-SNAPSHOT</version>
<version>8.0-SNAPSHOT</version>
<name>ORbit Extrapolation KIT</name>
<url>http://www.orekit.org/</url>
......@@ -40,10 +40,10 @@
<orekit.maven-surefire-plugin.version>2.19.1</orekit.maven-surefire-plugin.version>
<orekit.maven-surefire-report-plugin.version>2.19.1</orekit.maven-surefire-report-plugin.version>
<orekit.jgit.buildnumber.version>1.2.10</orekit.jgit.buildnumber.version>
<orekit.apache-commons-math.version>3.6.1</orekit.apache-commons-math.version>
<orekit.hipparchus.version>1.0-SNAPSHOT</orekit.hipparchus.version>
<orekit.junit.version>4.12</orekit.junit.version>
<orekit.compiler.source>1.6</orekit.compiler.source>
<orekit.compiler.target>1.6</orekit.compiler.target>
<orekit.compiler.source>1.8</orekit.compiler.source>
<orekit.compiler.target>1.8</orekit.compiler.target>
<orekit.implementation.build>${git.revision}; ${maven.build.timestamp}</orekit.implementation.build>
</properties>
......@@ -244,13 +244,41 @@
</mailingLists>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
<version>${orekit.apache-commons-math.version}</version>
<type>jar</type>
<optional>false</optional>
</dependency>
<dependency>
<groupId>org.hipparchus</groupId>
<artifactId>hipparchus-core</artifactId>
<version>${orekit.hipparchus.version}</version>
<type>jar</type>
<optional>false</optional>
</dependency>
<dependency>
<groupId>org.hipparchus</groupId>
<artifactId>hipparchus-geometry</artifactId>
<version>${orekit.hipparchus.version}</version>
<type>jar</type>
<optional>false</optional>
</dependency>
<dependency>
<groupId>org.hipparchus</groupId>
<artifactId>hipparchus-ode</artifactId>
<version>${orekit.hipparchus.version}</version>
<type>jar</type>
<optional>false</optional>
</dependency>
<dependency>
<groupId>org.hipparchus</groupId>
<artifactId>hipparchus-fitting</artifactId>
<version>${orekit.hipparchus.version}</version>
<type>jar</type>
<optional>false</optional>
</dependency>
<dependency>
<groupId>org.hipparchus</groupId>
<artifactId>hipparchus-optim</artifactId>
<version>${orekit.hipparchus.version}</version>
<type>jar</type>
<optional>false</optional>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
......@@ -588,7 +616,7 @@
<bottom><![CDATA[Copyright &copy; ${project.inceptionYear}-{currentYear} <a href="http://www.c-s.fr">CS Syst&egrave;mes d&apos;information</a>. All rights reserved.]]></bottom>
<links>
<link>http://docs.oracle.com/javase/6/docs/api/</link>
<link>http://commons.apache.org/math/javadocs/api-${orekit.apache-commons-math.version}</link>
<link>https://hipparchus.org/version-${orekit.hipparchus.version}/apidoc/</link>
</links>
</configuration>
<reportSets>
......
......@@ -26,7 +26,7 @@
skinparam ClassFontSize 11
skinparam PackageFontSize 12
package org.apache.commons.math3.ode #DDEBD8 {
package org.hipparchus.ode #DDEBD8 {
interface FirstOrderIntegrator
......
......@@ -26,7 +26,7 @@
skinparam ClassFontSize 11
skinparam PackageFontSize 12
package org.apache.commons.math4.fitting.leastsquares #ECEBD8 {
package org.hipparchus.fitting.leastsquares #ECEBD8 {
interface LeastSquaresOptimizer
interface LeastSquaresProblem
......
......@@ -26,7 +26,7 @@
skinparam ClassFontSize 11
skinparam PackageFontSize 12
package org.apache.commons.math3.ode #ECEBD8 {
package org.hipparchus.ode #ECEBD8 {
interface Parameterizable {
+Collection<String> getParametersNames()
......
......@@ -26,7 +26,7 @@
skinparam ClassFontSize 11
skinparam PackageFontSize 12
package "Apache Commons Math" #F3EDF7 {
package "Hipparchus" #F3EDF7 {
class SphericalPolygonsSet #EAE6F7/B9B3D2
}
......
......@@ -21,9 +21,9 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.apache.commons.math3.geometry.euclidean.threed.Rotation;
import org.apache.commons.math3.geometry.euclidean.threed.RotationConvention;
import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
import org.hipparchus.geometry.euclidean.threed.Rotation;
import org.hipparchus.geometry.euclidean.threed.RotationConvention;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.orekit.errors.OrekitException;
import org.orekit.frames.Frame;
import org.orekit.frames.Transform;
......
......@@ -16,9 +16,9 @@
*/
package org.orekit.attitudes;
import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
import org.apache.commons.math3.util.FastMath;
import org.apache.commons.math3.util.MathArrays;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.hipparchus.util.FastMath;
import org.hipparchus.util.MathArrays;
import org.orekit.bodies.Ellipsoid;
import org.orekit.errors.OrekitException;
import org.orekit.frames.Frame;
......
......@@ -16,8 +16,8 @@
*/
package org.orekit.attitudes;
import org.apache.commons.math3.geometry.euclidean.threed.Rotation;
import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
import org.hipparchus.geometry.euclidean.threed.Rotation;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.orekit.errors.OrekitException;
import org.orekit.frames.Frame;
import org.orekit.frames.Transform;
......
......@@ -16,8 +16,8 @@
*/
package org.orekit.attitudes;
import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
import org.apache.commons.math3.util.FastMath;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.hipparchus.util.FastMath;
import org.orekit.errors.OrekitException;
import org.orekit.errors.OrekitMessages;
import org.orekit.frames.Frame;
......
......@@ -16,7 +16,7 @@
*/
package org.orekit.attitudes;
import org.apache.commons.math3.geometry.euclidean.threed.Rotation;
import org.hipparchus.geometry.euclidean.threed.Rotation;
import org.orekit.errors.OrekitException;
import org.orekit.frames.Frame;
import org.orekit.frames.FramesFactory;
......
......@@ -16,9 +16,9 @@
*/
package org.orekit.attitudes;
import org.apache.commons.math3.geometry.euclidean.threed.Rotation;
import org.apache.commons.math3.geometry.euclidean.threed.RotationConvention;
import org.apache.commons.math3.geometry.euclidean.threed.RotationOrder;
import org.hipparchus.geometry.euclidean.threed.Rotation;
import org.hipparchus.geometry.euclidean.threed.RotationConvention;
import org.hipparchus.geometry.euclidean.threed.RotationOrder;
import org.orekit.errors.OrekitException;
import org.orekit.errors.OrekitMessages;
import org.orekit.frames.Frame;
......@@ -69,11 +69,11 @@ public class LofOffset implements AttitudeProvider {
* An important thing to note is that the rotation order and angles signs used here
* are compliant with an <em>attitude</em> definition, i.e. they correspond to
* a frame that rotate in a field of fixed vectors. The underlying definitions used
* in commons-math {@link org.apache.commons.math3.geometry.euclidean.threed.Rotation#Rotation(RotationOrder,
* in Hipparchus {@link org.hipparchus.geometry.euclidean.threed.Rotation#Rotation(RotationOrder,
* double, double, double) Rotation(RotationOrder, double, double, double)} use
* <em>reversed</em> definition, i.e. they correspond to a vectors field rotating
* with respect to a fixed frame. So to retrieve the angles provided here from the
* commons-math underlying rotation, one has to <em>revert</em> the rotation, as in
* Hipparchus underlying rotation, one has to <em>revert</em> the rotation, as in
* the following code snippet:
* </p>
* <pre>
......
......@@ -19,8 +19,8 @@ package org.orekit.attitudes;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.math3.geometry.euclidean.threed.Line;
import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
import org.hipparchus.geometry.euclidean.threed.Line;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.orekit.bodies.BodyShape;
import org.orekit.bodies.GeodeticPoint;
import org.orekit.errors.OrekitException;
......
......@@ -19,7 +19,7 @@ package org.orekit.attitudes;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.orekit.bodies.BodyShape;
import org.orekit.bodies.GeodeticPoint;
import org.orekit.errors.OrekitException;
......
......@@ -16,9 +16,9 @@
*/
package org.orekit.attitudes;
import org.apache.commons.math3.geometry.euclidean.threed.Rotation;
import org.apache.commons.math3.geometry.euclidean.threed.RotationConvention;
import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
import org.hipparchus.geometry.euclidean.threed.Rotation;
import org.hipparchus.geometry.euclidean.threed.RotationConvention;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.orekit.errors.OrekitException;
import org.orekit.frames.Frame;
import org.orekit.frames.Transform;
......
......@@ -16,7 +16,7 @@
*/
package org.orekit.attitudes;
import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.orekit.bodies.BodyShape;
import org.orekit.bodies.GeodeticPoint;
import org.orekit.errors.OrekitException;
......
......@@ -16,9 +16,9 @@
*/
package org.orekit.attitudes;
import org.apache.commons.math3.geometry.euclidean.threed.Rotation;
import org.apache.commons.math3.geometry.euclidean.threed.RotationConvention;
import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
import org.hipparchus.geometry.euclidean.threed.Rotation;
import org.hipparchus.geometry.euclidean.threed.RotationConvention;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.orekit.errors.OrekitException;
import org.orekit.frames.Frame;
import org.orekit.frames.Transform;
......
......@@ -16,7 +16,7 @@
*/
package org.orekit.attitudes;
import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.orekit.errors.OrekitException;
import org.orekit.frames.Frame;
import org.orekit.time.AbsoluteDate;
......
......@@ -18,8 +18,8 @@ package org.orekit.bodies;
import java.io.Serializable;
import org.apache.commons.math3.geometry.euclidean.threed.Line;
import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
import org.hipparchus.geometry.euclidean.threed.Line;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.orekit.errors.OrekitException;
import org.orekit.frames.Frame;
import org.orekit.time.AbsoluteDate;
......
......@@ -38,8 +38,8 @@ import org.orekit.errors.OrekitMessages;
* solar system barycenter centered, Jupiter-centered. The defining transforms
* of these frames are combinations of simple linear {@link
* org.orekit.frames.Transform#Transform(org.orekit.time.AbsoluteDate,
* org.apache.commons.math3.geometry.euclidean.threed.Vector3D,
* org.apache.commons.math3.geometry.euclidean.threed.Vector3D) translation/velocity} transforms
* org.hipparchus.geometry.euclidean.threed.Vector3D,
* org.hipparchus.geometry.euclidean.threed.Vector3D) translation/velocity} transforms
* without any rotation. The frame axes are therefore always parallel to
* {@link org.orekit.frames.FramesFactory#getEME2000() EME2000} frame axes.</p>
* <p>The position of the bodies provided by this class are interpolated using
......
......@@ -18,10 +18,10 @@ package org.orekit.bodies;
import java.io.Serializable;
import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
import org.apache.commons.math3.geometry.euclidean.twod.Vector2D;
import org.apache.commons.math3.util.FastMath;
import org.apache.commons.math3.util.MathArrays;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.hipparchus.geometry.euclidean.twod.Vector2D;
import org.hipparchus.util.FastMath;
import org.hipparchus.util.MathArrays;
import org.orekit.frames.Frame;
import org.orekit.utils.TimeStampedPVCoordinates;
......
......@@ -18,12 +18,12 @@ package org.orekit.bodies;
import java.io.Serializable;
import org.apache.commons.math3.exception.MathArithmeticException;
import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
import org.apache.commons.math3.geometry.euclidean.twod.Vector2D;
import org.apache.commons.math3.util.FastMath;
import org.apache.commons.math3.util.MathArrays;
import org.apache.commons.math3.util.Precision;
import org.hipparchus.exception.MathRuntimeException;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.hipparchus.geometry.euclidean.twod.Vector2D;
import org.hipparchus.util.FastMath;
import org.hipparchus.util.MathArrays;
import org.hipparchus.util.Precision;
import org.orekit.errors.OrekitException;
import org.orekit.errors.OrekitMessages;
import org.orekit.frames.Frame;
......@@ -108,8 +108,10 @@ public class Ellipsoid implements Serializable {