javamatrixjama

how to declare matrix using jama


I am new to Java Programming.I was doing a scientific simulation within which a system of linear equations has to be solved.

I work in Eclipse.I downloaded the jama jar file and added to JRE System Library.The problem is when I create a new Matrix object by passing a 2D double array as constructor argument,the IDE is mentioning that "The constructor Matrix(double[][]) is undefined".

I googled a lot,but got nothing :(

Have someone came accross it? How shall I deal with this?


Solution

  • Documentation of jama suggests there actually is such a constructor. A quick test with jama 1.0.3 in netbeans IDE confirms that the constructor is there and can be used accordingly.

    I suspect the lib is not properly loaded. Another possibility might be that you made your own Matrix class, and this is being used instead of the Jama.Matrix class. Does the error also occur when you use Jama.Matrix instead of Matrix?