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/06/24 13:19:50 UTC
[jira] Created: (MATH-379) Multidimensional counter
Multidimensional counter
------------------------
Key: MATH-379
URL: https://issues.apache.org/jira/browse/MATH-379
Project: Commons Math
Issue Type: New Feature
Reporter: Gilles
Assignee: Gilles
Priority: Minor
Utility that converts from indices in a multidimensional structure to the corresponding index in a one-dimensional array.
E.g. assuming that the ranges (in 3D) of indices are {2, 4, 3}, we'll have that
(0, 0, 0) corresponds to 0
(0, 0, 1) corresponds to 1
...
(1, 0, 0) corresponds to 12
...
(1, 3, 2) corresponds to 23
I propose to add this class in the "util" package.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (MATH-379) Multidimensional counter
Posted by "Gilles (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/MATH-379?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gilles resolved MATH-379.
-------------------------
Fix Version/s: 2.2
Resolution: Fixed
Added code (with additional comments and unit tests) in r958552.
> Multidimensional counter
> ------------------------
>
> Key: MATH-379
> URL: https://issues.apache.org/jira/browse/MATH-379
> Project: Commons Math
> Issue Type: New Feature
> Reporter: Gilles
> Assignee: Gilles
> Priority: Minor
> Fix For: 2.2
>
> Attachments: MultidimensionalCounter.java
>
>
> Utility that converts from indices in a multidimensional structure to the corresponding index in a one-dimensional array.
> E.g. assuming that the ranges (in 3D) of indices are {2, 4, 3}, we'll have that
> (0, 0, 0) corresponds to 0
> (0, 0, 1) corresponds to 1
> ...
> (1, 0, 0) corresponds to 12
> ...
> (1, 3, 2) corresponds to 23
> I propose to add this class in the "util" package.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (MATH-379) Multidimensional counter
Posted by "Gilles (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/MATH-379?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gilles updated MATH-379:
------------------------
Attachment: MultidimensionalCounter.java
Here is the implementation.
Any objections?
> Multidimensional counter
> ------------------------
>
> Key: MATH-379
> URL: https://issues.apache.org/jira/browse/MATH-379
> Project: Commons Math
> Issue Type: New Feature
> Reporter: Gilles
> Assignee: Gilles
> Priority: Minor
> Attachments: MultidimensionalCounter.java
>
>
> Utility that converts from indices in a multidimensional structure to the corresponding index in a one-dimensional array.
> E.g. assuming that the ranges (in 3D) of indices are {2, 4, 3}, we'll have that
> (0, 0, 0) corresponds to 0
> (0, 0, 1) corresponds to 1
> ...
> (1, 0, 0) corresponds to 12
> ...
> (1, 3, 2) corresponds to 23
> I propose to add this class in the "util" package.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (MATH-379) Multidimensional counter
Posted by "Luc Maisonobe (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/MATH-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12882296#action_12882296 ]
Luc Maisonobe commented on MATH-379:
------------------------------------
A few remarks.
The javadoc is very scarce and most methods have no description, only parameters. The class javadoc can also be understood only if you already know the purpose of the class, so new users won't get it.
The typical example is getCount in the Iterator class. The name "count" is misleading and without explanation it took me a long to understand its purpose. Rather than getCount(index), I would have used getIndex(dimension).
The IllegalArgumentException in the MultidimensionalCounter constructor should be localized.
The util package seems a good fit for this class.
> Multidimensional counter
> ------------------------
>
> Key: MATH-379
> URL: https://issues.apache.org/jira/browse/MATH-379
> Project: Commons Math
> Issue Type: New Feature
> Reporter: Gilles
> Assignee: Gilles
> Priority: Minor
> Attachments: MultidimensionalCounter.java
>
>
> Utility that converts from indices in a multidimensional structure to the corresponding index in a one-dimensional array.
> E.g. assuming that the ranges (in 3D) of indices are {2, 4, 3}, we'll have that
> (0, 0, 0) corresponds to 0
> (0, 0, 1) corresponds to 1
> ...
> (1, 0, 0) corresponds to 12
> ...
> (1, 3, 2) corresponds to 23
> I propose to add this class in the "util" package.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.