本文整理了Java中Jama.Matrix.norm1()
方法的一些代码示例,展示了Matrix.norm1()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Matrix.norm1()
方法的具体详情如下:
包路径:Jama.Matrix
类名称:Matrix
方法名:norm1
暂无
代码示例来源:origin: gov.nist.math/jama
/** Check norm of difference of Matrices. **/
private static void check(Matrix X, Matrix Y) {
double eps = Math.pow(2.0,-52.0);
if (X.norm1() == 0. & Y.norm1() < 10*eps) return;
if (Y.norm1() == 0. & X.norm1() < 10*eps) return;
if (X.minus(Y).norm1() > 1000*eps*Math.max(X.norm1(),Y.norm1())) {
throw new RuntimeException("The norm of (X-Y) is too large: " + Double.toString(X.minus(Y).norm1()));
}
}
代码示例来源:origin: com.github.yannrichet/JMathArray
public static double norm1(double[][] v) {
return new Matrix(v).norm1();
}
代码示例来源:origin: openimaj/openimaj
@Override
public double compare(MultivariateGaussian o1, MultivariateGaussian o2) {
final Matrix sig0 = o1.getCovariance();
final Matrix sig1 = o2.getCovariance();
final Matrix mu0 = o1.getMean();
final Matrix mu1 = o2.getMean();
final int K = o1.numDims();
final Matrix sig1inv = sig1.inverse();
final double sigtrace = MatrixUtils.trace(sig1inv.times(sig0));
final Matrix mudiff = mu1.minus(mu0);
final double xt_s_x = mudiff.transpose().times(sig1inv).times(mudiff).get(0, 0);
final double ln_norm_sig = Math.log(sig0.norm1() / sig1.norm1());
return 0.5 * (sigtrace + xt_s_x - K - ln_norm_sig);
}
代码示例来源:origin: gov.nist.math/jama
int[] p = LU.getPivot();
Matrix R = L.times(U).minus(M.getMatrix(p,0,n-1));
double res = R.norm1()/(n*eps);
print(fixedWidthDoubletoString(res,12,3));
R = QR.getR();
R = Q.times(R).minus(M);
res = R.norm1()/(n*eps);
print(fixedWidthDoubletoString(res,12,3));
代码示例来源:origin: gov.nist.math/jama
try_success("minus conformance check... ","");
if (A.minus(R).norm1() != 0.) {
errorCount = try_failure(errorCount,"minus... ","(difference of identical Matrices is nonzero,\nSubsequent use of minus should be suspect)");
} else {
try_success("minusEquals conformance check... ","");
if (A.minus(Z).norm1() != 0.) {
errorCount = try_failure(errorCount,"minusEquals... ","(difference of identical Matrices is nonzero,\nSubsequent use of minus should be suspect)");
} else {
FILE.close();
R = Matrix.read(new BufferedReader(new FileReader("JamaTestMatrix.out")));
if (A.minus(R).norm1() < .001 ) {
try_success("print()/read()...","");
} else {
FILE.close();
R = Matrix.read(new BufferedReader(new FileReader("JamaTestMatrix.out")));
if (A.minus(R).norm1() < .001 ) {
try_success("print()/read()...","");
} else {
check(A.norm1(),columnsummax);
try_success("norm1...","");
} catch ( java.lang.RuntimeException e ) {
内容来源于网络,如有侵权,请联系作者删除!