Modified: websites/production/commons/content/proper/commons-math/testapidocs/src-html/org/apache/commons/math3/optim/nonlinear/vector/jacobian/GaussNewtonOptimizerTest.html ============================================================================== --- websites/production/commons/content/proper/commons-math/testapidocs/src-html/org/apache/commons/math3/optim/nonlinear/vector/jacobian/GaussNewtonOptimizerTest.html (original) +++ websites/production/commons/content/proper/commons-math/testapidocs/src-html/org/apache/commons/math3/optim/nonlinear/vector/jacobian/GaussNewtonOptimizerTest.html Sat Apr 6 23:42:01 2013 @@ -23,143 +23,155 @@ <FONT color="green">020</FONT> import java.io.IOException;<a name="line.20"></a> <FONT color="green">021</FONT> import org.apache.commons.math3.exception.ConvergenceException;<a name="line.21"></a> <FONT color="green">022</FONT> import org.apache.commons.math3.exception.TooManyEvaluationsException;<a name="line.22"></a> -<FONT color="green">023</FONT> import org.apache.commons.math3.optim.SimpleVectorValueChecker;<a name="line.23"></a> -<FONT color="green">024</FONT> import org.apache.commons.math3.optim.InitialGuess;<a name="line.24"></a> -<FONT color="green">025</FONT> import org.apache.commons.math3.optim.MaxEval;<a name="line.25"></a> -<FONT color="green">026</FONT> import org.apache.commons.math3.optim.nonlinear.vector.Target;<a name="line.26"></a> -<FONT color="green">027</FONT> import org.apache.commons.math3.optim.nonlinear.vector.Weight;<a name="line.27"></a> -<FONT color="green">028</FONT> import org.apache.commons.math3.optim.nonlinear.vector.ModelFunction;<a name="line.28"></a> -<FONT color="green">029</FONT> import org.apache.commons.math3.optim.nonlinear.vector.ModelFunctionJacobian;<a name="line.29"></a> -<FONT color="green">030</FONT> import org.junit.Test;<a name="line.30"></a> -<FONT color="green">031</FONT> <a name="line.31"></a> -<FONT color="green">032</FONT> /**<a name="line.32"></a> -<FONT color="green">033</FONT> * <p>Some of the unit tests are re-implementations of the MINPACK <a<a name="line.33"></a> -<FONT color="green">034</FONT> * href="http://www.netlib.org/minpack/ex/file17">file17</a> and <a<a name="line.34"></a> -<FONT color="green">035</FONT> * href="http://www.netlib.org/minpack/ex/file22">file22</a> test files.<a name="line.35"></a> -<FONT color="green">036</FONT> * The redistribution policy for MINPACK is available <a<a name="line.36"></a> -<FONT color="green">037</FONT> * href="http://www.netlib.org/minpack/disclaimer">here</a>, for<a name="line.37"></a> -<FONT color="green">038</FONT> * convenience, it is reproduced below.</p><a name="line.38"></a> -<FONT color="green">039</FONT> <a name="line.39"></a> -<FONT color="green">040</FONT> * <table border="0" width="80%" cellpadding="10" align="center" bgcolor="#E0E0E0"><a name="line.40"></a> -<FONT color="green">041</FONT> * <tr><td><a name="line.41"></a> -<FONT color="green">042</FONT> * Minpack Copyright Notice (1999) University of Chicago.<a name="line.42"></a> -<FONT color="green">043</FONT> * All rights reserved<a name="line.43"></a> -<FONT color="green">044</FONT> * </td></tr><a name="line.44"></a> -<FONT color="green">045</FONT> * <tr><td><a name="line.45"></a> -<FONT color="green">046</FONT> * Redistribution and use in source and binary forms, with or without<a name="line.46"></a> -<FONT color="green">047</FONT> * modification, are permitted provided that the following conditions<a name="line.47"></a> -<FONT color="green">048</FONT> * are met:<a name="line.48"></a> -<FONT color="green">049</FONT> * <ol><a name="line.49"></a> -<FONT color="green">050</FONT> * <li>Redistributions of source code must retain the above copyright<a name="line.50"></a> -<FONT color="green">051</FONT> * notice, this list of conditions and the following disclaimer.</li><a name="line.51"></a> -<FONT color="green">052</FONT> * <li>Redistributions in binary form must reproduce the above<a name="line.52"></a> -<FONT color="green">053</FONT> * copyright notice, this list of conditions and the following<a name="line.53"></a> -<FONT color="green">054</FONT> * disclaimer in the documentation and/or other materials provided<a name="line.54"></a> -<FONT color="green">055</FONT> * with the distribution.</li><a name="line.55"></a> -<FONT color="green">056</FONT> * <li>The end-user documentation included with the redistribution, if any,<a name="line.56"></a> -<FONT color="green">057</FONT> * must include the following acknowledgment:<a name="line.57"></a> -<FONT color="green">058</FONT> * <code>This product includes software developed by the University of<a name="line.58"></a> -<FONT color="green">059</FONT> * Chicago, as Operator of Argonne National Laboratory.</code><a name="line.59"></a> -<FONT color="green">060</FONT> * Alternately, this acknowledgment may appear in the software itself,<a name="line.60"></a> -<FONT color="green">061</FONT> * if and wherever such third-party acknowledgments normally appear.</li><a name="line.61"></a> -<FONT color="green">062</FONT> * <li><strong>WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS"<a name="line.62"></a> -<FONT color="green">063</FONT> * WITHOUT WARRANTY OF ANY KIND. THE COPYRIGHT HOLDER, THE<a name="line.63"></a> -<FONT color="green">064</FONT> * UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND<a name="line.64"></a> -<FONT color="green">065</FONT> * THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR<a name="line.65"></a> -<FONT color="green">066</FONT> * IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES<a name="line.66"></a> -<FONT color="green">067</FONT> * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE<a name="line.67"></a> -<FONT color="green">068</FONT> * OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY<a name="line.68"></a> -<FONT color="green">069</FONT> * OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR<a name="line.69"></a> -<FONT color="green">070</FONT> * USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF<a name="line.70"></a> -<FONT color="green">071</FONT> * THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4)<a name="line.71"></a> -<FONT color="green">072</FONT> * DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION<a name="line.72"></a> -<FONT color="green">073</FONT> * UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL<a name="line.73"></a> -<FONT color="green">074</FONT> * BE CORRECTED.</strong></li><a name="line.74"></a> -<FONT color="green">075</FONT> * <li><strong>LIMITATION OF LIABILITY. IN NO EVENT WILL THE COPYRIGHT<a name="line.75"></a> -<FONT color="green">076</FONT> * HOLDER, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF<a name="line.76"></a> -<FONT color="green">077</FONT> * ENERGY, OR THEIR EMPLOYEES: BE LIABLE FOR ANY INDIRECT,<a name="line.77"></a> -<FONT color="green">078</FONT> * INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF<a name="line.78"></a> -<FONT color="green">079</FONT> * ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF<a name="line.79"></a> -<FONT color="green">080</FONT> * PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER<a name="line.80"></a> -<FONT color="green">081</FONT> * SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT<a name="line.81"></a> -<FONT color="green">082</FONT> * (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE,<a name="line.82"></a> -<FONT color="green">083</FONT> * EVEN IF ANY OF SAID PARTIES HAS BEEN WARNED OF THE<a name="line.83"></a> -<FONT color="green">084</FONT> * POSSIBILITY OF SUCH LOSS OR DAMAGES.</strong></li><a name="line.84"></a> -<FONT color="green">085</FONT> * <ol></td></tr><a name="line.85"></a> -<FONT color="green">086</FONT> * </table><a name="line.86"></a> -<FONT color="green">087</FONT> <a name="line.87"></a> -<FONT color="green">088</FONT> * @author Argonne National Laboratory. MINPACK project. March 1980 (original fortran minpack tests)<a name="line.88"></a> -<FONT color="green">089</FONT> * @author Burton S. Garbow (original fortran minpack tests)<a name="line.89"></a> -<FONT color="green">090</FONT> * @author Kenneth E. Hillstrom (original fortran minpack tests)<a name="line.90"></a> -<FONT color="green">091</FONT> * @author Jorge J. More (original fortran minpack tests)<a name="line.91"></a> -<FONT color="green">092</FONT> * @author Luc Maisonobe (non-minpack tests and minpack tests Java translation)<a name="line.92"></a> -<FONT color="green">093</FONT> */<a name="line.93"></a> -<FONT color="green">094</FONT> public class GaussNewtonOptimizerTest<a name="line.94"></a> -<FONT color="green">095</FONT> extends AbstractLeastSquaresOptimizerAbstractTest {<a name="line.95"></a> -<FONT color="green">096</FONT> <a name="line.96"></a> -<FONT color="green">097</FONT> @Override<a name="line.97"></a> -<FONT color="green">098</FONT> public AbstractLeastSquaresOptimizer createOptimizer() {<a name="line.98"></a> -<FONT color="green">099</FONT> return new GaussNewtonOptimizer(new SimpleVectorValueChecker(1.0e-6, 1.0e-6));<a name="line.99"></a> -<FONT color="green">100</FONT> }<a name="line.100"></a> -<FONT color="green">101</FONT> <a name="line.101"></a> -<FONT color="green">102</FONT> @Override<a name="line.102"></a> -<FONT color="green">103</FONT> @Test(expected = ConvergenceException.class)<a name="line.103"></a> -<FONT color="green">104</FONT> public void testMoreEstimatedParametersSimple() {<a name="line.104"></a> -<FONT color="green">105</FONT> /*<a name="line.105"></a> -<FONT color="green">106</FONT> * Exception is expected with this optimizer<a name="line.106"></a> -<FONT color="green">107</FONT> */<a name="line.107"></a> -<FONT color="green">108</FONT> super.testMoreEstimatedParametersSimple();<a name="line.108"></a> -<FONT color="green">109</FONT> }<a name="line.109"></a> -<FONT color="green">110</FONT> <a name="line.110"></a> -<FONT color="green">111</FONT> @Override<a name="line.111"></a> -<FONT color="green">112</FONT> @Test(expected=ConvergenceException.class)<a name="line.112"></a> -<FONT color="green">113</FONT> public void testMoreEstimatedParametersUnsorted() {<a name="line.113"></a> -<FONT color="green">114</FONT> /*<a name="line.114"></a> -<FONT color="green">115</FONT> * Exception is expected with this optimizer<a name="line.115"></a> -<FONT color="green">116</FONT> */<a name="line.116"></a> -<FONT color="green">117</FONT> super.testMoreEstimatedParametersUnsorted();<a name="line.117"></a> -<FONT color="green">118</FONT> }<a name="line.118"></a> -<FONT color="green">119</FONT> <a name="line.119"></a> -<FONT color="green">120</FONT> @Test(expected=TooManyEvaluationsException.class)<a name="line.120"></a> -<FONT color="green">121</FONT> public void testMaxEvaluations() throws Exception {<a name="line.121"></a> -<FONT color="green">122</FONT> CircleVectorial circle = new CircleVectorial();<a name="line.122"></a> -<FONT color="green">123</FONT> circle.addPoint( 30.0, 68.0);<a name="line.123"></a> -<FONT color="green">124</FONT> circle.addPoint( 50.0, -6.0);<a name="line.124"></a> -<FONT color="green">125</FONT> circle.addPoint(110.0, -20.0);<a name="line.125"></a> -<FONT color="green">126</FONT> circle.addPoint( 35.0, 15.0);<a name="line.126"></a> -<FONT color="green">127</FONT> circle.addPoint( 45.0, 97.0);<a name="line.127"></a> -<FONT color="green">128</FONT> <a name="line.128"></a> -<FONT color="green">129</FONT> GaussNewtonOptimizer optimizer<a name="line.129"></a> -<FONT color="green">130</FONT> = new GaussNewtonOptimizer(new SimpleVectorValueChecker(1e-30, 1e-30));<a name="line.130"></a> +<FONT color="green">023</FONT> import org.apache.commons.math3.exception.MathUnsupportedOperationException;<a name="line.23"></a> +<FONT color="green">024</FONT> import org.apache.commons.math3.optim.SimpleVectorValueChecker;<a name="line.24"></a> +<FONT color="green">025</FONT> import org.apache.commons.math3.optim.InitialGuess;<a name="line.25"></a> +<FONT color="green">026</FONT> import org.apache.commons.math3.optim.MaxEval;<a name="line.26"></a> +<FONT color="green">027</FONT> import org.apache.commons.math3.optim.SimpleBounds;<a name="line.27"></a> +<FONT color="green">028</FONT> import org.apache.commons.math3.optim.nonlinear.vector.Target;<a name="line.28"></a> +<FONT color="green">029</FONT> import org.apache.commons.math3.optim.nonlinear.vector.Weight;<a name="line.29"></a> +<FONT color="green">030</FONT> import org.apache.commons.math3.optim.nonlinear.vector.ModelFunction;<a name="line.30"></a> +<FONT color="green">031</FONT> import org.apache.commons.math3.optim.nonlinear.vector.ModelFunctionJacobian;<a name="line.31"></a> +<FONT color="green">032</FONT> import org.junit.Test;<a name="line.32"></a> +<FONT color="green">033</FONT> <a name="line.33"></a> +<FONT color="green">034</FONT> /**<a name="line.34"></a> +<FONT color="green">035</FONT> * <p>Some of the unit tests are re-implementations of the MINPACK <a<a name="line.35"></a> +<FONT color="green">036</FONT> * href="http://www.netlib.org/minpack/ex/file17">file17</a> and <a<a name="line.36"></a> +<FONT color="green">037</FONT> * href="http://www.netlib.org/minpack/ex/file22">file22</a> test files.<a name="line.37"></a> +<FONT color="green">038</FONT> * The redistribution policy for MINPACK is available <a<a name="line.38"></a> +<FONT color="green">039</FONT> * href="http://www.netlib.org/minpack/disclaimer">here</a>, for<a name="line.39"></a> +<FONT color="green">040</FONT> * convenience, it is reproduced below.</p><a name="line.40"></a> +<FONT color="green">041</FONT> <a name="line.41"></a> +<FONT color="green">042</FONT> * <table border="0" width="80%" cellpadding="10" align="center" bgcolor="#E0E0E0"><a name="line.42"></a> +<FONT color="green">043</FONT> * <tr><td><a name="line.43"></a> +<FONT color="green">044</FONT> * Minpack Copyright Notice (1999) University of Chicago.<a name="line.44"></a> +<FONT color="green">045</FONT> * All rights reserved<a name="line.45"></a> +<FONT color="green">046</FONT> * </td></tr><a name="line.46"></a> +<FONT color="green">047</FONT> * <tr><td><a name="line.47"></a> +<FONT color="green">048</FONT> * Redistribution and use in source and binary forms, with or without<a name="line.48"></a> +<FONT color="green">049</FONT> * modification, are permitted provided that the following conditions<a name="line.49"></a> +<FONT color="green">050</FONT> * are met:<a name="line.50"></a> +<FONT color="green">051</FONT> * <ol><a name="line.51"></a> +<FONT color="green">052</FONT> * <li>Redistributions of source code must retain the above copyright<a name="line.52"></a> +<FONT color="green">053</FONT> * notice, this list of conditions and the following disclaimer.</li><a name="line.53"></a> +<FONT color="green">054</FONT> * <li>Redistributions in binary form must reproduce the above<a name="line.54"></a> +<FONT color="green">055</FONT> * copyright notice, this list of conditions and the following<a name="line.55"></a> +<FONT color="green">056</FONT> * disclaimer in the documentation and/or other materials provided<a name="line.56"></a> +<FONT color="green">057</FONT> * with the distribution.</li><a name="line.57"></a> +<FONT color="green">058</FONT> * <li>The end-user documentation included with the redistribution, if any,<a name="line.58"></a> +<FONT color="green">059</FONT> * must include the following acknowledgment:<a name="line.59"></a> +<FONT color="green">060</FONT> * <code>This product includes software developed by the University of<a name="line.60"></a> +<FONT color="green">061</FONT> * Chicago, as Operator of Argonne National Laboratory.</code><a name="line.61"></a> +<FONT color="green">062</FONT> * Alternately, this acknowledgment may appear in the software itself,<a name="line.62"></a> +<FONT color="green">063</FONT> * if and wherever such third-party acknowledgments normally appear.</li><a name="line.63"></a> +<FONT color="green">064</FONT> * <li><strong>WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS"<a name="line.64"></a> +<FONT color="green">065</FONT> * WITHOUT WARRANTY OF ANY KIND. THE COPYRIGHT HOLDER, THE<a name="line.65"></a> +<FONT color="green">066</FONT> * UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND<a name="line.66"></a> +<FONT color="green">067</FONT> * THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR<a name="line.67"></a> +<FONT color="green">068</FONT> * IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES<a name="line.68"></a> +<FONT color="green">069</FONT> * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE<a name="line.69"></a> +<FONT color="green">070</FONT> * OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY<a name="line.70"></a> +<FONT color="green">071</FONT> * OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR<a name="line.71"></a> +<FONT color="green">072</FONT> * USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF<a name="line.72"></a> +<FONT color="green">073</FONT> * THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4)<a name="line.73"></a> +<FONT color="green">074</FONT> * DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION<a name="line.74"></a> +<FONT color="green">075</FONT> * UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL<a name="line.75"></a> +<FONT color="green">076</FONT> * BE CORRECTED.</strong></li><a name="line.76"></a> +<FONT color="green">077</FONT> * <li><strong>LIMITATION OF LIABILITY. IN NO EVENT WILL THE COPYRIGHT<a name="line.77"></a> +<FONT color="green">078</FONT> * HOLDER, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF<a name="line.78"></a> +<FONT color="green">079</FONT> * ENERGY, OR THEIR EMPLOYEES: BE LIABLE FOR ANY INDIRECT,<a name="line.79"></a> +<FONT color="green">080</FONT> * INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF<a name="line.80"></a> +<FONT color="green">081</FONT> * ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF<a name="line.81"></a> +<FONT color="green">082</FONT> * PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER<a name="line.82"></a> +<FONT color="green">083</FONT> * SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT<a name="line.83"></a> +<FONT color="green">084</FONT> * (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE,<a name="line.84"></a> +<FONT color="green">085</FONT> * EVEN IF ANY OF SAID PARTIES HAS BEEN WARNED OF THE<a name="line.85"></a> +<FONT color="green">086</FONT> * POSSIBILITY OF SUCH LOSS OR DAMAGES.</strong></li><a name="line.86"></a> +<FONT color="green">087</FONT> * <ol></td></tr><a name="line.87"></a> +<FONT color="green">088</FONT> * </table><a name="line.88"></a> +<FONT color="green">089</FONT> <a name="line.89"></a> +<FONT color="green">090</FONT> * @author Argonne National Laboratory. MINPACK project. March 1980 (original fortran minpack tests)<a name="line.90"></a> +<FONT color="green">091</FONT> * @author Burton S. Garbow (original fortran minpack tests)<a name="line.91"></a> +<FONT color="green">092</FONT> * @author Kenneth E. Hillstrom (original fortran minpack tests)<a name="line.92"></a> +<FONT color="green">093</FONT> * @author Jorge J. More (original fortran minpack tests)<a name="line.93"></a> +<FONT color="green">094</FONT> * @author Luc Maisonobe (non-minpack tests and minpack tests Java translation)<a name="line.94"></a> +<FONT color="green">095</FONT> */<a name="line.95"></a> +<FONT color="green">096</FONT> public class GaussNewtonOptimizerTest<a name="line.96"></a> +<FONT color="green">097</FONT> extends AbstractLeastSquaresOptimizerAbstractTest {<a name="line.97"></a> +<FONT color="green">098</FONT> <a name="line.98"></a> +<FONT color="green">099</FONT> @Override<a name="line.99"></a> +<FONT color="green">100</FONT> public AbstractLeastSquaresOptimizer createOptimizer() {<a name="line.100"></a> +<FONT color="green">101</FONT> return new GaussNewtonOptimizer(new SimpleVectorValueChecker(1.0e-6, 1.0e-6));<a name="line.101"></a> +<FONT color="green">102</FONT> }<a name="line.102"></a> +<FONT color="green">103</FONT> <a name="line.103"></a> +<FONT color="green">104</FONT> @Test(expected=MathUnsupportedOperationException.class)<a name="line.104"></a> +<FONT color="green">105</FONT> public void testConstraintsUnsupported() {<a name="line.105"></a> +<FONT color="green">106</FONT> createOptimizer().optimize(new MaxEval(100),<a name="line.106"></a> +<FONT color="green">107</FONT> new Target(new double[] { 2 }),<a name="line.107"></a> +<FONT color="green">108</FONT> new Weight(new double[] { 1 }),<a name="line.108"></a> +<FONT color="green">109</FONT> new InitialGuess(new double[] { 1, 2 }),<a name="line.109"></a> +<FONT color="green">110</FONT> new SimpleBounds(new double[] { -10, 0 },<a name="line.110"></a> +<FONT color="green">111</FONT> new double[] { 20, 30 }));<a name="line.111"></a> +<FONT color="green">112</FONT> }<a name="line.112"></a> +<FONT color="green">113</FONT> <a name="line.113"></a> +<FONT color="green">114</FONT> @Override<a name="line.114"></a> +<FONT color="green">115</FONT> @Test(expected = ConvergenceException.class)<a name="line.115"></a> +<FONT color="green">116</FONT> public void testMoreEstimatedParametersSimple() {<a name="line.116"></a> +<FONT color="green">117</FONT> /*<a name="line.117"></a> +<FONT color="green">118</FONT> * Exception is expected with this optimizer<a name="line.118"></a> +<FONT color="green">119</FONT> */<a name="line.119"></a> +<FONT color="green">120</FONT> super.testMoreEstimatedParametersSimple();<a name="line.120"></a> +<FONT color="green">121</FONT> }<a name="line.121"></a> +<FONT color="green">122</FONT> <a name="line.122"></a> +<FONT color="green">123</FONT> @Override<a name="line.123"></a> +<FONT color="green">124</FONT> @Test(expected=ConvergenceException.class)<a name="line.124"></a> +<FONT color="green">125</FONT> public void testMoreEstimatedParametersUnsorted() {<a name="line.125"></a> +<FONT color="green">126</FONT> /*<a name="line.126"></a> +<FONT color="green">127</FONT> * Exception is expected with this optimizer<a name="line.127"></a> +<FONT color="green">128</FONT> */<a name="line.128"></a> +<FONT color="green">129</FONT> super.testMoreEstimatedParametersUnsorted();<a name="line.129"></a> +<FONT color="green">130</FONT> }<a name="line.130"></a> <FONT color="green">131</FONT> <a name="line.131"></a> -<FONT color="green">132</FONT> optimizer.optimize(new MaxEval(100),<a name="line.132"></a> -<FONT color="green">133</FONT> circle.getModelFunction(),<a name="line.133"></a> -<FONT color="green">134</FONT> circle.getModelFunctionJacobian(),<a name="line.134"></a> -<FONT color="green">135</FONT> new Target(new double[] { 0, 0, 0, 0, 0 }),<a name="line.135"></a> -<FONT color="green">136</FONT> new Weight(new double[] { 1, 1, 1, 1, 1 }),<a name="line.136"></a> -<FONT color="green">137</FONT> new InitialGuess(new double[] { 98.680, 47.345 }));<a name="line.137"></a> -<FONT color="green">138</FONT> }<a name="line.138"></a> -<FONT color="green">139</FONT> <a name="line.139"></a> -<FONT color="green">140</FONT> @Override<a name="line.140"></a> -<FONT color="green">141</FONT> @Test(expected=ConvergenceException.class)<a name="line.141"></a> -<FONT color="green">142</FONT> public void testCircleFittingBadInit() {<a name="line.142"></a> -<FONT color="green">143</FONT> /*<a name="line.143"></a> -<FONT color="green">144</FONT> * This test does not converge with this optimizer.<a name="line.144"></a> -<FONT color="green">145</FONT> */<a name="line.145"></a> -<FONT color="green">146</FONT> super.testCircleFittingBadInit();<a name="line.146"></a> -<FONT color="green">147</FONT> }<a name="line.147"></a> -<FONT color="green">148</FONT> <a name="line.148"></a> -<FONT color="green">149</FONT> @Override<a name="line.149"></a> -<FONT color="green">150</FONT> @Test(expected = ConvergenceException.class)<a name="line.150"></a> -<FONT color="green">151</FONT> public void testHahn1()<a name="line.151"></a> -<FONT color="green">152</FONT> throws IOException {<a name="line.152"></a> -<FONT color="green">153</FONT> /*<a name="line.153"></a> -<FONT color="green">154</FONT> * TODO This test leads to a singular problem with the Gauss-Newton<a name="line.154"></a> -<FONT color="green">155</FONT> * optimizer. This should be inquired.<a name="line.155"></a> -<FONT color="green">156</FONT> */<a name="line.156"></a> -<FONT color="green">157</FONT> super.testHahn1();<a name="line.157"></a> -<FONT color="green">158</FONT> }<a name="line.158"></a> -<FONT color="green">159</FONT> }<a name="line.159"></a> +<FONT color="green">132</FONT> @Test(expected=TooManyEvaluationsException.class)<a name="line.132"></a> +<FONT color="green">133</FONT> public void testMaxEvaluations() throws Exception {<a name="line.133"></a> +<FONT color="green">134</FONT> CircleVectorial circle = new CircleVectorial();<a name="line.134"></a> +<FONT color="green">135</FONT> circle.addPoint( 30.0, 68.0);<a name="line.135"></a> +<FONT color="green">136</FONT> circle.addPoint( 50.0, -6.0);<a name="line.136"></a> +<FONT color="green">137</FONT> circle.addPoint(110.0, -20.0);<a name="line.137"></a> +<FONT color="green">138</FONT> circle.addPoint( 35.0, 15.0);<a name="line.138"></a> +<FONT color="green">139</FONT> circle.addPoint( 45.0, 97.0);<a name="line.139"></a> +<FONT color="green">140</FONT> <a name="line.140"></a> +<FONT color="green">141</FONT> GaussNewtonOptimizer optimizer<a name="line.141"></a> +<FONT color="green">142</FONT> = new GaussNewtonOptimizer(new SimpleVectorValueChecker(1e-30, 1e-30));<a name="line.142"></a> +<FONT color="green">143</FONT> <a name="line.143"></a> +<FONT color="green">144</FONT> optimizer.optimize(new MaxEval(100),<a name="line.144"></a> +<FONT color="green">145</FONT> circle.getModelFunction(),<a name="line.145"></a> +<FONT color="green">146</FONT> circle.getModelFunctionJacobian(),<a name="line.146"></a> +<FONT color="green">147</FONT> new Target(new double[] { 0, 0, 0, 0, 0 }),<a name="line.147"></a> +<FONT color="green">148</FONT> new Weight(new double[] { 1, 1, 1, 1, 1 }),<a name="line.148"></a> +<FONT color="green">149</FONT> new InitialGuess(new double[] { 98.680, 47.345 }));<a name="line.149"></a> +<FONT color="green">150</FONT> }<a name="line.150"></a> +<FONT color="green">151</FONT> <a name="line.151"></a> +<FONT color="green">152</FONT> @Override<a name="line.152"></a> +<FONT color="green">153</FONT> @Test(expected=ConvergenceException.class)<a name="line.153"></a> +<FONT color="green">154</FONT> public void testCircleFittingBadInit() {<a name="line.154"></a> +<FONT color="green">155</FONT> /*<a name="line.155"></a> +<FONT color="green">156</FONT> * This test does not converge with this optimizer.<a name="line.156"></a> +<FONT color="green">157</FONT> */<a name="line.157"></a> +<FONT color="green">158</FONT> super.testCircleFittingBadInit();<a name="line.158"></a> +<FONT color="green">159</FONT> }<a name="line.159"></a> +<FONT color="green">160</FONT> <a name="line.160"></a> +<FONT color="green">161</FONT> @Override<a name="line.161"></a> +<FONT color="green">162</FONT> @Test(expected = ConvergenceException.class)<a name="line.162"></a> +<FONT color="green">163</FONT> public void testHahn1()<a name="line.163"></a> +<FONT color="green">164</FONT> throws IOException {<a name="line.164"></a> +<FONT color="green">165</FONT> /*<a name="line.165"></a> +<FONT color="green">166</FONT> * TODO This test leads to a singular problem with the Gauss-Newton<a name="line.166"></a> +<FONT color="green">167</FONT> * optimizer. This should be inquired.<a name="line.167"></a> +<FONT color="green">168</FONT> */<a name="line.168"></a> +<FONT color="green">169</FONT> super.testHahn1();<a name="line.169"></a> +<FONT color="green">170</FONT> }<a name="line.170"></a> +<FONT color="green">171</FONT> }<a name="line.171"></a>