本文整理汇总了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;
}
示例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;
}
示例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;
}