I just started learning java after c #, but now I’ll figure it out - alas. I need to solve various equations in my prog (linear, quadratic, differential equations), I want to use the MathGL library (it is used in C ++). I use the Eclipse compiler.

Question: Is this MathGL library suitable (maybe something is better)? How to connect the library in Java?

  • one
    surprisingly, I began to learn Java after Sharp, and compare their advantages with libs =) - Gorets

2 answers 2

A C / C ++ library connects to a Java application via JNI. The description of MathGL indicates that it already includes an interface for Java:

The MathGL library has interfaces to a variety of programming languages. Most of them are based on the C interface and are built using the SWIG toolkit. These include Python, Java , Octave, Lisp, C #, Guile, Lua, Modula 3, Ocaml, Perl, PHP, Pike, R, Ruby, Tcl.

But it's easier, probably, to write an application in C / C ++ and call it from Java.

Java Math Libraries:

Well, you can still find if you search.

  • Is not it easier to do everything in Java? - Gorets
  • It depends on the complexity of the computational tasks and the complexity of the interface to connect to the library. - Nicolas Chabanovsky
  • Please give detailed instructions on how to connect the library in Java. - Fairlooli
  • in the first kolent laid out a link - Gorets

eg,

int a = 2; int b = 3; int summ = Math.sum(a,b); 

look at methods of this, should help

 import smth_lib.*; 

here in pictures

  • I need to solve the equation of higher mathematics, Math does not fit, Do you know how to connect the library to java? - Fairlooli 2:42 pm
  • one
    There should be an analogue of solving your problem in Java, without a tambourine - Gorets