当前位置: 首页>>代码示例>>Java>>正文


Java MathUtils.hash方法代码示例

本文整理汇总了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;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:21,代码来源:AbstractRealMatrix.java

示例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;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:15,代码来源:StatisticalSummaryValues.java

示例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;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:18,代码来源:SummaryStatistics.java

示例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;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:19,代码来源:MultivariateSummaryStatistics.java

示例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));
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:15,代码来源:Complex.java

示例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;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:20,代码来源:RealMatrixImpl.java

示例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;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:18,代码来源:SummaryStatistics.java

示例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;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:20,代码来源:MultivariateSummaryStatistics.java

示例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));
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:16,代码来源:Complex.java

示例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));
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:15,代码来源:Vector3D.java

示例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);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:13,代码来源:ArrayRealVector.java

示例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);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:15,代码来源:Vector1D.java

示例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);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:14,代码来源:ArrayRealVector.java

示例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));
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:15,代码来源:Complex.java

示例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());
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:9,代码来源:AbstractStorelessUnivariateStatistic.java


注:本文中的org.apache.commons.math.util.MathUtils.hash方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。