org.apache.commons.math3.linear.NonSquareMatrixException Java Examples

The following examples show how to use org.apache.commons.math3.linear.NonSquareMatrixException. 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: Math_14_Weight_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * @param weight Weight matrix.
 * @throws NonSquareMatrixException if the argument is not
 * a square matrix.
 */
public Weight(RealMatrix weight) {
    if (weight.getColumnDimension() != weight.getRowDimension()) {
        throw new NonSquareMatrixException(weight.getColumnDimension(),
                                           weight.getRowDimension());
    }

    weightMatrix = weight.copy();
}
 
Example #2
Source File: Weight.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param weight Weight matrix.
 * @throws NonSquareMatrixException if the argument is not
 * a square matrix.
 */
public Weight(RealMatrix weight) {
    if (weight.getColumnDimension() != weight.getRowDimension()) {
        throw new NonSquareMatrixException(weight.getColumnDimension(),
                                           weight.getRowDimension());
    }

    weightMatrix = weight.copy();
}
 
Example #3
Source File: Weight.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param weight Weight matrix.
 * @throws NonSquareMatrixException if the argument is not
 * a square matrix.
 */
public Weight(RealMatrix weight) {
    if (weight.getColumnDimension() != weight.getRowDimension()) {
        throw new NonSquareMatrixException(weight.getColumnDimension(),
                                           weight.getRowDimension());
    }

    weightMatrix = weight.copy();
}
 
Example #4
Source File: Weight.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param weight Weight matrix.
 * @throws NonSquareMatrixException if the argument is not
 * a square matrix.
 */
public Weight(RealMatrix weight) {
    if (weight.getColumnDimension() != weight.getRowDimension()) {
        throw new NonSquareMatrixException(weight.getColumnDimension(),
                                           weight.getRowDimension());
    }

    weightMatrix = weight.copy();
}
 
Example #5
Source File: Weight.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param weight Weight matrix.
 * @throws NonSquareMatrixException if the argument is not
 * a square matrix.
 */
public Weight(RealMatrix weight) {
    if (weight.getColumnDimension() != weight.getRowDimension()) {
        throw new NonSquareMatrixException(weight.getColumnDimension(),
                                           weight.getRowDimension());
    }

    weightMatrix = weight.copy();
}
 
Example #6
Source File: Weight.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param weight Weight matrix.
 * @throws NonSquareMatrixException if the argument is not
 * a square matrix.
 */
public Weight(RealMatrix weight) {
    if (weight.getColumnDimension() != weight.getRowDimension()) {
        throw new NonSquareMatrixException(weight.getColumnDimension(),
                                           weight.getRowDimension());
    }

    weightMatrix = weight.copy();
}
 
Example #7
Source File: Weight.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param weight Weight matrix.
 * @throws NonSquareMatrixException if the argument is not
 * a square matrix.
 */
public Weight(RealMatrix weight) {
    if (weight.getColumnDimension() != weight.getRowDimension()) {
        throw new NonSquareMatrixException(weight.getColumnDimension(),
                                           weight.getRowDimension());
    }

    weightMatrix = weight.copy();
}
 
Example #8
Source File: Weight.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param weight Weight matrix.
 * @throws NonSquareMatrixException if the argument is not
 * a square matrix.
 */
public Weight(RealMatrix weight) {
    if (weight.getColumnDimension() != weight.getRowDimension()) {
        throw new NonSquareMatrixException(weight.getColumnDimension(),
                                           weight.getRowDimension());
    }

    weightMatrix = weight.copy();
}
 
Example #9
Source File: Weight.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param weight Weight matrix.
 * @throws NonSquareMatrixException if the argument is not
 * a square matrix.
 */
public Weight(RealMatrix weight) {
    if (weight.getColumnDimension() != weight.getRowDimension()) {
        throw new NonSquareMatrixException(weight.getColumnDimension(),
                                           weight.getRowDimension());
    }

    weightMatrix = weight.copy();
}
 
Example #10
Source File: Weight.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param weight Weight matrix.
 * @throws NonSquareMatrixException if the argument is not
 * a square matrix.
 */
public Weight(RealMatrix weight) {
    if (weight.getColumnDimension() != weight.getRowDimension()) {
        throw new NonSquareMatrixException(weight.getColumnDimension(),
                                           weight.getRowDimension());
    }

    weightMatrix = weight.copy();
}
 
Example #11
Source File: Weight.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param weight Weight matrix.
 * @throws NonSquareMatrixException if the argument is not
 * a square matrix.
 */
public Weight(RealMatrix weight) {
    if (weight.getColumnDimension() != weight.getRowDimension()) {
        throw new NonSquareMatrixException(weight.getColumnDimension(),
                                           weight.getRowDimension());
    }

    weightMatrix = weight.copy();
}
 
Example #12
Source File: Math_14_Weight_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * @param weight Weight matrix.
 * @throws NonSquareMatrixException if the argument is not
 * a square matrix.
 */
public Weight(RealMatrix weight) {
    if (weight.getColumnDimension() != weight.getRowDimension()) {
        throw new NonSquareMatrixException(weight.getColumnDimension(),
                                           weight.getRowDimension());
    }

    weightMatrix = weight.copy();
}
 
Example #13
Source File: AbstractMultipleLinearRegression.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Validates that the x data and covariance matrix have the same
 * number of rows and that the covariance matrix is square.
 *
 * @param x the [n,k] array representing the x sample
 * @param covariance the [n,n] array representing the covariance matrix
 * @throws DimensionMismatchException if the number of rows in x is not equal
 * to the number of rows in covariance
 * @throws NonSquareMatrixException if the covariance matrix is not square
 */
