Using DMatrix in compiler

3 posts / 0 new
Last post
Mathadon
Offline
Joined: 2014-01-03
Using DMatrix in compiler

I'd like to use casadi to invert a DMatrix, but for this I need to get swig to wrap the DMatrix functionality to java. I have been trying to get this to work for two days, but whatever I do it never works. 

Right now I imported 'import ifcasadi.DMatrix' after adding DMatrix references in java_casadi.i, ifcasadi.hpp and ifcasadi.cpp. It still does not get detected:

    [javac] Compiling 1143 source files to /media/psf/Home/Documents/Software/JModelica-9608/JModelica.org/build/ModelicaCompilerCasADi/bin
    [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.6
    [javac] /media/psf/Home/Documents/Software/JModelica-9608/JModelica.org/build/ModelicaCompilerCasADi/src/java-generated/org/jmodelica/modelica/compiler/EquationBlock.java:847: error: cannot find symbol
    [javac]             ifcasadi.DMatrix Amat = ifcasadi.DMzeros(n,n);
    [javac]                     ^
    [javac]   symbol:   class DMatrix
    [javac]   location: class ifcasadi

 

Could I get some advice/help on how to deal with this?

thanks!

edit: possibly relevant: https://github.com/casadi/casadi/issues/1310 
 

fredrik
Offline
Joined: 2011-08-26
I am sorry to say that I

I am sorry to say that I currently can not help you, and more generally, the developers of the CasADi-related parts of the compiler are no longer working on the JModelica.org project. So no current developer can help you with this or the other similar questions that you have recently posted on the forum.

However, I will probably be taking over development of this part of the compiler, so in the long run I should be able to provide assistance. But currently I lack the knowledge, and I am also busy in other projects, so for now you are unfortunately on your own.

Mathadon
Offline
Joined: 2014-01-03
Okay! That's good to know.

Okay! That's good to know. Thanks for letting me know :)

The problem seemed to be that 'DMatrix' is not a class, but a specialisation/typedef: Matrix<double>. So I had to define the type in the swig files and then it worked.

Login or register to post comments