9 messages in net.java.dev.jna.usersRe: [jna-users] Wrapping a C api to c...
FromSent OnAttachments
Richard OteroOct 12, 2007 3:59 pm 
Albert StrasheimOct 12, 2007 4:39 pm 
Albert StrasheimOct 12, 2007 5:51 pm 
Albert StrasheimOct 12, 2007 6:00 pm 
Timothy WallOct 13, 2007 6:05 am 
Timothy WallOct 13, 2007 7:05 am 
Timothy WallOct 13, 2007 7:27 am 
Albert StrasheimOct 13, 2007 10:55 am 
Richard OteroOct 14, 2007 2:50 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] Wrapping a C api to control Matlab using Java (with example)Actions...
From:Albert Strasheim (full@gmail.com)
Date:Oct 13, 2007 10:55:26 am
List:net.java.dev.jna.users

Hello all

----- Original Message ----- From: "Timothy Wall" <twal@dev.java.net> To: <use@jna.dev.java.net> Sent: Saturday, October 13, 2007 4:06 PM Subject: Re: [jna-users] Wrapping a C api to control Matlab using Java (with example)

I think binding to the C interface via JNA is a better solution, since you know *that* is never going to change, and probably gives you more functionality, since MatlabControl doesn't really provide for data exchange except via matlab's output buffer.

My initial efforts are here:

http://array4j.googlecode.com/svn/trunk/src/main/java/net/lunglet/matlab/ http://array4j.googlecode.com/svn/trunk/src/test/java/net/lunglet/matlab/ http://array4j.googlecode.com/svn/trunk/src/test/resources/net/lunglet/matlab/

The few basic tests I've written so far seem to indicate that things are working nicely.

If anyone wants to hack further, contact me, so I can add you as a developer on the array4j project.

The next order of business is probably to build out the Engine class a bit to make it easier to execute MATLAB code. mlabwrap for Python has some cool features that might provide some inspiration.

Then I'd also like to sort out a callback mechanism from MATLAB back into Java code.

Unfortunately, you can't use the JNA callback mechanism here, because the MATLAB engine runs in a separate process (if anyone knows if this "feature" can be circumvented, that would be great).

Luckily, MATLAB can call easily call Java functions, so I've started playing with using RMI to call back from MATLAB into my Java process. The Engine class could provide some methods to make setting up all the details a bit easier.

I haven't got it working yet though -- dynamic class loading and stubs and interference from Jini included with the MATLAB Distributed Computing Toolbox makes this an interesting exercise, to say the least.

Regards,

Albert