Java Code Examples for org.apache.commons.math.exception.util.LocalizedFormats#DIMENSION

The following examples show how to use org.apache.commons.math.exception.util.LocalizedFormats#DIMENSION . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ZipfDistributionImpl.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new Zipf distribution with the given number of elements and
 * exponent.
 *
 * @param numberOfElements Number of elements.
 * @param exponent Exponent.
 * @exception NotStrictlyPositiveException if {@code numberOfElements <= 0}
 * or {@code exponent <= 0}.
 */
public ZipfDistributionImpl(final int numberOfElements,
                            final double exponent) {
    if (numberOfElements <= 0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.DIMENSION,
                                               numberOfElements);
    }
    if (exponent <= 0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.EXPONENT,
                                               exponent);
    }

    this.numberOfElements = numberOfElements;
    this.exponent = exponent;
}
 
Example 2
Source File: AbstractFieldMatrix.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 3
Source File: ZipfDistributionImpl.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new Zipf distribution with the given number of elements and
 * exponent.
 *
 * @param numberOfElements Number of elements.
 * @param exponent Exponent.
 * @exception NotStrictlyPositiveException if {@code numberOfElements <= 0}
 * or {@code exponent <= 0}.
 */
public ZipfDistributionImpl(final int numberOfElements,
                            final double exponent) {
    if (numberOfElements <= 0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.DIMENSION,
                                               numberOfElements);
    }
    if (exponent <= 0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.EXPONENT,
                                               exponent);
    }

    this.numberOfElements = numberOfElements;
    this.exponent = exponent;
}
 
Example 4
Source File: AbstractFieldMatrix.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 5
Source File: ZipfDistributionImpl.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new Zipf distribution with the given number of elements and
 * exponent.
 *
 * @param numberOfElements Number of elements.
 * @param exponent Exponent.
 * @exception NotStrictlyPositiveException if {@code numberOfElements <= 0}
 * or {@code exponent <= 0}.
 */
public ZipfDistributionImpl(final int numberOfElements,
                            final double exponent) {
    if (numberOfElements <= 0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.DIMENSION,
                                               numberOfElements);
    }
    if (exponent <= 0) {
        throw new NotStrictlyPositiveException(LocalizedFormats.EXPONENT,
                                               exponent);
    }

    this.numberOfElements = numberOfElements;
    this.exponent = exponent;
}
 
Example 6
Source File: AbstractFieldMatrix.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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;
}