Return-Path: Delivered-To: apmail-commons-commits-archive@locus.apache.org Received: (qmail 28305 invoked from network); 10 Sep 2007 08:23:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Sep 2007 08:23:43 -0000 Received: (qmail 70082 invoked by uid 500); 10 Sep 2007 08:23:36 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 70008 invoked by uid 500); 10 Sep 2007 08:23:36 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 69999 invoked by uid 99); 10 Sep 2007 08:23:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Sep 2007 01:23:36 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Sep 2007 08:23:42 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id EB4EB1A9838; Mon, 10 Sep 2007 01:23:21 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r574169 - /commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/NelderMeadTest.java Date: Mon, 10 Sep 2007 08:23:21 -0000 To: commits@commons.apache.org From: luc@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20070910082321.EB4EB1A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: luc Date: Mon Sep 10 01:23:21 2007 New Revision: 574169 URL: http://svn.apache.org/viewvc?rev=574169&view=rev Log: improved test coverage Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/NelderMeadTest.java Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/NelderMeadTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/NelderMeadTest.java?rev=574169&r1=574168&r2=574169&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/NelderMeadTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/NelderMeadTest.java Mon Sep 10 01:23:21 2007 @@ -106,18 +106,27 @@ nm.minimizes(rosenbrock, 100, new ValueChecker(1.0e-3), new double[][] { { -1.2, 1.0 }, { 0.9, 1.2 }, { 3.5, -2.3 } - }, 3, 1642738l); + }, 10, 1642738l); - assertTrue(count < 200); + assertTrue(count > 700); + assertTrue(count < 800); assertEquals(0.0, optimum.cost, 5.0e-5); assertEquals(1.0, optimum.point[0], 0.01); assertEquals(1.0, optimum.point[1], 0.01); PointCostPair[] minima = nm.getMinima(); - assertEquals(3, minima.length); - for (int i = 1; i < minima.length; ++i) { - if (minima[i] != null) { - assertTrue(minima[i-1].cost <= minima[i].cost); + assertEquals(10, minima.length); + assertNotNull(minima[0]); + assertNull(minima[minima.length - 1]); + for (int i = 0; i < minima.length; ++i) { + if (minima[i] == null) { + if ((i + 1) < minima.length) { + assertTrue(minima[i+1] == null); + } + } else { + if (i > 0) { + assertTrue(minima[i-1].cost <= minima[i].cost); + } } }