使用EJML.jar查找矩阵的逆



谁能帮我得到使用EJML.jar找到矩阵逆的代码

此链接https://code.google.com/p/efficient-java-matrix-library/downloads/list该文件包含源代码:ejml-0.24-src.zip希望这有效!

您应该查看一下API文档。您可以在以下链接中找到所有函数和类。下面的代码(在内部)将一个矩阵转换成它的逆值。

Random rand = new Random();
DenseMatrix64F a = RandomMatrices.createRandom(4,4, -1, 1, rand);
// where 4,4 is the matrix size and -1,1 the range where rand has to get 
// the random values to populate it.
invert(a); 
//The inverse gets stored in a

希望这能解决你的问题。

今天您可以使用以下代码:

double data[][] = new double[][]{
        { 90, 60, 90 },
        { 90, 90, 30 },
        { 60, 60, 60 }
};
SimpleMatrix m = new SimpleMatrix(data);
SimpleMatrix inverted = m.invert();
System.out.println(inverted);

最新更新