本文整理汇总了Java中org.apache.commons.math3.util.MathUtils.hash方法的典型用法代码示例。如果您正苦于以下问题:Java MathUtils.hash方法的具体用法?Java MathUtils.hash怎么用?Java MathUtils.hash使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.math3.util.MathUtils
的用法示例。
在下文中一共展示了MathUtils.hash方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hashCode
import org.apache.commons.math3.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.math3.util.MathUtils; //导入方法依赖的package包/类
/**
* Get a hashCode for the 2D 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 542;
}
return 1759 * MathUtils.hash(alpha);
}
示例3: hashCode
import org.apache.commons.math3.util.MathUtils; //导入方法依赖的package包/类
/**
* Get a hashCode for the 2D 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 542;
}
return 134 * (37 * MathUtils.hash(theta) + MathUtils.hash(phi));
}
示例4: hashCode
import org.apache.commons.math3.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);
}
示例5: hashCode
import org.apache.commons.math3.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 642;
}
return 643 * (164 * MathUtils.hash(x) + 3 * MathUtils.hash(y) + MathUtils.hash(z));
}
示例6: hashCode
import org.apache.commons.math3.util.MathUtils; //导入方法依赖的package包/类
/**
* Get a hashCode for the 2D 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 542;
}
return 122 * (76 * MathUtils.hash(x) + MathUtils.hash(y));
}
示例7: hashCode
import org.apache.commons.math3.util.MathUtils; //导入方法依赖的package包/类
/**
* Returns hash code based on values of statistics
*
* @return hash code
*/
@Override
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;
}
示例8: hashCode
import org.apache.commons.math3.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;
}
示例9: hashCode
import org.apache.commons.math3.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;
}
示例10: hashCode
import org.apache.commons.math3.util.MathUtils; //导入方法依赖的package包/类
/**
* Get a hashCode for the complex number.
* Any {@code Double.NaN} value in real or imaginary part produces
* the same hash code {@code 7}.
*
* @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));
}
示例11: hashCode
import org.apache.commons.math3.util.MathUtils; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public int hashCode() {
// "Effective Java" (second edition, p. 47).
int result = 17;
for (double comp : new double[] { q0, q1, q2, q3 }) {
final int c = MathUtils.hash(comp);
result = 31 * result + c;
}
return result;
}
示例12: hashCode
import org.apache.commons.math3.util.MathUtils; //导入方法依赖的package包/类
/**
* {@inheritDoc} All {@code NaN} values have the same hash code.
*/
@Override
public int hashCode() {
if (isNaN()) {
return 9;
}
return MathUtils.hash(data);
}
示例13: hashCode
import org.apache.commons.math3.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.math3.util.MathUtils; //导入方法依赖的package包/类
/**
* Returns hash code based on getResult() and getN()
*
* @return hash code
*/
@Override
public int hashCode() {
return 31* (31 + MathUtils.hash(getResult())) + MathUtils.hash(getN());
}
示例15: hashCode
import org.apache.commons.math3.util.MathUtils; //导入方法依赖的package包/类
/**
* Get a hashCode for the derivative structure.
* @return a hash code value for this object
* @since 3.2
*/
@Override
public int hashCode() {
return 743 + 809 * MathUtils.hash(value) + 167 * derivatives.hashCode();
}