Вопрос

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?

Это было полезно?

Решение

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?

Другие советы

Get the matrix jar file. Add the jar to your class path (in net beans, I just add it to the libraries for the project; I believe you should add the Matrix jar file to the "java build path" in eclipse).

Once you do the above, Matrix(double[][]) is available.

I think you need more about JAMA. So, please have a look: http://math.nist.gov/javanumerics/jama/doc/

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top