[jira] Created: (MATH-389) New superclass for "AbstractScalarDifferentiableOptimizer"

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (MATH-389) New superclass for "AbstractScalarDifferentiableOptimizer"

ASF GitHub Bot (Jira)
New superclass for "AbstractScalarDifferentiableOptimizer"
----------------------------------------------------------

                 Key: MATH-389
                 URL: https://issues.apache.org/jira/browse/MATH-389
             Project: Commons Math
          Issue Type: Improvement
            Reporter: Gilles
            Assignee: Gilles
            Priority: Trivial
             Fix For: 2.2


In package {{optimization.general}}, I propose to create a new class: "AbstractScalarOptimizer".  It would contain all code currently in "AbstractScalarDifferentiableOptimizer" that is not related to derivatives. "AbstractScalarDifferentiableOptimizer" would then extend that class to add the derivative-related code.

This new layer in the hierarchy will be the base class for algorithms that do not use derivatives.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (MATH-389) New superclass for "AbstractScalarDifferentiableOptimizer"

ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/MATH-389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12890338#action_12890338 ]

Gilles commented on MATH-389:
-----------------------------

There is a lot of duplication between "DifferentiableMultivariateRealOptimizer" and "MultivariateRealOptimizer" interfaces.
We could have a new "BaseMultivariateRealOptimizer" interface that will contain all the declarations common to both of the current interfaces? Each of those will then contain their {{optimize}} method declaration, plus any other specific ones (such as those related to "gradient" in "DifferentiableMultivariateRealOptimizer").

An alternative (perhaps more elegant but maybe not backward-compatible) would be to have
{code:title=MultivariateRealOptimizer.java|borderStyle=solid}
interface MultivariateRealOptimizer<T extends MultivariateRealFunction> {
   // ... All common methods

   RealPointValuePair optimize(T func, GoalType goal, double[] start);
}
{code}

{code:title=DifferentiableMultivariateRealOptimizer.java|borderStyle=solid}
interface DifferentiableMultivariateRealOptimizer
extends MultivariateRealOptimizer<DifferentiableMultivariateRealFunction> {
   // ... All methods referring to "gradient".
}
{code}


What do you think?


> New superclass for "AbstractScalarDifferentiableOptimizer"
> ----------------------------------------------------------
>
>                 Key: MATH-389
>                 URL: https://issues.apache.org/jira/browse/MATH-389
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Trivial
>             Fix For: 2.2
>
>
> In package {{optimization.general}}, I propose to create a new class: "AbstractScalarOptimizer".  It would contain all code currently in "AbstractScalarDifferentiableOptimizer" that is not related to derivatives. "AbstractScalarDifferentiableOptimizer" would then extend that class to add the derivative-related code.
> This new layer in the hierarchy will be the base class for algorithms that do not use derivatives.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (MATH-389) New superclass for "AbstractScalarDifferentiableOptimizer"

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/MATH-389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12890341#action_12890341 ]

Gilles commented on MATH-389:
-----------------------------

In fact, if we combine both ideas (base class and generics), I think that there is no compatibility risk:

New base generic interface:
{code:title=BaseMultivariateRealOptimizer.java|borderStyle=solid}
interface BaseMultivariateRealOptimizer<T extends MultivariateRealFunction> {
   // ... All common methods

   RealPointValuePair optimize(T func, GoalType goal, double[] start);
}
{code}

And trivially modified (but backward compatible) "MultivariateRealOptimizer" interface:

{code:title=MultivariateRealOptimizer.java|borderStyle=solid}
interface MultivariateRealOptimizer
extends BaseMultivariateRealOptimizer<MultivariateRealFunction> {}
{code}


> New superclass for "AbstractScalarDifferentiableOptimizer"
> ----------------------------------------------------------
>
>                 Key: MATH-389
>                 URL: https://issues.apache.org/jira/browse/MATH-389
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Trivial
>             Fix For: 2.2
>
>
> In package {{optimization.general}}, I propose to create a new class: "AbstractScalarOptimizer".  It would contain all code currently in "AbstractScalarDifferentiableOptimizer" that is not related to derivatives. "AbstractScalarDifferentiableOptimizer" would then extend that class to add the derivative-related code.
> This new layer in the hierarchy will be the base class for algorithms that do not use derivatives.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (MATH-389) New superclass for "AbstractScalarDifferentiableOptimizer"

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/MATH-389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12890356#action_12890356 ]

Luc Maisonobe commented on MATH-389:
------------------------------------

At first sight, it seems good to me.
You can check there are incomatibilities by performing the changes locally and run "clirr" (for example by running "mvn site") and check the clirr report.

> New superclass for "AbstractScalarDifferentiableOptimizer"
> ----------------------------------------------------------
>
>                 Key: MATH-389
>                 URL: https://issues.apache.org/jira/browse/MATH-389
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Trivial
>             Fix For: 2.2
>
>
> In package {{optimization.general}}, I propose to create a new class: "AbstractScalarOptimizer".  It would contain all code currently in "AbstractScalarDifferentiableOptimizer" that is not related to derivatives. "AbstractScalarDifferentiableOptimizer" would then extend that class to add the derivative-related code.
> This new layer in the hierarchy will be the base class for algorithms that do not use derivatives.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

Re: [jira] Commented: (MATH-389) New superclass for "AbstractScalarDifferentiableOptimizer"

Gilles Sadowski

> At first sight, it seems good to me.
> You can check there are incomatibilities by performing the changes locally and run "clirr" (for example by running "mvn site") and check the clirr report.

