commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1030947 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/MultiDirectionalSimplex.java
Date Thu, 04 Nov 2010 13:25:30 GMT
Author: erans
Date: Thu Nov  4 13:25:30 2010
New Revision: 1030947

URL: http://svn.apache.org/viewvc?rev=1030947&view=rev
Log:
Added a constructor.

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/MultiDirectionalSimplex.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/MultiDirectionalSimplex.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/MultiDirectionalSimplex.java?rev=1030947&r1=1030946&r2=1030947&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/MultiDirectionalSimplex.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/MultiDirectionalSimplex.java
Thu Nov  4 13:25:30 2010
@@ -46,20 +46,47 @@ public class MultiDirectionalSimplex ext
      * @param n Dimension of the simplex.
      */
     public MultiDirectionalSimplex(final int n) {
-        this(n, DEFAULT_KHI, DEFAULT_GAMMA);
+        this(n, 1d);
+    }
+
+    /**
+     * Build a multi-directional simplex with default coefficients.
+     * The default values are 2.0 for khi and 0.5 for gamma.
+     *
+     * @param n Dimension of the simplex.
+     * @param sideLength Length of the sides of the default (hypercube)
+     * simplex. See {@link AbstractSimplex#AbstractSimplex(int,double)}.
+     */
+    public MultiDirectionalSimplex(final int n, double sideLength) {
+        this(n, sideLength, DEFAULT_KHI, DEFAULT_GAMMA);
     }
 
     /**
      * Build a multi-directional simplex with specified coefficients.
      *
      * @param n Dimension of the simplex. See
-     * {@link AbstractSimplex#AbstractSimplex(int)}.
+     * {@link AbstractSimplex#AbstractSimplex(int,double)}.
      * @param khi Expansion coefficient.
      * @param gamma Contraction coefficient.
      */
     public MultiDirectionalSimplex(final int n,
                                    final double khi, final double gamma) {
-        super(n);
+        this(n, 1d, khi, gamma);
+    }
+
+    /**
+     * Build a multi-directional simplex with specified coefficients.
+     *
+     * @param n Dimension of the simplex. See
+     * {@link AbstractSimplex#AbstractSimplex(int,double)}.
+     * @param sideLength Length of the sides of the default (hypercube)
+     * simplex. See {@link AbstractSimplex#AbstractSimplex(int,double)}.
+     * @param khi Expansion coefficient.
+     * @param gamma Contraction coefficient.
+     */
+    public MultiDirectionalSimplex(final int n, double sideLength,
+                                   final double khi, final double gamma) {
+        super(n, sideLength);
 
         this.khi   = khi;
         this.gamma = gamma;



Mime
View raw message