Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 17398 invoked from network); 2 Jan 2009 16:58:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Jan 2009 16:58:43 -0000 Received: (qmail 70405 invoked by uid 500); 2 Jan 2009 16:58:42 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 70322 invoked by uid 500); 2 Jan 2009 16:58:42 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 70311 invoked by uid 99); 2 Jan 2009 16:58:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Jan 2009 08:58:42 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of sujit.pal@comcast.net designates 76.96.30.16 as permitted sender) Received: from [76.96.30.16] (HELO QMTA01.emeryville.ca.mail.comcast.net) (76.96.30.16) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Jan 2009 16:58:32 +0000 Received: from OMTA11.emeryville.ca.mail.comcast.net ([76.96.30.36]) by QMTA01.emeryville.ca.mail.comcast.net with comcast id ydFH1a00C0mlR8UA1gyBEG; Fri, 02 Jan 2009 16:58:11 +0000 Received: from sirocco.healthline.com ([98.207.139.235]) by OMTA11.emeryville.ca.mail.comcast.net with comcast id ygy91a00W54vQYa8XgyAZu; Fri, 02 Jan 2009 16:58:11 +0000 Message-ID: <495E4757.4090305@comcast.net> Date: Fri, 02 Jan 2009 08:56:55 -0800 From: Sujit Pal User-Agent: Thunderbird 2.0.0.18 (X11/20081119) MIME-Version: 1.0 To: Commons Developers List Subject: Re: [math] Shoud OpenIntToDoubleHashMap get return NaN instead of 0 for key not found? References: <495E2834.9060409@gmail.com> In-Reply-To: <495E2834.9060409@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org If OpenIntToDoubleHashMap returns NaN for non-existent keys, then the Sparse Matrix could check for NaN to return 0 to its client. -sujit Phil Steitz wrote: > I am still working through this class and the sparse matrix class that > it was extracted from (thanks, Ismael and Sugit!), so I am not sure if > changing this would cause problems, but the current setup (returning 0 > for missing keys) limits usefulness of this class. I see how this is > convenient for sparse matrices; but I would see NaN as a more natural > return value for non-existent keys in the general case. > Alternatively, I guess we could add another method get(int key, > double missingReturn). > > Thoughts? > > Phil > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org