java - How to get the inverse of a ComplexDoubleMatrix using jblas -
Actually, I would like to calculate the inverse of a matrix which is related to the ComplexDoubleMatrix class, but I did not find the function Like inverse () or inv (), does any body know how to calculate the inversion of the matrix? Thank you in advance.
My goal is to make an eigen decomposition of a matrix using jblas.eigen. Now my current implementation is below the Java Library. To perform similar tasks, I need to calculate winners, this is the reason I want to find an inverse function in Jablet. Public static SimpleEigenDecomposition SimpleEigenDecomposition (double [] [] rates) {matrix rate matrix = new matrix (rates); EigenvalueDecomposition ed = New Eigenvalue Deecomposition (rate matrix); Matrix V = ed.getV (); Matrix D = Ed .getD (); Matrix wins = V.inverse (); Matrix Results Metrics = V.times (D). Times (V.inverse ()); // Check that the results and rates are quite close SimpleMatrix trueMatrix = New SimpleMatrix (rates); Simple matrix calculation metrics = new simple matrix (resultmetrics.etrere ()); If (close ejmutilisse (true matrix, contact matrix, threshold)) (return new simple eegen decomposation (v, d, wins)); } And {throwing new runtime exceptions; The reason for this is that there is no busy operation in it because it is only computational costly. If I were to use the rule of the Kramer I initially thought this strange because it could be implemented using Gauss Jordan eradication. But it is weird that I could not even get one. If anyone finds it in JBLAAS, please comment below.
An alternative which I can recommend pinv () This uses the least square method and org.jblas.Solve < / Strong>. Leased squares pinv returns the same output as the actual inverse when the matrix is invertible. Import org.jblas. Public stable SimpleEigenDecomposition SimpleEigenDecomposition (double [] [] rate) {// Change the inverse double matrix Vinverse = Solve.pinv (V) inside the main function for your implementation; }
Comments
Post a Comment