commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <>
Subject Re: [math] Math-817 and .equals questions. .
Date Fri, 09 Nov 2012 16:39:56 GMT
Hi Jared.

> Any thoughts on the below email?  If not, I will submit one patch, probably today or
> -------------------------------
> Hello,
> I am about to submit some code for issue Math-817 involving fitting multivariate normal
mixture models using the EM algorithm.  In order to simplify the unit test, I added overrode
equals and hashCode.  This in turn required me to make a few changes to code in the previously
resolved issues Math-815 and Math-816.  Am I supposed to just send one patch to 817, or am
I supposed to break the patches up according to issue number?
> Also, I notice the equals method in org.apache.commons.math3.linear.AbstractRealMatrix
directly compares the results of getEntry(), which are often doubles.  Is this OK?  I don't
have a great deal of experience in overriding equals where doubles are involved.  I have read
that it is a good idea to use Double.doubleToLongBits and the use "==" or "!=".

It will be better to have a discussion based on some actual code.
[If you need a feature for MATH-817, it's fine to add it in the same patch.]

Best regards,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message