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


Java LocalizedFormats.DIMENSION属性代码示例

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


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

示例1: ZipfDistribution

/**
 * Creates a Zipf distribution.
 *
 * @param rng Random number generator.
 * @param numberOfElements Number of elements.
 * @param exponent Exponent.
 * @exception NotStrictlyPositiveException if {@code numberOfElements <= 0}
 * or {@code exponent <= 0}.
 * @since 3.1
 */
public ZipfDistribution(RandomGenerator rng,
                        int numberOfElements,
                        double exponent)
    throws NotStrictlyPositiveException {
    super(rng);

    if (numberOfElements <= 0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.DIMENSION,
                                               numberOfElements);
    }
    if (exponent <= 0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.EXPONENT,
                                               exponent);
    }

    this.numberOfElements = numberOfElements;
    this.exponent = exponent;
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:28,代码来源:ZipfDistribution.java

示例2: checkValidity

/**
 * Solution validity check.
 * 
 * @param solution
 *            List of tasks.
 * 
 * @throws InvalidRepresentationException
 *             Invalid solution exception.
 */
@Override
protected void checkValidity(List<Task> solution) throws InvalidRepresentationException {
	/*
	 * List of tasks should not be empty.
	 */
	if (solution.size() == 0) {
		throw new InvalidRepresentationException(LocalizedFormats.DIMENSION, solution.size());
	}
}
 
开发者ID:TodorBalabanov,项目名称:Genetic-Algorithm-for-Machinery-Usage-Scheduling,代码行数:18,代码来源:TaskListChromosome.java

示例3: AbstractFieldMatrix

/**
 * Create a new FieldMatrix<T> with the supplied row and column dimensions.
 *
 * @param field Field to which the elements belong.
 * @param rowDimension Number of rows in the new matrix.
 * @param columnDimension Number of columns in the new matrix.
 * @throws NotStrictlyPositiveException if row or column dimension is not
 * positive.
 */
protected AbstractFieldMatrix(final Field<T> field,
                              final int rowDimension,
                              final int columnDimension)
    throws NotStrictlyPositiveException {
    if (rowDimension <= 0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.DIMENSION,
                                               rowDimension);
    }
    if (columnDimension <= 0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.DIMENSION,
                                               columnDimension);
    }
    this.field = field;
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:23,代码来源:AbstractFieldMatrix.java

示例4: AbstractFieldMatrix

/**
 * Create a new FieldMatrix<T> with the supplied row and column dimensions.
 *
 * @param field Field to which the elements belong.
 * @param rowDimension Number of rows in the new matrix.
 * @param columnDimension Number of columns in the new matrix.
 * @throws NotStrictlyPositiveException if row or column dimension is not
 * positive.
 */
protected AbstractFieldMatrix(final Field<T> field,
                              final int rowDimension,
                              final int columnDimension) {
    if (rowDimension <= 0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.DIMENSION,
                                               rowDimension);
    }
    if (columnDimension <= 0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.DIMENSION,
                                               columnDimension);
    }
    this.field = field;
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:22,代码来源:AbstractFieldMatrix.java


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