本文整理了Java中cern.colt.matrix.linalg.Algebra.solve()
方法的一些代码示例,展示了Algebra.solve()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Algebra.solve()
方法的具体详情如下:
包路径:cern.colt.matrix.linalg.Algebra
类名称:Algebra
方法名:solve
[英]Solves AX = B.
[中]解AX=B。
代码示例来源:origin: stackoverflow.com
Algebra algebra = new Algebra();
DoubleMatrix2D X = algebra.solve(matrix, D);
代码示例来源:origin: blazegraph/database
/**
* Solves X*A = B, which is also A'*X' = B'.
* @return X; a new independent matrix; solution if A is square, least squares solution otherwise.
*/
public DoubleMatrix2D solveTranspose(DoubleMatrix2D A, DoubleMatrix2D B) {
return solve(transpose(A), transpose(B));
}
/**
代码示例来源:origin: com.blazegraph/colt
/**
* Solves X*A = B, which is also A'*X' = B'.
* @return X; a new independent matrix; solution if A is square, least squares solution otherwise.
*/
public DoubleMatrix2D solveTranspose(DoubleMatrix2D A, DoubleMatrix2D B) {
return solve(transpose(A), transpose(B));
}
/**
代码示例来源:origin: lessthanoptimal/Java-Matrix-Benchmark
@Override
public long process(BenchmarkMatrix[] inputs, BenchmarkMatrix[] outputs, long numTrials) {
DenseDoubleMatrix2D matA = inputs[0].getOriginal();
DenseDoubleMatrix2D matB = inputs[1].getOriginal();
Algebra alg = new Algebra();
DoubleMatrix2D result = null;
long prev = System.nanoTime();
for( long i = 0; i < numTrials; i++ ) {
result = alg.solve(matA,matB);
}
if( outputs != null ) {
outputs[0] = new ColtBenchmarkMatrix(result);
}
return System.nanoTime()-prev;
}
}
代码示例来源:origin: blazegraph/database
/**
* Returns the inverse or pseudo-inverse of matrix <tt>A</tt>.
* @return a new independent matrix; inverse(matrix) if the matrix is square, pseudoinverse otherwise.
*/
public DoubleMatrix2D inverse(DoubleMatrix2D A) {
if (property.isSquare(A) && property.isDiagonal(A)) {
DoubleMatrix2D inv = A.copy();
boolean isNonSingular = Diagonal.inverse(inv);
if (!isNonSingular) throw new IllegalArgumentException("A is singular.");
return inv;
}
return solve(A, DoubleFactory2D.dense.identity(A.rows()));
}
/**
代码示例来源:origin: com.blazegraph/colt
/**
* Returns the inverse or pseudo-inverse of matrix <tt>A</tt>.
* @return a new independent matrix; inverse(matrix) if the matrix is square, pseudoinverse otherwise.
*/
public DoubleMatrix2D inverse(DoubleMatrix2D A) {
if (property.isSquare(A) && property.isDiagonal(A)) {
DoubleMatrix2D inv = A.copy();
boolean isNonSingular = Diagonal.inverse(inv);
if (!isNonSingular) throw new IllegalArgumentException("A is singular.");
return inv;
}
return solve(A, DoubleFactory2D.dense.identity(A.rows()));
}
/**
代码示例来源:origin: ca.umontreal.iro/ssj
final DoubleMatrix2D aVec = alg.solve (A, B);
return aVec.viewColumn (0).toArray ();
代码示例来源:origin: ca.umontreal.iro/ssj
final DoubleMatrix2D bMat = alg.solve (u, yMat);
return bMat.viewColumn (0).toArray ();
代码示例来源:origin: cmu-phil/tetrad
public static TetradMatrix solve(TetradMatrix a, TetradMatrix b) {
DoubleMatrix2D _a = new DenseDoubleMatrix2D(a.toArray());
DoubleMatrix2D _b = new DenseDoubleMatrix2D(b.toArray());
return new TetradMatrix(new Algebra().solve(_a, _b).toArray());
}
代码示例来源:origin: ca.umontreal.iro/ssj
DoubleMatrix2D coltD = DoubleFactory2D.dense.make(D);
DoubleMatrix2D coltP;
coltP = Algebra.ZERO.solve(coltN, coltD);
代码示例来源:origin: ca.umontreal.iro/ssj
DoubleMatrix2D coltM = Algebra.ZERO.mult(Algebra.ZERO.transpose(coltN), coltN);
DoubleMatrix2D coltP;
coltP = Algebra.ZERO.solve(coltM, coltQ);
double[] pxTemp = coltP.viewColumn(0).toArray();
double[] pyTemp = coltP.viewColumn(1).toArray();
代码示例来源:origin: blazegraph/database
zmatrix = myAlgebra.solve(xmatrix,ymatrix);
System.err.println(xmatrix);
System.err.println(ymatrix);
代码示例来源:origin: com.blazegraph/colt
zmatrix = myAlgebra.solve(xmatrix,ymatrix);
System.err.println(xmatrix);
System.err.println(ymatrix);
内容来源于网络,如有侵权,请联系作者删除!