protected void validateCovarianceData(double[][] x, double[][] covariance) {
    if (x.length != covariance.length) {
        throw new DimensionMismatchException(x.length, covariance.length);
    }
    if (covariance.length > 0 && covariance.length != covariance[0].length) {
        throw new NonSquareMatrixException(covariance.length, covariance[0].length);
    }
}
 
Example #14
Source File: AbstractMultipleLinearRegression.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Validates that the x data and covariance matrix have the same
 * number of rows and that the covariance matrix is square.
 *
 * @param x the [n,k] array representing the x sample
 * @param covariance the [n,n] array representing the covariance matrix
 * @throws DimensionMismatchException if the number of rows in x is not equal
 * to the number of rows in covariance
 * @throws NonSquareMatrixException if the covariance matrix is not square
 */
protected void validateCovarianceData(double[][] x, double[][] covariance) {
    if (x.length != covariance.length) {
        throw new DimensionMismatchException(x.length, covariance.length);
    }
    if (covariance.length > 0 && covariance.length != covariance[0].length) {
        throw new NonSquareMatrixException(covariance.length, covariance[0].length);
    }
}
 
Example #15
Source File: AbstractMultipleLinearRegression.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Validates that the x data and covariance matrix have the same
 * number of rows and that the covariance matrix is square.
 *
 * @param x the [n,k] array representing the x sample
 * @param covariance the [n,n] array representing the covariance matrix
 * @throws DimensionMismatchException if the number of rows in x is not equal
 * to the number of rows in covariance
 * @throws NonSquareMatrixException if the covariance matrix is not square
 */
protected void validateCovarianceData(double[][] x, double[][] covariance) {
    if (x.length != covariance.length) {
        throw new DimensionMismatchException(x.length, covariance.length);
    }
    if (covariance.length > 0 && covariance.length != covariance[0].length) {
        throw new NonSquareMatrixException(covariance.length, covariance[0].length);
    }
}
 
Example #16
Source File: AbstractMultipleLinearRegression.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Validates that the x data and covariance matrix have the same
 * number of rows and that the covariance matrix is square.
 *
 * @param x the [n,k] array representing the x sample
 * @param covariance the [n,n] array representing the covariance matrix
 * @throws DimensionMismatchException if the number of rows in x is not equal
 * to the number of rows in covariance
 * @throws NonSquareMatrixException if the covariance matrix is not square
 */
protected void validateCovarianceData(double[][] x, double[][] covariance) {
    if (x.length != covariance.length) {
        throw new DimensionMismatchException(x.length, covariance.length);
    }
    if (covariance.length > 0 && covariance.length != covariance[0].length) {
        throw new NonSquareMatrixException(covariance.length, covariance[0].length);
    }
}
 
Example #17
Source File: AbstractMultipleLinearRegression.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Validates that the x data and covariance matrix have the same
 * number of rows and that the covariance matrix is square.
 *
 * @param x the [n,k] array representing the x sample
 * @param covariance the [n,n] array representing the covariance matrix
 * @throws DimensionMismatchException if the number of rows in x is not equal
 * to the number of rows in covariance
 * @throws NonSquareMatrixException if the covariance matrix is not square
 */
protected void validateCovarianceData(double[][] x, double[][] covariance) {
    if (x.length != covariance.length) {
        throw new DimensionMismatchException(x.length, covariance.length);
    }
    if (covariance.length > 0 && covariance.length != covariance[0].length) {
        throw new NonSquareMatrixException(covariance.length, covariance[0].length);
    }
}
 
Example #18
Source File: AbstractMultipleLinearRegression.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Validates that the x data and covariance matrix have the same
 * number of rows and that the covariance matrix is square.
 *
 * @param x the [n,k] array representing the x sample
 * @param covariance the [n,n] array representing the covariance matrix
 * @throws DimensionMismatchException if the number of rows in x is not equal
 * to the number of rows in covariance
 * @throws NonSquareMatrixException if the covariance matrix is not square
 */
protected void validateCovarianceData(double[][] x, double[][] covariance) {
    if (x.length != covariance.length) {
        throw new DimensionMismatchException(x.length, covariance.length);
    }
    if (covariance.length > 0 && covariance.length != covariance[0].length) {
        throw new NonSquareMatrixException(covariance.length, covariance[0].length);
    }
}
 
Example #19
Source File: AbstractMultipleLinearRegression.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Validates that the x data and covariance matrix have the same
 * number of rows and that the covariance matrix is square.
 *
 * @param x the [n,k] array representing the x sample
 * @param covariance the [n,n] array representing the covariance matrix
 * @throws DimensionMismatchException if the number of rows in x is not equal
 * to the number of rows in covariance
 * @throws NonSquareMatrixException if the covariance matrix is not square
 */
protected void validateCovarianceData(double[][] x, double[][] covariance) {
    if (x.length != covariance.length) {
        throw new DimensionMismatchException(x.length, covariance.length);
    }
    if (covariance.length > 0 && covariance.length != covariance[0].length) {
        throw new NonSquareMatrixException(covariance.length, covariance[0].length);
    }
}
 
Example #20
Source File: AbstractMultipleLinearRegression.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Validates that the x data and covariance matrix have the same
 * number of rows and that the covariance matrix is square.
 *
 * @param x the [n,k] array representing the x sample
 * @param covariance the [n,n] array representing the covariance matrix
 * @throws DimensionMismatchException if the number of rows in x is not equal
 * to the number of rows in covariance
 * @throws NonSquareMatrixException if the covariance matrix is not square
 */
protected void validateCovarianceData(double[][] x, double[][] covariance) {
    if (x.length != covariance.length) {
        throw new DimensionMismatchException(x.length, covariance.length);
    }
    if (covariance.length > 0 && covariance.length != covariance[0].length) {
        throw new NonSquareMatrixException(covariance.length, covariance[0].length);
    }
}