Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 51826 invoked from network); 13 Dec 2010 00:48:22 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Dec 2010 00:48:22 -0000 Received: (qmail 65704 invoked by uid 500); 13 Dec 2010 00:48:21 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 65545 invoked by uid 500); 13 Dec 2010 00:48:21 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 65537 invoked by uid 99); 13 Dec 2010 00:48:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Dec 2010 00:48:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Dec 2010 00:48:21 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oBD0m0DC015536 for ; Mon, 13 Dec 2010 00:48:00 GMT Message-ID: <31810806.81971292201280837.JavaMail.jira@thor> Date: Sun, 12 Dec 2010 19:48:00 -0500 (EST) From: "Phil Steitz (JIRA)" To: issues@commons.apache.org Subject: [jira] Resolved: (MATH-448) Frequency get number of unique values In-Reply-To: <2510707.47511291216331335.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MATH-448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Phil Steitz resolved MATH-448. ------------------------------ Resolution: Fixed Thanks for the patch! I committed a slightly modified version in r1044981. I made the following changes to the patch: * Changed the javadoc to refer to "values" to be consistent with the rest of the documentation * Used keyset.size() to compute the result * Added test cases > Frequency get number of unique values > ------------------------------------- > > Key: MATH-448 > URL: https://issues.apache.org/jira/browse/MATH-448 > Project: Commons Math > Issue Type: New Feature > Reporter: Patrick Meyer > Priority: Minor > Fix For: 2.2 > > Attachments: MATH-448.patch, MATH-448.patch > > Original Estimate: 0.25h > Remaining Estimate: 0.25h > > It is often useful to know the number of unique elements in a frequency table. Could you add a simple method that returns the size of freqTable. It seems like it would be as simple as: > {code} > public int getUniqueCount(){ > return freqTable.size(); > } > {code} > Given that freqTable is private, there is no way to extend the class and add this method. Thanks! -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.