summaryrefslogtreecommitdiffstats
path: root/src/javax/vecmath/GMatrix.java
diff options
context:
space:
mode:
authorHarvey Harrison <[email protected]>2013-07-10 09:30:37 -0700
committerHarvey Harrison <[email protected]>2013-07-10 09:30:37 -0700
commit8143fe3b638b5a6b60ee717d98046856a2d2f547 (patch)
tree5a395167d9203d3218b4622685ffad993b308230 /src/javax/vecmath/GMatrix.java
parentae0eabff70c9b63eac241b9f30bd389356cfb220 (diff)
vecmath: introduce hash mixing helpers rather than a different float/double to bits helper
Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src/javax/vecmath/GMatrix.java')
-rw-r--r--src/javax/vecmath/GMatrix.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/javax/vecmath/GMatrix.java b/src/javax/vecmath/GMatrix.java
index a38d6a4..8b6a1cc 100644
--- a/src/javax/vecmath/GMatrix.java
+++ b/src/javax/vecmath/GMatrix.java
@@ -1388,16 +1388,16 @@ public class GMatrix implements java.io.Serializable, Cloneable {
public int hashCode() {
long bits = 1L;
- bits = 31L * bits + (long)nRow;
- bits = 31L * bits + (long)nCol;
+ bits = VecMathUtil.hashLongBits(bits, nRow);
+ bits = VecMathUtil.hashLongBits(bits, nCol);
for (int i = 0; i < nRow; i++) {
- for (int j = 0; j < nCol; j++) {
- bits = 31L * bits + VecMathUtil.doubleToLongBits(values[i][j]);
- }
+ for (int j = 0; j < nCol; j++) {
+ bits = VecMathUtil.hashDoubleBits(bits, values[i][j]);
+ }
}
- return (int) (bits ^ (bits >> 32));
+ return VecMathUtil.hashFinish(bits);
}