You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by Benson Margulies <bi...@gmail.com> on 2010/01/11 04:36:24 UTC

[math] no-such-integer value

Colt code is inconsistent in dealing with the following case:

 iIntSomethingHashMap.keyOf(someValue)

Some code we got from them returns 0 if there is no such value, other
code returns MIN_VALUE. In floating-point land, it returns NAN.

Personally, I'd be inclined to nuke the entire API. It's implemented
as the obvious iteration, and the caller can iterate for themselves
without creating a shoot-yourself opportunity for the unwary.

Another alternative is to make the signature

keyType keyOf(valueType value, boolean[] present)

I'm in favor of removal, but I could live with the boolean. Thoughts?

Re: [math] no-such-integer value

Posted by Isabel Drost <is...@apache.org>.
On Mon Grant Ingersoll <gs...@apache.org> wrote:

> I'm sensing a theme.  I think for this stuff we should prune fairly
> aggressively, then add back in places once we have a need.

+1

Isabel

Re: [math] no-such-integer value

Posted by Grant Ingersoll <gs...@apache.org>.
I'm sensing a theme.  I think for this stuff we should prune fairly aggressively, then add back in places once we have a need.

On Jan 10, 2010, at 11:51 PM, Jake Mannix wrote:

> On Sun, Jan 10, 2010 at 8:05 PM, Ted Dunning <te...@gmail.com> wrote:
> 
>> Nuke it if you don't use it.
>> 
> 
> +1 to this
> 
>  -jake


Re: [math] no-such-integer value

Posted by Jake Mannix <ja...@gmail.com>.
On Sun, Jan 10, 2010 at 8:05 PM, Ted Dunning <te...@gmail.com> wrote:

> Nuke it if you don't use it.
>

+1 to this

  -jake

Re: [math] no-such-integer value

Posted by Ted Dunning <te...@gmail.com>.
Nuke it if you don't use it.

On Sun, Jan 10, 2010 at 7:36 PM, Benson Margulies <bi...@gmail.com>wrote:

> Personally, I'd be inclined to nuke the entire API. It's implemented
> as the obvious iteration, and the caller can iterate for themselves
> without creating a shoot-yourself opportunity for the unwary.
>
> Another alternative is to make the signature
>
> keyType keyOf(valueType value, boolean[] present)
>
> I'm in favor of removal, but I could live with the boolean. Thoughts?
>



-- 
Ted Dunning, CTO
DeepDyve