You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Dennis Hendriks (JIRA)" <ji...@apache.org> on 2011/06/22 11:52:47 UTC

[jira] [Created] (MATH-599) Re-implementation of Secant-based root finding algorithms

Re-implementation of Secant-based root finding algorithms
---------------------------------------------------------

                 Key: MATH-599
                 URL: https://issues.apache.org/jira/browse/MATH-599
             Project: Commons Math
          Issue Type: Improvement
            Reporter: Dennis Hendriks
             Fix For: 3.0


Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.

Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.

I created a patch, which changes the following:
 - Removed SecantSolver root-finding algorithm.
 - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
 - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
 - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.

Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.

I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Re: [jira] [Resolved] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by lu...@free.fr.

----- Mail original -----
De: "Gilles Sadowski" <gi...@harfang.homelinux.org>
À: dev@commons.apache.org
Envoyé: Lundi 25 Juillet 2011 00:18:56
Objet: Re: [jira] [Resolved] (MATH-599) Re-implementation of Secant-based root finding algorithms

> 
> Luc Maisonobe resolved MATH-599.
> --------------------------------
> 
>     Resolution: Fixed
> 
> declaring the issue solved as per last comments above

Hi Gilles,

Hmm, shall I replace "AllowedSolutions" (plural) with "AllowedSolution"
(singular)?

Yes, if you want.

best regards,
Luc


Gilles

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [jira] [Resolved] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by Gilles Sadowski <gi...@harfang.homelinux.org>.
> 
> Luc Maisonobe resolved MATH-599.
> --------------------------------
> 
>     Resolution: Fixed
> 
> declaring the issue solved as per last comments above

Hmm, shall I replace "AllowedSolutions" (plural) with "AllowedSolution"
(singular)?


Gilles

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[jira] [Commented] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13053291#comment-13053291 ] 

Phil Steitz commented on MATH-599:
----------------------------------

Thanks for the patch!  

Dennis: I agree with your comments on the current implementation, which IIRC was designed to ensure bracketing and convergence.  Excellent job on the documentation for both the new classes and the change to SecantSolver.  Now is the time to fix this kind of thing (as we approach 3.0)

Gilles: diffs are generally preferred over tars / zips where possible.  In this case, the patch is fine.  The only thing missing is the ID Keywords prop, which I can add on commit.

Unless others have objections, I will apply the patch with minor mods only.

> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Dennis Hendriks (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Hendriks updated MATH-599:
---------------------------------

    Attachment: secant-based-root-finding-algos.patch

Patch described in the issue description.

> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Axel Kramer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13069954#comment-13069954 ] 

Axel Kramer commented on MATH-599:
----------------------------------

Ok I change my implementation.

illegal state: maximal count (32,000) exceeded: evaluations


{quote}
I'm not used to this syntax (sorry), what is the function?
{quote}

The syntax means something like this test case:
{code}
	public void testRegulaFalsi() {
		UnivariateRealFunction f = new UnivariateRealFunction() {

			@Override
			public double value(double x) throws MathUserException {
				return Math.exp(x) - Math.pow(Math.PI, 3.0);
			}

		};
		double result;
		UnivariateRealSolver solver = new RegulaFalsiSolver();

		result = solver.solve(100, f, 1, 10);
	}
{code}

> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch, secant-based-root-finding-algos2.patch, secant-based-root-finding-algos2.zip
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Gilles (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13054720#comment-13054720 ] 

Gilles commented on MATH-599:
-----------------------------

Proposed changes committed in revision 1139455.


> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch, secant-based-root-finding-algos2.patch, secant-based-root-finding-algos2.zip
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Luc Maisonobe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13054257#comment-13054257 ] 

Luc Maisonobe commented on MATH-599:
------------------------------------

Yes, Apache Commons Math should be compatible to Java 5 and the build systems are set up for this. So the various @Override on method implementations should be removed, in Java 5 they can be used only when a subclass reimplement a method already implemented by its superclass. It cannot be used for the first implementation of an interface.

I have also one suggestion concerning the AllowedSolutions enumerate. Could we select size either along abscissa and along ordinate ? This would imply adding ABOVE_SIDE and BELOW_SIDE to the existing LEFT_SIDE and RIGHT_SIDE.

When we are OK with the complete fix, then yes, the issue will be marked as resolved.

> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch, secant-based-root-finding-algos2.patch, secant-based-root-finding-algos2.zip
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Gilles (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13053274#comment-13053274 ] 

Gilles commented on MATH-599:
-----------------------------

{quote}
Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements
{quote}

The clarification is certainly welcome. Thanks.

However, since the changes are mostly adding whole new files, could you please attach them as files (i.e. _not_ in diff format)? All of them in "tar.gz" or "zip" archive file is fine too.


> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Dennis Hendriks (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Hendriks updated MATH-599:
---------------------------------

    Attachment:     (was: MyTest2.java)

> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch, secant-based-root-finding-algos2.patch, secant-based-root-finding-algos2.zip
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Gilles (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13053317#comment-13053317 ] 

Gilles commented on MATH-599:
-----------------------------

The patch did not apply cleanly for me.
Moreover I prefer reading actual code than code mixed with "diff" commands.
Finally, what's the purpose of a "diff" for a new file?


> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Gilles (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13070075#comment-13070075 ] 

Gilles commented on MATH-599:
-----------------------------

I opened a new [issue|MATH-631] for this problem.

> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch, secant-based-root-finding-algos2.patch, secant-based-root-finding-algos2.zip
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Gilles (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13073393#comment-13073393 ] 

Gilles commented on MATH-599:
-----------------------------

"AllowedSolutions" changed to"AllowedSolution" in revision 1152644.


> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch, secant-based-root-finding-algos2.patch, secant-based-root-finding-algos2.zip
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Dennis Hendriks (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13063222#comment-13063222 ] 

Dennis Hendriks commented on MATH-599:
--------------------------------------

bq. If everyone agrees, we could resolve this issue.

Nice work Luc. As far as I'm concerned, the issue is resolved.

> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch, secant-based-root-finding-algos2.patch, secant-based-root-finding-algos2.zip
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Gilles (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13053336#comment-13053336 ] 

Gilles commented on MATH-599:
-----------------------------

My purpose was to comply with your oft repeated policy of not changing two things at the same time. So I'd have committed first the modification of "SecantSolver" and then added the new implementations, one by one, as they are _not_ interdependent.

The "diff" are certainly better for automated handling, but you can't argue that it's as easy to read, for a human, as a plain file...


> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Dennis Hendriks (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Hendriks updated MATH-599:
---------------------------------

    Attachment: secant-based-root-finding-algos2.zip
                secant-based-root-finding-algos2.patch

- Updated patch. Can now be applied without failures.
- Added zip with the patched files, as requested by Gilles.

> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch, secant-based-root-finding-algos2.patch, secant-based-root-finding-algos2.zip
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Axel Kramer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13069940#comment-13069940 ] 

Axel Kramer commented on MATH-599:
----------------------------------

I used the new RegulaFalsi implementation in my project
  http://code.google.com/p/symja/wiki/UsedLibraries#Commons-Math_functions
for the FindRoot function.

The call:
  FindRoot[Exp[x]==Pi^3,{x,1,10}, RegulaFalsi] 
seems to run endlessly?

For the other Solvers the method stops very quick.

Shouldn't there be a test for a "maximum iteration" in the while loop of the BaseSecantSolver#doSolve() method()?

> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch, secant-based-root-finding-algos2.patch, secant-based-root-finding-algos2.zip
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Gilles (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13069946#comment-13069946 ] 

Gilles commented on MATH-599:
-----------------------------

The copy/paste bug was corrected in revision 1150089.


> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch, secant-based-root-finding-algos2.patch, secant-based-root-finding-algos2.zip
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Luc Maisonobe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Luc Maisonobe resolved MATH-599.
--------------------------------

    Resolution: Fixed

declaring the issue solved as per last comments above

> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch, secant-based-root-finding-algos2.patch, secant-based-root-finding-algos2.zip
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Gilles (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13054189#comment-13054189 ] 

Gilles commented on MATH-599:
-----------------------------

Some changes were needed in order to eliminate CheckStyle warnings.
Code added in revision 1139126.


> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch, secant-based-root-finding-algos2.patch, secant-based-root-finding-algos2.zip
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13053321#comment-13053321 ] 

Phil Steitz commented on MATH-599:
----------------------------------

We use diffs to represent change to code.  There are lots of reasons that diffs are preferred to passing around files, which I will not repeat here.

The purpose of a diff for new files is that a) when the new file is part of a larger patch, the diff can represent the entire change b) the diff is guaranteed to be plain text c) the diff places the file in the right directory location.  Again, we use diffs to represent changes from a local checkout and the svn repository.  This enables us to unambiguously communicate changes or proposed changes to the code.

That said, if contributors have a hard time creating diffs including new files and committers are willing to work with zips / tars for new files, that is OK too.  The point is that diffs are better where possible.

> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Gilles (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13054329#comment-13054329 ] 

Gilles commented on MATH-599:
-----------------------------

I'd like to have a few more "cosmetic" changes.

# {{SecantBase}} should be renamed {{BaseSecantSolver}} to comply with other similar hierarchies.
In some of those other occurrences there is also the "Abstract" prefix but this could be removed there when/if we decide to remove the "interface" level.
# There could be an intermediate {{BaseBracketedSecantSolver}} to avoid duplicating (3 times) the {{getAllowedSolutions}} and {{setAllowedSolutions}} methods.

Is that OK?


> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch, secant-based-root-finding-algos2.patch, secant-based-root-finding-algos2.zip
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Gilles (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13062803#comment-13062803 ] 

Gilles commented on MATH-599:
-----------------------------

I wonder whether it should be "AllowedSolution" instead of "AllowedSolutions". To me, it seems odd to have a plural where exactly one solution type is expected...


> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch, secant-based-root-finding-algos2.patch, secant-based-root-finding-algos2.zip
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Luc Maisonobe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13062716#comment-13062716 ] 

Luc Maisonobe commented on MATH-599:
------------------------------------

A bunch of new changes have been committed.
Now the bracketing feature can be added in a post-precessing stage for solvers which do not provide it by themselves.
This is done using a static forceSide method in the UnivariateRealSolverUtils utility class.
Also the get/setAllowedSolutions have been replaced by new signatures for solve methods, for consistency
with other solvers. In fact, all setters and getters were removed between version 2.2 and 3.0 and the
properties settings are now either done at construction time (relative accuracy, absolute accuracy, function accuracy)
or at solve time (maximal number of evaluations). The allowed solutions settings seemed more similar to maximal
number of evaluation, so it it set the same way.

If everyone agrees, we could resolve this issue.

> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch, secant-based-root-finding-algos2.patch, secant-based-root-finding-algos2.zip
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Dennis Hendriks (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Hendriks updated MATH-599:
---------------------------------

    Comment: was deleted

(was: New test, with output for both dense and non-dense step handler.

Note how for the non-dense step handler, the derivatives are computed for 10.0, and the result is 24.999999999999996. It then continues to call the step handler for time 10.0 with value 21.35298598981348, which is the value calculated for time 8.784328663271161, from before the previous time the step handler was called. It seems the compute derivative method is called for the appropriate times, only the output is not correctly used to set the interpolator values.

If you think this is indeed *only* caused by the optionality of dense output, or it is no longer relevant if non-dense output is removed, then removing the non-dense option would indeed fix this issue.

It would probably be better to create a separate issue for the removal of non-dense output. I have no objections to the removal of non-dense output.)

> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch, secant-based-root-finding-algos2.patch, secant-based-root-finding-algos2.zip
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Dennis Hendriks (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13054252#comment-13054252 ] 

Dennis Hendriks commented on MATH-599:
--------------------------------------

I noticed that the build seems to fail. See http://vmbuild.apache.org/continuum/buildResult.action?buildId=9284&projectId=97. Maybe it is due to Java 1.5 being used, and not Java 1.6?

Also, should this issue not be marked 'resolved', now that the code is in trunk?

> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch, secant-based-root-finding-algos2.patch, secant-based-root-finding-algos2.zip
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Dennis Hendriks (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13054331#comment-13054331 ] 

Dennis Hendriks commented on MATH-599:
--------------------------------------

> Is that OK?

I have no objections.

> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch, secant-based-root-finding-algos2.patch, secant-based-root-finding-algos2.zip
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Axel Kramer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13069954#comment-13069954 ] 

Axel Kramer edited comment on MATH-599 at 7/23/11 1:14 PM:
-----------------------------------------------------------

Ok I change my implementation.

{quote}
I'm not used to this syntax (sorry), what is the function?
{quote}

The syntax means something like this test case:
{code}
	public void testRegulaFalsi() {
		UnivariateRealFunction f = new UnivariateRealFunction() {

			@Override
			public double value(double x) throws MathUserException {
				return Math.exp(x) - Math.pow(Math.PI, 3.0);
			}

		};
		double result;
		UnivariateRealSolver solver = new RegulaFalsiSolver();

		result = solver.solve(100, f, 1, 10);
	}
{code}

      was (Author: axelclk):
    Ok I change my implementation.

illegal state: maximal count (32,000) exceeded: evaluations


{quote}
I'm not used to this syntax (sorry), what is the function?
{quote}

The syntax means something like this test case:
{code}
	public void testRegulaFalsi() {
		UnivariateRealFunction f = new UnivariateRealFunction() {

			@Override
			public double value(double x) throws MathUserException {
				return Math.exp(x) - Math.pow(Math.PI, 3.0);
			}

		};
		double result;
		UnivariateRealSolver solver = new RegulaFalsiSolver();

		result = solver.solve(100, f, 1, 10);
	}
{code}
  
> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch, secant-based-root-finding-algos2.patch, secant-based-root-finding-algos2.zip
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Gilles (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13068340#comment-13068340 ] 

Gilles commented on MATH-599:
-----------------------------

There was one unresolved issue (see my question 3 comments up).


> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch, secant-based-root-finding-algos2.patch, secant-based-root-finding-algos2.zip
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Dennis Hendriks (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Hendriks updated MATH-599:
---------------------------------

    Attachment: MyTest2.java

New test, with output for both dense and non-dense step handler.

Note how for the non-dense step handler, the derivatives are computed for 10.0, and the result is 24.999999999999996. It then continues to call the step handler for time 10.0 with value 21.35298598981348, which is the value calculated for time 8.784328663271161, from before the previous time the step handler was called. It seems the compute derivative method is called for the appropriate times, only the output is not correctly used to set the interpolator values.

If you think this is indeed *only* caused by the optionality of dense output, or it is no longer relevant if non-dense output is removed, then removing the non-dense option would indeed fix this issue.

It would probably be better to create a separate issue for the removal of non-dense output. I have no objections to the removal of non-dense output.

> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch, secant-based-root-finding-algos2.patch, secant-based-root-finding-algos2.zip
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Gilles (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13069945#comment-13069945 ] 

Gilles commented on MATH-599:
-----------------------------

Thanks for reporting; I've already found a copy/paste bug in the code, although I don't think it is the cause of your problem.

{noformat}
FindRoot[Exp[x]==Pi^3,{x,1,10}, RegulaFalsi] 
{noformat}

I'm not used to this syntax (sorry), what is the function?

{quote}
Shouldn't there be a test for a "maximum iteration" [...]
{quote}

No, the failure criterion is the number of function evaluations, which is taken care of in the parent class through the {{computeObjectiveValue}} method.


> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch, secant-based-root-finding-algos2.patch, secant-based-root-finding-algos2.zip
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Luc Maisonobe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13054379#comment-13054379 ] 

Luc Maisonobe commented on MATH-599:
------------------------------------

You are right.

> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch, secant-based-root-finding-algos2.patch, secant-based-root-finding-algos2.zip
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-599) Re-implementation of Secant-based root finding algorithms

Posted by "Dennis Hendriks (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13054276#comment-13054276 ] 

Dennis Hendriks commented on MATH-599:
--------------------------------------

> Could we select size either along abscissa and along ordinate?

I think it would be a nice improvement. It should be rather straightforward to implement this in the SecantBase class.


> Re-implementation of Secant-based root finding algorithms
> ---------------------------------------------------------
>
>                 Key: MATH-599
>                 URL: https://issues.apache.org/jira/browse/MATH-599
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Dennis Hendriks
>              Labels: documentation, patch
>             Fix For: 3.0
>
>         Attachments: secant-based-root-finding-algos.patch, secant-based-root-finding-algos2.patch, secant-based-root-finding-algos2.zip
>
>
> Apache Commons Math currently has a SecantSolver. It is unclear exactly what algorithm this solver implements. It states: "The algorithm is modified to maintain bracketing of a root by successive approximations. Because of forced bracketing, convergence may be slower than the unrestricted Secant algorithm. However, this implementation should in general outperform the Regula Falsi method." The Regula Falsi method is exactly the Secant method modified to maintain a bracketed solution. It is therefore unclear what other modifications were done to make it 'better' than the Regula Falsi method.
> Besides the Secant and Regula Falsi methods, several other Secant-based root-finding algorithms exist, such as the the Illinois method, and the Pegasus method. All 4 are well-known, publisched algorithms.
> I created a patch, which changes the following:
>  - Removed SecantSolver root-finding algorithm.
>  - Implemented new Secant-based root-finding algorithms: SecantSolver, RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Introduced BracketedSolution interface and AllowedSolutions enumeration, to control allowed solutions (under-approximations and over-approximations) for bracketed root-finding algorithms. Implemented for RegulaFalsiSolver, IllinoisSolver, and PegasusSolver.
>  - Fixed documentation of BaseUnivariateRealSolver.solve methods, such that documentation order of arguments matches the order of the actual arguments.
> Note that the original SecantSolver was removed, and replaced by a root-finding algorithm that actually implements the Secant root-finding algorithm. As such, existing code using the SecantSolver is not backwards compatible. That is, even though the new SecantSolver does implement the same interfaces, the root-finding solutions may differ. In particular, the new SecantSolver does not maintain a bracketed solution, and does not guarantee convergence.
> I added unit tests, and I did a build, including checkstyle checking. I did not fix all checkstyle warnings though, as I consider some of them false positives.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira