[jira] [Updated] (MATH-473) Frequency: new option: NON-sorted
[ https://issues.apache.org/jira/browse/MATH-473?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gilles updated MATH-473: Priority: Minor (was: Major) Fix Version/s: (was: 3.1) > Frequency: new option: NON-sorted > - > > Key: MATH-473 > URL: https://issues.apache.org/jira/browse/MATH-473 > Project: Commons Math > Issue Type: Improvement >Affects Versions: 1.0, 1.1, 1.2, 2.0, 2.1 >Reporter: Dan Checkoway >Priority: Minor > Attachments: MATH-473.patch > > > I have a request for enhancement on org.apache.commons.math.stat.Frequency. > I would like to be able to specify that the the backing map NOT be sorted. > Right now it uses TreeMap. I would like to have the option of specifying > that sorting is not important, and would in fact hinder performance, and a > plain old HashMap should be used instead. > i.e. constructor such as: > public Frequency(boolean sorted); > If sorted is true, use a TreeMap. If sorted is false, use a HashMap. Is > this feasible? I'd be happy to contribute a patch if that would help. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (MATH-473) Frequency: new option: NON-sorted
[ https://issues.apache.org/jira/browse/MATH-473?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gilles updated MATH-473: Fix Version/s: (was: 3.0) 3.1 Postponed due to the absence of an updated patch. > Frequency: new option: NON-sorted > - > > Key: MATH-473 > URL: https://issues.apache.org/jira/browse/MATH-473 > Project: Commons Math > Issue Type: Improvement >Affects Versions: 1.0, 1.1, 1.2, 2.0, 2.1 >Reporter: Dan Checkoway > Fix For: 3.1 > > Attachments: MATH-473.patch > > > I have a request for enhancement on org.apache.commons.math.stat.Frequency. > I would like to be able to specify that the the backing map NOT be sorted. > Right now it uses TreeMap. I would like to have the option of specifying > that sorting is not important, and would in fact hinder performance, and a > plain old HashMap should be used instead. > i.e. constructor such as: > public Frequency(boolean sorted); > If sorted is true, use a TreeMap. If sorted is false, use a HashMap. Is > this feasible? I'd be happy to contribute a patch if that would help. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (MATH-473) Frequency: new option: NON-sorted
[ https://issues.apache.org/jira/browse/MATH-473?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Phil Steitz updated MATH-473: - Assignee: (was: Phil Steitz) > Frequency: new option: NON-sorted > - > > Key: MATH-473 > URL: https://issues.apache.org/jira/browse/MATH-473 > Project: Commons Math > Issue Type: Improvement >Affects Versions: 1.0, 1.1, 1.2, 2.0, 2.1 >Reporter: Dan Checkoway > Fix For: 3.0 > > Attachments: MATH-473.patch > > > I have a request for enhancement on org.apache.commons.math.stat.Frequency. > I would like to be able to specify that the the backing map NOT be sorted. > Right now it uses TreeMap. I would like to have the option of specifying > that sorting is not important, and would in fact hinder performance, and a > plain old HashMap should be used instead. > i.e. constructor such as: > public Frequency(boolean sorted); > If sorted is true, use a TreeMap. If sorted is false, use a HashMap. Is > this feasible? I'd be happy to contribute a patch if that would help. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (MATH-473) Frequency: new option: NON-sorted
[ https://issues.apache.org/jira/browse/MATH-473?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Dan Checkoway updated MATH-473: --- Attachment: MATH-473.patch Attached is a patch with a first stab at decoupled interface + impl. I left Frequency completely backward compatible, but there are now a few layers: - Distribution -- this is the base interface that defines a distribution of per-key counts - AbstractDistribution -- simple base class that provides tracking counts in a map (supplied by the subclass at construction) - AbstractFrequency -- adds the getPct functionality and a simple toString - Frequency -- as it was, uses TreeMap, ensures Comparable, promotes primitives to Long, provides "cumulative" functions, etc. - SimpleFrequency -- uses a simple HashMap, provides no "cumulative" functions It passes all existing tests. Please code review and integrate however you see fit. Thanks! > Frequency: new option: NON-sorted > - > > Key: MATH-473 > URL: https://issues.apache.org/jira/browse/MATH-473 > Project: Commons Math > Issue Type: Improvement >Affects Versions: 1.0, 1.1, 1.2, 2.0, 2.1 >Reporter: Dan Checkoway > Fix For: 3.0 > > Attachments: MATH-473.patch > > > I have a request for enhancement on org.apache.commons.math.stat.Frequency. > I would like to be able to specify that the the backing map NOT be sorted. > Right now it uses TreeMap. I would like to have the option of specifying > that sorting is not important, and would in fact hinder performance, and a > plain old HashMap should be used instead. > i.e. constructor such as: > public Frequency(boolean sorted); > If sorted is true, use a TreeMap. If sorted is false, use a HashMap. Is > this feasible? I'd be happy to contribute a patch if that would help. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (MATH-473) Frequency: new option: NON-sorted
[ https://issues.apache.org/jira/browse/MATH-473?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Phil Steitz updated MATH-473: - Affects Version/s: 1.0 1.1 1.2 2.0 2.1 Fix Version/s: 3.0 > Frequency: new option: NON-sorted > - > > Key: MATH-473 > URL: https://issues.apache.org/jira/browse/MATH-473 > Project: Commons Math > Issue Type: Improvement >Affects Versions: 1.0, 1.1, 1.2, 2.0, 2.1 >Reporter: Dan Checkoway > Fix For: 3.0 > > > I have a request for enhancement on org.apache.commons.math.stat.Frequency. > I would like to be able to specify that the the backing map NOT be sorted. > Right now it uses TreeMap. I would like to have the option of specifying > that sorting is not important, and would in fact hinder performance, and a > plain old HashMap should be used instead. > i.e. constructor such as: > public Frequency(boolean sorted); > If sorted is true, use a TreeMap. If sorted is false, use a HashMap. Is > this feasible? I'd be happy to contribute a patch if that would help. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.