Package org.apache.commons.math.optimization

Examples of org.apache.commons.math.optimization.MultiDirectional


                    return x[0] * (1 - x[0]);
                }
            }
      };
      try {
          new MultiDirectional(1.9, 0.4).minimize(wrong, 10, new ValueChecker(1.0e-3),
                                                  new double[] { -0.5 }, new double[] { 0.5 });
          fail("an exception should have been thrown");
      } catch (CostException ce) {
          // expected behavior
          assertNull(ce.getCause());
      } catch (Exception e) {
          fail("wrong exception caught: " + e.getMessage());
      }
      try {
          new MultiDirectional(1.9, 0.4).minimize(wrong, 10, new ValueChecker(1.0e-3),
                                                  new double[] { 0.5 }, new double[] { 1.5 });
          fail("an exception should have been thrown");
      } catch (CostException ce) {
          // expected behavior
          assertNotNull(ce.getCause());
View Full Code Here


        }
      };

    count = 0;
    PointCostPair optimum =
      new MultiDirectional().minimize(rosenbrock, 100, new ValueChecker(1.0e-3),
                                      new double[][] {
                                        { -1.21.0 }, { 0.9, 1.2 } , 3.5, -2.3 }
                                      });

    assertTrue(count > 60);
View Full Code Here

        }
      };

    count = 0;
    PointCostPair optimum =
      new MultiDirectional().minimize(powell, 1000, new ValueChecker(1.0e-3),
                                      new double[] {  3.0, -1.0, 0.0, 1.0 },
                                      new double[] {  4.00.0, 1.0, 2.0 });
    assertTrue(count > 850);
    assertTrue(optimum.getCost() > 0.015);
View Full Code Here

TOP

Related Classes of org.apache.commons.math.optimization.MultiDirectional

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.