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


Java LocalizedFormats.NUMBER_OF_INTERPOLATION_POINTS属性代码示例

本文整理汇总了Java中org.apache.commons.math3.exception.util.LocalizedFormats.NUMBER_OF_INTERPOLATION_POINTS属性的典型用法代码示例。如果您正苦于以下问题:Java LocalizedFormats.NUMBER_OF_INTERPOLATION_POINTS属性的具体用法?Java LocalizedFormats.NUMBER_OF_INTERPOLATION_POINTS怎么用?Java LocalizedFormats.NUMBER_OF_INTERPOLATION_POINTS使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.commons.math3.exception.util.LocalizedFormats的用法示例。


在下文中一共展示了LocalizedFormats.NUMBER_OF_INTERPOLATION_POINTS属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setup

/**
 * Performs validity checks.
 *
 * @param lowerBound Lower bounds (constraints) of the objective variables.
 * @param upperBound Upperer bounds (constraints) of the objective variables.
 */
private void setup(double[] lowerBound,
                   double[] upperBound) {
    printMethod(); // XXX

    double[] init = getStartPoint();
    final int dimension = init.length;

    // Check problem dimension.
    if (dimension < MINIMUM_PROBLEM_DIMENSION) {
        throw new NumberIsTooSmallException(dimension, MINIMUM_PROBLEM_DIMENSION, true);
    }
    // Check number of interpolation points.
    final int[] nPointsInterval = { dimension + 2, (dimension + 2) * (dimension + 1) / 2 };
    if (numberOfInterpolationPoints < nPointsInterval[0] ||
        numberOfInterpolationPoints > nPointsInterval[1]) {
        throw new OutOfRangeException(LocalizedFormats.NUMBER_OF_INTERPOLATION_POINTS,
                                      numberOfInterpolationPoints,
                                      nPointsInterval[0],
                                      nPointsInterval[1]);
    }

    // Initialize bound differences.
    boundDifference = new double[dimension];

    double requiredMinDiff = 2 * initialTrustRegionRadius;
    double minDiff = Double.POSITIVE_INFINITY;
    for (int i = 0; i < dimension; i++) {
        boundDifference[i] = upperBound[i] - lowerBound[i];
        minDiff = FastMath.min(minDiff, boundDifference[i]);
    }
    if (minDiff < requiredMinDiff) {
        initialTrustRegionRadius = minDiff / 3.0;
    }

    // Initialize the data structures used by the "bobyqa" method.
    bMatrix = new Array2DRowRealMatrix(dimension + numberOfInterpolationPoints,
                                       dimension);
    zMatrix = new Array2DRowRealMatrix(numberOfInterpolationPoints,
                                       numberOfInterpolationPoints - dimension - 1);
    interpolationPoints = new Array2DRowRealMatrix(numberOfInterpolationPoints,
                                                   dimension);
    originShift = new ArrayRealVector(dimension);
    fAtInterpolationPoints = new ArrayRealVector(numberOfInterpolationPoints);
    trustRegionCenterOffset = new ArrayRealVector(dimension);
    gradientAtTrustRegionCenter = new ArrayRealVector(dimension);
    lowerDifference = new ArrayRealVector(dimension);
    upperDifference = new ArrayRealVector(dimension);
    modelSecondDerivativesParameters = new ArrayRealVector(numberOfInterpolationPoints);
    newPoint = new ArrayRealVector(dimension);
    alternativeNewPoint = new ArrayRealVector(dimension);
    trialStepPoint = new ArrayRealVector(dimension);
    lagrangeValuesAtNewPoint = new ArrayRealVector(dimension + numberOfInterpolationPoints);
    modelSecondDerivativesValues = new ArrayRealVector(dimension * (dimension + 1) / 2);
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:60,代码来源:BOBYQAOptimizer.java


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