commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r669851 - in /commons/proper/math/branches/MATH_2_0/src: java/org/apache/commons/math/ode/ site/xdoc/
Date Fri, 20 Jun 2008 10:59:33 GMT
Author: luc
Date: Fri Jun 20 03:59:33 2008
New Revision: 669851

URL: http://svn.apache.org/viewvc?rev=669851&view=rev
Log:
Changed return type for FirstOrderIntegrator.getSwitchingFunctions()
to a collection of SwitchingFunction instances. This better suits the
intended use of the method and fixes a visibility error since the
previous return type referenced the package private SwitchState class.

JIRA: MATH-210

Modified:
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/AdaptiveStepsizeIntegrator.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/FirstOrderIntegrator.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/RungeKuttaIntegrator.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/SwitchState.java
    commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/SwitchingFunctionsHandler.java
    commons/proper/math/branches/MATH_2_0/src/site/xdoc/changes.xml

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/AdaptiveStepsizeIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/AdaptiveStepsizeIntegrator.java?rev=669851&r1=669850&r2=669851&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/AdaptiveStepsizeIntegrator.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/AdaptiveStepsizeIntegrator.java
Fri Jun 20 03:59:33 2008
@@ -171,7 +171,7 @@
    * @see #addSwitchingFunction(SwitchingFunction, double, double, int)
    * @see #clearSwitchingFunctions()
    */
-  public Collection<SwitchState> getSwitchingFunctions() {
+  public Collection<SwitchingFunction> getSwitchingFunctions() {
       return switchesHandler.getSwitchingFunctions();
   }
 

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/FirstOrderIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/FirstOrderIntegrator.java?rev=669851&r1=669850&r2=669851&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/FirstOrderIntegrator.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/FirstOrderIntegrator.java
Fri Jun 20 03:59:33 2008
@@ -75,7 +75,7 @@
    * @see #addSwitchingFunction(SwitchingFunction, double, double, int)
    * @see #clearSwitchingFunctions()
    */
-  public Collection<SwitchState> getSwitchingFunctions();
+  public Collection<SwitchingFunction> getSwitchingFunctions();
 
   /** Remove all the switching functions that have been added to the integrator.
    * @see #addSwitchingFunction(SwitchingFunction, double, double, int)

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/RungeKuttaIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/RungeKuttaIntegrator.java?rev=669851&r1=669850&r2=669851&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/RungeKuttaIntegrator.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/RungeKuttaIntegrator.java
Fri Jun 20 03:59:33 2008
@@ -113,7 +113,7 @@
    * @see #addSwitchingFunction(SwitchingFunction, double, double, int)
    * @see #clearSwitchingFunctions()
    */
-  public Collection<SwitchState> getSwitchingFunctions() {
+  public Collection<SwitchingFunction> getSwitchingFunctions() {
       return switchesHandler.getSwitchingFunctions();
   }
 

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/SwitchState.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/SwitchState.java?rev=669851&r1=669850&r2=669851&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/SwitchState.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/SwitchState.java
Fri Jun 20 03:59:33 2008
@@ -110,6 +110,13 @@
 
   }
 
+  /** Get the underlying switching function.
+   * @return underlying switching function
+   */
+  public SwitchingFunction getSwitchingFunction() {
+      return function;
+  }
+
   /** Reinitialize the beginning of the step.
    * @param t0 value of the independent <i>time</i> variable at the
    * beginning of the step

Modified: commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/SwitchingFunctionsHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/SwitchingFunctionsHandler.java?rev=669851&r1=669850&r2=669851&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/SwitchingFunctionsHandler.java
(original)
+++ commons/proper/math/branches/MATH_2_0/src/java/org/apache/commons/math/ode/SwitchingFunctionsHandler.java
Fri Jun 20 03:59:33 2008
@@ -65,8 +65,12 @@
    * @see #addSwitchingFunction(SwitchingFunction, double, double, int)
    * @see #clearSwitchingFunctions()
    */
-  public Collection<SwitchState> getSwitchingFunctions() {
-      return Collections.unmodifiableCollection(functions);
+  public Collection<SwitchingFunction> getSwitchingFunctions() {
+      List<SwitchingFunction> list = new ArrayList<SwitchingFunction>();
+      for (SwitchState state : functions) {
+          list.add(state.getSwitchingFunction());
+      }
+      return Collections.unmodifiableCollection(list);
   }
 
   /** Remove all the switching functions that have been added to the handler.

Modified: commons/proper/math/branches/MATH_2_0/src/site/xdoc/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/site/xdoc/changes.xml?rev=669851&r1=669850&r2=669851&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/site/xdoc/changes.xml (original)
+++ commons/proper/math/branches/MATH_2_0/src/site/xdoc/changes.xml Fri Jun 20 03:59:33 2008
@@ -39,6 +39,12 @@
   </properties>
   <body>
     <release version="2.0" date="TBD" description="TBD">
+      <action dev="luc" type="fix" issue="MATH-210" >
+        Changed return type for FirstOrderIntegrator.getSwitchingFunctions()
+        to a collection of SwitchingFunction instances. This better suits the
+        intended use of the method and fixes a visibility error since the
+        previous return type referenced the package private SwitchState class.
+      </action>
       <action dev="luc" type="fix" issue="MATH-209" due-to="Thomas Chust">
         Fixed dimension error on output vector for the operate method
         in RealMatrixImpl and BigMatrixImpl classes.



Mime
View raw message