我想使用 Colt 库求解线性方程矩阵*X=D 。我试过了 :
DoubleMatrix2D matrix;
matrix = new DenseDoubleMatrix2D(4,4);
for (int row = 0; row < 4; row++) {
for (int column = 0; column < 4; column++) {
// We set and get a cell value:
matrix.set(row,column,row+column);
}
}
DoubleMatrix2D D;
D = new DenseDoubleMatrix2D(4,1);
D.set(0,0, 1.0);
D.set(1,0, -1.0);
D.set(2,0, 91.0);
D.set(3,0, -5.0);
DoubleMatrix2D X;
X = solve(matrix,D);
但我收到一个错误
"The method solve(DoubleMatrix2D, DoubleMatrix2D) is undefined for the type Test" ,其中 Test 是类的名称。
我做错了什么?有任何想法吗?...