Solving Linear System using COLT in Java

1k Views Asked by At

I want to solve a linear system. My matrix A is 1200x1200 in dimension and matrix b is 1200x1. So by the formula Ax = b, I want to find x which will be 1200x1. Now my main concern is my matrix A has very few non zero values, like at most 5 non zero values in each of the rows. So what do you suggest? Will LU decomposition help me more? or any other decomposition like sparse decomposition. I am using java as the linear system is a part of the total algorithm, I dont want to change the programming language. I have come to know that COLT has better classes for solving. Can anyone suggest me with some sample code solving linear system using COLT? The thing I am implementing is a policy iteration problem

2

There are 2 best solutions below

0
On

You can use Linear Algebra 4 Java, it is open source and support sparse matrices. Also you can choose the matrix solver (Gaussian, Jacobi, Seidel).

0
On

There is an open source java library with support to perform the most common operations applied to matrices and vectors. It also has functionality to solve nxn linear systems and make LU decomposition. You can download all the source code and api documentation from: http://imr-lib.blogspot.com It's a very easy to use library, and you can pick up inside the code to see the implementation; it uses numerical analisys skills to perform LU decomposition and solve nxn linear systems.