【发布时间】:2012-09-04 22:15:46
【问题描述】:
请我尝试理解矩阵计算。 我的问题可能看起来很简单,但需要一个答案 可以向我简要解释一下什么是 RHS 向量。 我经常看到它在 Apache commons 数学库中使用 例如我从stackoverflow页面得到这个:
public class LinearAlgebraDemo
{
public static void main(String[] args)
{
double [][] values = {{1, 1, 2}, {2, 4, -3}, {3, 6, -5}};
double [] rhs = { 9, 1, 0 }; /* RHS Vector */
RealMatrix a = new Array2DRowRealMatrix(values);
DecompositionSolver solver = new LUDecompositionImpl(a).getSolver();
RealVector b = new ArrayRealVector(rhs);
RealVector x = solver.solve(b);
RealVector residual = a.operate(x).subtract(b);
double rnorm = residual.getLInfNorm();
}
}
谁能向我解释这段代码,尤其是 RHS 向量及其用途。 非常感谢。
【问题讨论】:
-
@GregHewgill 作为答案发布,所以我可以投票。