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


Java NonSquareMatrixException类代码示例

本文整理汇总了Java中org.apache.commons.math3.linear.NonSquareMatrixException的典型用法代码示例。如果您正苦于以下问题:Java NonSquareMatrixException类的具体用法?Java NonSquareMatrixException怎么用?Java NonSquareMatrixException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: Weight

import org.apache.commons.math3.linear.NonSquareMatrixException; //导入依赖的package包/类
/**
 * @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();
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:14,代码来源:Weight.java

示例2: getTrace

import org.apache.commons.math3.linear.NonSquareMatrixException; //导入依赖的package包/类
public double getTrace() throws NonSquareMatrixException {
   return matrix.getTrace();
}
 
开发者ID:crisis-economics,项目名称:CRISIS,代码行数:4,代码来源:InputOutputMatrix.java

示例3: power

import org.apache.commons.math3.linear.NonSquareMatrixException; //导入依赖的package包/类
public RealMatrix power(int arg0) throws NotPositiveException, NonSquareMatrixException {
   return matrix.power(arg0);
}
 
开发者ID:crisis-economics,项目名称:CRISIS,代码行数:4,代码来源:InputOutputMatrix.java

示例4: validateCovarianceData

import org.apache.commons.math3.linear.NonSquareMatrixException; //导入依赖的package包/类
/**
 * 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);
    }
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:19,代码来源:AbstractMultipleLinearRegression.java


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