summaryrefslogtreecommitdiffstats
path: root/src/javax/vecmath/GMatrix.java
diff options
context:
space:
mode:
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);
}