You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gilles (JIRA)" <ji...@apache.org> on 2010/10/27 17:46:25 UTC
[jira] Created: (MATH-430) Function objects
Function objects
----------------
Key: MATH-430
URL: https://issues.apache.org/jira/browse/MATH-430
Project: Commons Math
Issue Type: Bug
Reporter: Gilles
Assignee: Gilles
Priority: Minor
Fix For: 3.0
Create a package {{function}} to contain classes implementing the {{UnivariateRealFunction}} interface for all the usual functions.
As a consequence, all {{mapXxx}} methods and {{mapXxxToSelf}} methods in {{RealVector}} can be respectively replaced with
{code}
public void map(UnivariateRealFunction f);
{code}
and
{code}
public void mapToSelf(UnivariateRealFunction f);
{code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (MATH-430) Function objects
Posted by "Gilles (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/MATH-430?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gilles updated MATH-430:
------------------------
Attachment: func.tar.gz
As part of this issue, I'm proposing an alternative to the current "ComposableFunction" class.
The attached file contains part of the functionality (e.g. function composition, addition and multiplication). There are tests showing the intended usage.
The main difference with "ComposableFunction" is that utilities (e.g. operators) and function objects are separate: Having a "FunctionUtils" keeps the overall design more uniform (similar, in spirit, to the other "...Utils" classes in CM). The purpose is also to stay minimalist (e.g. no need to have a "divide" method since you can create it with "multiply" and an "Inverse" function object).
Also, function objects are first-class citizens, not needing the "import static" construct to be used with relative ease.
Please, let me know whether this is going in the right direction.
> Function objects
> ----------------
>
> Key: MATH-430
> URL: https://issues.apache.org/jira/browse/MATH-430
> Project: Commons Math
> Issue Type: Bug
> Reporter: Gilles
> Assignee: Gilles
> Priority: Minor
> Fix For: 3.0
>
> Attachments: func.tar.gz
>
>
> Create a package {{function}} to contain classes implementing the {{UnivariateRealFunction}} interface for all the usual functions.
> As a consequence, all {{mapXxx}} methods and {{mapXxxToSelf}} methods in {{RealVector}} can be respectively replaced with
> {code}
> public void map(UnivariateRealFunction f);
> {code}
> and
> {code}
> public void mapToSelf(UnivariateRealFunction f);
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (MATH-430) Function objects
Posted by "Luc Maisonobe (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/MATH-430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12934307#action_12934307 ]
Luc Maisonobe commented on MATH-430:
------------------------------------
No problem for me. I'm just wondering if you want to move only the implementations are the interfaces too (univariate, bivariate, trivariate, multivariate and real/vectorial).
> Function objects
> ----------------
>
> Key: MATH-430
> URL: https://issues.apache.org/jira/browse/MATH-430
> Project: Commons Math
> Issue Type: Bug
> Reporter: Gilles
> Assignee: Gilles
> Priority: Minor
> Fix For: 3.0
>
> Attachments: func.tar.gz
>
>
> Create a package {{function}} to contain classes implementing the {{UnivariateRealFunction}} interface for all the usual functions.
> As a consequence, all {{mapXxx}} methods and {{mapXxxToSelf}} methods in {{RealVector}} can be respectively replaced with
> {code}
> public void map(UnivariateRealFunction f);
> {code}
> and
> {code}
> public void mapToSelf(UnivariateRealFunction f);
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (MATH-430) Function objects
Posted by "Gilles (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/MATH-430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12934312#action_12934312 ]
Gilles commented on MATH-430:
-----------------------------
I thought of an {{analysis.function}} package for grouping the function classes so as to avoid overcrowding the {{analysis}} package; the interfaces would stay in {{analysis}}.
> Function objects
> ----------------
>
> Key: MATH-430
> URL: https://issues.apache.org/jira/browse/MATH-430
> Project: Commons Math
> Issue Type: Bug
> Reporter: Gilles
> Assignee: Gilles
> Priority: Minor
> Fix For: 3.0
>
> Attachments: func.tar.gz
>
>
> Create a package {{function}} to contain classes implementing the {{UnivariateRealFunction}} interface for all the usual functions.
> As a consequence, all {{mapXxx}} methods and {{mapXxxToSelf}} methods in {{RealVector}} can be respectively replaced with
> {code}
> public void map(UnivariateRealFunction f);
> {code}
> and
> {code}
> public void mapToSelf(UnivariateRealFunction f);
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (MATH-430) Function objects
Posted by "Gilles (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/MATH-430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12936061#action_12936061 ]
Gilles commented on MATH-430:
-----------------------------
Removed {{ComposableFunction}} and {{BinaryFunction}} in revision 1039465.
> Function objects
> ----------------
>
> Key: MATH-430
> URL: https://issues.apache.org/jira/browse/MATH-430
> Project: Commons Math
> Issue Type: Bug
> Reporter: Gilles
> Assignee: Gilles
> Priority: Minor
> Fix For: 3.0
>
> Attachments: func.tar.gz
>
>
> Create a package {{function}} to contain classes implementing the {{UnivariateRealFunction}} interface for all the usual functions.
> As a consequence, all {{mapXxx}} methods and {{mapXxxToSelf}} methods in {{RealVector}} can be respectively replaced with
> {code}
> public void map(UnivariateRealFunction f);
> {code}
> and
> {code}
> public void mapToSelf(UnivariateRealFunction f);
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (MATH-430) Function objects
Posted by "Gilles (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/MATH-430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12934304#action_12934304 ]
Gilles commented on MATH-430:
-----------------------------
No one objecting on this change?
> Function objects
> ----------------
>
> Key: MATH-430
> URL: https://issues.apache.org/jira/browse/MATH-430
> Project: Commons Math
> Issue Type: Bug
> Reporter: Gilles
> Assignee: Gilles
> Priority: Minor
> Fix For: 3.0
>
> Attachments: func.tar.gz
>
>
> Create a package {{function}} to contain classes implementing the {{UnivariateRealFunction}} interface for all the usual functions.
> As a consequence, all {{mapXxx}} methods and {{mapXxxToSelf}} methods in {{RealVector}} can be respectively replaced with
> {code}
> public void map(UnivariateRealFunction f);
> {code}
> and
> {code}
> public void mapToSelf(UnivariateRealFunction f);
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (MATH-430) Function objects
Posted by "Gilles (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/MATH-430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12934609#action_12934609 ]
Gilles commented on MATH-430:
-----------------------------
Functions and utilities added in revision 1037896. Replaced classes are deprecated.
In a second, step I'll remove the redundant {{mapXxx}} and {{mapXxxToSelf}} methods from the {{RealVector}} interface.
> Function objects
> ----------------
>
> Key: MATH-430
> URL: https://issues.apache.org/jira/browse/MATH-430
> Project: Commons Math
> Issue Type: Bug
> Reporter: Gilles
> Assignee: Gilles
> Priority: Minor
> Fix For: 3.0
>
> Attachments: func.tar.gz
>
>
> Create a package {{function}} to contain classes implementing the {{UnivariateRealFunction}} interface for all the usual functions.
> As a consequence, all {{mapXxx}} methods and {{mapXxxToSelf}} methods in {{RealVector}} can be respectively replaced with
> {code}
> public void map(UnivariateRealFunction f);
> {code}
> and
> {code}
> public void mapToSelf(UnivariateRealFunction f);
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (MATH-430) Function objects
Posted by "Gilles (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/MATH-430?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gilles resolved MATH-430.
-------------------------
Resolution: Fixed
{{ComposableFunction}} and {{BinaryFunction}} classes deprecated in branch 2.x (revision 1039575).
> Function objects
> ----------------
>
> Key: MATH-430
> URL: https://issues.apache.org/jira/browse/MATH-430
> Project: Commons Math
> Issue Type: Bug
> Reporter: Gilles
> Assignee: Gilles
> Priority: Minor
> Fix For: 3.0
>
> Attachments: func.tar.gz
>
>
> Create a package {{function}} to contain classes implementing the {{UnivariateRealFunction}} interface for all the usual functions.
> As a consequence, all {{mapXxx}} methods and {{mapXxxToSelf}} methods in {{RealVector}} can be respectively replaced with
> {code}
> public void map(UnivariateRealFunction f);
> {code}
> and
> {code}
> public void mapToSelf(UnivariateRealFunction f);
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (MATH-430) Function objects
Posted by "Luc Maisonobe (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/MATH-430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12934338#action_12934338 ]
Luc Maisonobe commented on MATH-430:
------------------------------------
Fine, thanks.
> Function objects
> ----------------
>
> Key: MATH-430
> URL: https://issues.apache.org/jira/browse/MATH-430
> Project: Commons Math
> Issue Type: Bug
> Reporter: Gilles
> Assignee: Gilles
> Priority: Minor
> Fix For: 3.0
>
> Attachments: func.tar.gz
>
>
> Create a package {{function}} to contain classes implementing the {{UnivariateRealFunction}} interface for all the usual functions.
> As a consequence, all {{mapXxx}} methods and {{mapXxxToSelf}} methods in {{RealVector}} can be respectively replaced with
> {code}
> public void map(UnivariateRealFunction f);
> {code}
> and
> {code}
> public void mapToSelf(UnivariateRealFunction f);
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.