本文整理汇总了Java中org.apache.commons.math.util.MathUtils.hash方法的典型用法代码示例。如果您正苦于以下问题:Java MathUtils.hash方法的具体用法?Java MathUtils.hash怎么用?Java MathUtils.hash使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.math.util.MathUtils
的用法示例。
在下文中一共展示了MathUtils.hash方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hashCode
import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/**
* Computes a hashcode for the matrix.
*
* @return hashcode for matrix
*/
@Override
public int hashCode() {
int ret = 7;
final int nRows = getRowDimension();
final int nCols = getColumnDimension();
ret = ret * 31 + nRows;
ret = ret * 31 + nCols;
for (int row = 0; row < nRows; ++row) {
for (int col = 0; col < nCols; ++col) {
ret = ret * 31 + (11 * (row+1) + 17 * (col+1)) *
MathUtils.hash(getEntry(row, col));
}
}
return ret;
}
示例2: hashCode
import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/**
* Returns hash code based on values of statistics
*
* @return hash code
*/
public int hashCode() {
int result = 31 + MathUtils.hash(getMax());
result = result * 31 + MathUtils.hash(getMean());
result = result * 31 + MathUtils.hash(getMin());
result = result * 31 + MathUtils.hash(getN());
result = result * 31 + MathUtils.hash(getSum());
result = result * 31 + MathUtils.hash(getVariance());
return result;
}
示例3: hashCode
import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/**
* Returns hash code based on values of statistics
*
* @return hash code
*/
public int hashCode() {
int result = 31 + MathUtils.hash(getGeometricMean());
result = result * 31 + MathUtils.hash(getGeometricMean());
result = result * 31 + MathUtils.hash(getMax());
result = result * 31 + MathUtils.hash(getMean());
result = result * 31 + MathUtils.hash(getMin());
result = result * 31 + MathUtils.hash(getN());
result = result * 31 + MathUtils.hash(getSum());
result = result * 31 + MathUtils.hash(getSumsq());
result = result * 31 + MathUtils.hash(getVariance());
return result;
}
示例4: hashCode
import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/**
* Returns hash code based on values of statistics
*
* @return hash code
*/
public int hashCode() {
int result = 31 + MathUtils.hash(getGeometricMean());
result = result * 31 + MathUtils.hash(getGeometricMean());
result = result * 31 + MathUtils.hash(getMax());
result = result * 31 + MathUtils.hash(getMean());
result = result * 31 + MathUtils.hash(getMin());
result = result * 31 + MathUtils.hash(getN());
result = result * 31 + MathUtils.hash(getSum());
result = result * 31 + MathUtils.hash(getSumSq());
result = result * 31 + MathUtils.hash(getSumLog());
result = result * 31 + getCovariance().hashCode();
return result;
}
示例5: hashCode
import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/**
* Get a hashCode for the complex number.
* <p>
* All NaN values have the same hash code.</p>
*
* @return a hash code value for this object
*/
public int hashCode() {
if (isNaN()) {
return 7;
}
return 37 * (17 * MathUtils.hash(imaginary) +
MathUtils.hash(real));
}
示例6: hashCode
import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/**
* Computes a hashcode for the matrix.
*
* @return hashcode for matrix
*/
public int hashCode() {
int ret = 7;
int nRows = getRowDimension();
int nCols = getColumnDimension();
ret = ret * 31 + nRows;
ret = ret * 31 + nCols;
for (int row = 0; row < nRows; row++) {
for (int col = 0; col < nCols; col++) {
ret = ret * 31 + (11 * (row+1) + 17 * (col+1)) *
MathUtils.hash(data[row][col]);
}
}
return ret;
}
示例7: hashCode
import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/**
* Returns hash code based on values of statistics
* @return hash code
*/
@Override
public int hashCode() {
int result = 31 + MathUtils.hash(getGeometricMean());
result = result * 31 + MathUtils.hash(getGeometricMean());
result = result * 31 + MathUtils.hash(getMax());
result = result * 31 + MathUtils.hash(getMean());
result = result * 31 + MathUtils.hash(getMin());
result = result * 31 + MathUtils.hash(getN());
result = result * 31 + MathUtils.hash(getSum());
result = result * 31 + MathUtils.hash(getSumsq());
result = result * 31 + MathUtils.hash(getVariance());
return result;
}
示例8: hashCode
import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/**
* Returns hash code based on values of statistics
*
* @return hash code
*/
@Override
public int hashCode() {
int result = 31 + MathUtils.hash(getGeometricMean());
result = result * 31 + MathUtils.hash(getGeometricMean());
result = result * 31 + MathUtils.hash(getMax());
result = result * 31 + MathUtils.hash(getMean());
result = result * 31 + MathUtils.hash(getMin());
result = result * 31 + MathUtils.hash(getN());
result = result * 31 + MathUtils.hash(getSum());
result = result * 31 + MathUtils.hash(getSumSq());
result = result * 31 + MathUtils.hash(getSumLog());
result = result * 31 + getCovariance().hashCode();
return result;
}
示例9: hashCode
import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/**
* Get a hashCode for the complex number.
* <p>
* All NaN values have the same hash code.</p>
*
* @return a hash code value for this object
*/
@Override
public int hashCode() {
if (isNaN()) {
return 7;
}
return 37 * (17 * MathUtils.hash(imaginary) +
MathUtils.hash(real));
}
示例10: hashCode
import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/**
* Get a hashCode for the 3D vector.
* <p>
* All NaN values have the same hash code.</p>
*
* @return a hash code value for this object
*/
@Override
public int hashCode() {
if (isNaN()) {
return 8;
}
return 31 * (23 * MathUtils.hash(x) + 19 * MathUtils.hash(y) + MathUtils.hash(z));
}
示例11: hashCode
import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/**
* Get a hashCode for the real vector.
* <p>All NaN values have the same hash code.</p>
* @return a hash code value for this object
*/
@Override
public int hashCode() {
if (isNaN()) {
return 9;
}
return MathUtils.hash(data);
}
示例12: hashCode
import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/**
* Get a hashCode for the 1D vector.
* <p>
* All NaN values have the same hash code.</p>
*
* @return a hash code value for this object
*/
@Override
public int hashCode() {
if (isNaN()) {
return 7785;
}
return 997 * MathUtils.hash(x);
}
示例13: hashCode
import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/**
* Get a hashCode for the real vector.
* All {@code NaN} values have the same hash code.
*
* @return a hash code.
*/
@Override
public int hashCode() {
if (isNaN()) {
return 9;
}
return MathUtils.hash(data);
}
示例14: hashCode
import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/**
* Get a hashCode for the complex number.
* <p>
* All NaN values have the same hash code.
*
* @return a hash code value for this object
*/
public int hashCode() {
if (isNaN()) {
return 7;
}
return 37 * (17 * MathUtils.hash(imaginary) +
MathUtils.hash(real));
}
示例15: hashCode
import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/**
* Returns hash code based on getResult() and getN()
*
* @return hash code
*/
public int hashCode() {
return 31* (31 + MathUtils.hash(getResult())) + MathUtils.hash(getN());
}