I ran "mvn site" but could not find the report. What is the file name?


Gilles
Reply | Threaded
Open this post in threaded view
|

Re: [jira] Commented: (MATH-389) New superclass for "AbstractScalarDifferentiableOptimizer"

Luc Maisonobe
Le 20/07/2010 20:31, Gilles Sadowski a écrit :
>
>> At first sight, it seems good to me.
>> You can check there are incomatibilities by performing the changes locally and run "clirr" (for example by running "mvn site") and check the clirr report.
>
> I ran "mvn site" but could not find the report. What is the file name?

clirr-report.html

It should be in top directory. It is generated by clirr-maven-plugin.
You can also try "mvn clirr:check" or "mvn clirr:clirr", see
<http://mojo.codehaus.org/clirr-maven-plugin/usage.html>

Luc

>
>
> Gilles

Reply | Threaded
Open this post in threaded view
|

Re: [jira] Commented: (MATH-389) New superclass for "AbstractScalarDifferentiableOptimizer"

Gilles Sadowski

> > I ran "mvn site" but could not find the report. What is the file name?
>
> clirr-report.html
>
> It should be in top directory. It is generated by clirr-maven-plugin.
> You can also try "mvn clirr:check" or "mvn clirr:clirr", see
> <http://mojo.codehaus.org/clirr-maven-plugin/usage.html>

Excerpt from the build output:

[INFO] Unable to find a previous version of the project in the repository
[INFO] Not generating Clirr report as there is no previous version of the library to compare against


Gilles
Reply | Threaded
Open this post in threaded view
|

Re: [jira] Commented: (MATH-389) New superclass for "AbstractScalarDifferentiableOptimizer"

Luc Maisonobe
Le 20/07/2010 23:13, Gilles Sadowski a écrit :

>
>>> I ran "mvn site" but could not find the report. What is the file name?
>>
>> clirr-report.html
>>
>> It should be in top directory. It is generated by clirr-maven-plugin.
>> You can also try "mvn clirr:check" or "mvn clirr:clirr", see
>> <http://mojo.codehaus.org/clirr-maven-plugin/usage.html>
>
> Excerpt from the build output:
>
> [INFO] Unable to find a previous version of the project in the repository

Perhaps you should make an "mvn install" of the previous version (i.e.
2.1) in your local repository.

Luc

> [INFO] Not generating Clirr report as there is no previous version of the library to compare against
>
>
> Gilles

Reply | Threaded
Open this post in threaded view
|

Re: [jira] Commented: (MATH-389) New superclass for "AbstractScalarDifferentiableOptimizer"

Gilles Sadowski
> >>> I ran "mvn site" but could not find the report. What is the file name?
> >>
> >> clirr-report.html
> >>
> >> It should be in top directory. It is generated by clirr-maven-plugin.
> >> You can also try "mvn clirr:check" or "mvn clirr:clirr", see
> >> <http://mojo.codehaus.org/clirr-maven-plugin/usage.html>
> >
> > Excerpt from the build output:
> >
> > [INFO] Unable to find a previous version of the project in the repository
>
> Perhaps you should make an "mvn install" of the previous version (i.e.
> 2.1) in your local repository.

Does that mean that I must check out the 2.1 tag?
If so, I did the following

 $ svn co http://svn.apache.org/viewvc/commons/proper/math/tags/MATH_2_1/

And got this error:

 svn: Repository moved permanently to '/viewvc/commons/proper/math/tags/MATH_2_1/'; please relocate


Gilles

P.S. I found the following possible explanation on the Subversion FAQ page:
---CUT---
I can see my repository in a web browser, but 'svn checkout' gives me an
error about "301 Moved Permanently". What's wrong?

It means your httpd.conf is misconfigured. Usually this error happens when
you've defined the Subversion virtual "location" to exist within two
different scopes at the same time.

For example, if you've exported a repository as <Location /www/foo>, but
you've also set your DocumentRoot to be /www, then you're in trouble. When
the request comes in for /www/foo/bar, apache doesn't know whether to find a
real file named /foo/bar within your DocumentRoot, or whether to ask
mod_dav_svn to fetch a file /bar from the /www/foo repository. Usually the
former case wins, and hence the "Moved Permanently" error.

The solution is to make sure your repository <Location> does not overlap or
live within any areas already exported as normal web shares.

It's also possible that you have an object in the web root which has the
same name as your repository URL. For example, imagine your web server's
document root is /var/www and your Subversion repository is located at
/home/svn/repo. You then configure Apache to serve the repository at
http://localhost/myrepo. If you then create the directory /var/www/myrepo/
this will cause a 301 error to occur.
---CUT---
Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (MATH-389) New superclass for "AbstractScalarDifferentiableOptimizer"

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/MATH-389?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gilles resolved MATH-389.
-------------------------

    Resolution: Fixed

A refactoring along the lines proposed has been performed in r967288.


> New superclass for "AbstractScalarDifferentiableOptimizer"
> ----------------------------------------------------------
>
>                 Key: MATH-389
>                 URL: https://issues.apache.org/jira/browse/MATH-389
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Trivial
>             Fix For: 2.2
>
>
> In package {{optimization.general}}, I propose to create a new class: "AbstractScalarOptimizer".  It would contain all code currently in "AbstractScalarDifferentiableOptimizer" that is not related to derivatives. "AbstractScalarDifferentiableOptimizer" would then extend that class to add the derivative-related code.
> This new layer in the hierarchy will be the base class for algorithms that do not use derivatives.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.