MathLink is a suite of Mathematica functions that implement a protocol for the communication/interfacing of Mathematica with external programs.

learn more… | top users | synonyms

6
votes
1answer
265 views

Passing back “NaN`” and “Inf`” to C via MathLink

In the "usual" double representation of floating point numbers in C there is a NaN and an ...
10
votes
2answers
229 views

MathLink C API: sending a List[] of so far unknown length

I would like to send a set of Mathematica expressions (i.e. not simple types that are easy to represent and temporarily store in C) in a List using the MathLink C ...
6
votes
1answer
116 views

How to write a MathLink function in C that returns nothing

What is the proper way to write a C MathLink function that returns nothing at all? The following works, but I'm not sure if all this work is actually necessary: The template file: ...
8
votes
3answers
172 views

Using LinkSnooper for monitoring the communication with an installable MathLink program

How can I monitor the communication between an installable MathLink program and the kernel? Can LinkSnooper do this?
5
votes
1answer
123 views

Throwing away all expression on a loopback link

What is the simplest way to throw away all expressions waiting to be read on a loopback link, effectively resetting the link? I am building an expression on a loopback link using the C MathLink ...
10
votes
2answers
405 views

How can I connect Mathematica to Clojure?

I'm using Clojure and I'd really love to be able to use some of Mathematica's functions inside it. Can anyone help with mathlinking it?
4
votes
0answers
110 views

How can I link the c library GAUL into Mathematica?

Is there a way to load the library GAUL (Genetic Algorithm Utility Library) for use within Mathematica?
6
votes
1answer
293 views

Using “Raw MathLink Connections” to create a “Kernel Object”

Mathematica 8.0.0: I am stuck trying to get a Mathematica Mathlink connection from my Windows computer working that should connects to Linux over network (or vice versa) and then launches a Kernel on ...
8
votes
1answer
225 views

What is the complete list of valid FrontEnd Packet types?

In response to my question How can I get the unchanged Box form of an arbitrary expression? John Fultz answered with a method using the hilariously named ...
3
votes
1answer
577 views

Mathematica NDSolve and 'Compile'?

Since the consensus is usually that NDSolve speeds fares badly against compiled code such as c++ ODE solvers using GSL say, is it possible to make up for this lag ...
7
votes
1answer
91 views

$CurrentLink passing down in MathLink SetDelayed functions

I would like to utilize the MathLink option of having each Install of my package result in a linking object which I can use to control when and how certain elements ...
3
votes
1answer
320 views

Handing a list of constraint expressions to a C++ function with MathLink

I need to solve an optimization problem, which is defined in a Mathematica notebook. Using Mathematica's FindMinimum is not an option, because it is too slow. So, ...
7
votes
0answers
161 views

Socket communication and player pro

I'd like to create a simple communication channel between MMA and the animation package 'Maya'. This is possible over sockets ( very simple, just sending and receiving strings). I've got this working ...
12
votes
1answer
221 views

using MathLink for communication with external program from my C program without Mathematica

I have a compiled program with MathLink. I want to use it from other C program, without Mathematica being involved at all. If i create my program with MathLink and connect to this external program, ...
9
votes
1answer
446 views

Can you call a C function that takes function pointers as arguments?

I want to use MathLink to call a function I wrote in C. However, similar to an integrator, it takes a function pointer as an argument and applies it on numbers depending on the other arguments. I ...
4
votes
0answers
82 views

Mathlink and Parallelization [duplicate]

Possible Duplicate: How to run mathlink external commands in parallel? Abstract I have a binary file compiled to work with MathLink. I can install the file and run the component functions ...
9
votes
2answers
328 views

MathLink and C++ vector container

The Problem. I have a C++ class that does some computations, and returns a C++ vector object (the length of which can possibly vary with each run). I want to store each of these vectors as a list in ...
8
votes
1answer
497 views

Mathematica + Numerical Recipes

the idea of combining Mathematica with the new routines in the 3rd edition of Numerical Recipes (NR) is very interesting. In fact, there is a NR library to Matlab which works very well because not ...
6
votes
1answer
526 views

Using a user defined Mathematica package with MathLink

I'm trying to create a Java program that uses some methods from a mathematica package I've defined. When I run my java program though the output of the program acts as though the Mathematica methods ...
6
votes
0answers
403 views

Using Mathematica as a data visualization front end for .Net applications?

I have a C# application that has 3-dimensional data that I wish to plot. Controls in C# for surface modeling are, in my experience, rather limited. I wish to have my C# application send the 3D point ...
5
votes
1answer
234 views

Accessing methods and properties of C++ objects?

Is it possible to access the properties or methods of C++ objects created with LibraryLink or MathLink like with J/Link ? Such capability doesn't seem built-in yet and I'm not sure it ever will as ...
0
votes
2answers
369 views

C interface for Mathematica

I would like to write a small C program which starts a Mathematica session, executes some user defined code and retrieves the output and finally quits the session. Basically I like to have a simple ...
3
votes
1answer
515 views

MathLink compile errors

Don't you just love it when your computer is working fine, you work with some good examples, everything is wonderful and your relationship with your computer is the best? I do. But what happens when ...
7
votes
2answers
578 views

Mathematica Library Link : How to use non standard 'mint' e.g. 'unsigned int' or 'long long int'

I use Mathematica 8.0.4 on Mac OSX 64 bit, and gcc as C compiler. I am trying to write a LibraryLink function that deals with large positive integers i.e. greater than $2^{31}-1$. By dealing with, I ...
3
votes
1answer
165 views

Where do I get the mdefs.h file?

I want to generate some C code, and the reference here says that Mathematica comes with a mdefs.h file, but I cannot find it. Is there a place where I can download ...
2
votes
2answers
400 views

MathLink and CDF

So far I have read that some things are not supported in CDFs. Istvan-zachar mentioned very useful things in his post. Unfortunately he mentioned that MathLink operations, including J/Link and ...
8
votes
1answer
972 views

Using Mathlink with the cernlib FORTRAN package MINUIT

I could successfully use Mathlink to call a simple fortran subroutine. However, when I went to a realistic problem, I failed. To be specific, I want to fit a set of data with some function using the ...
12
votes
0answers
505 views

How to protect existing MathLink connection from disconnecting

I am developing an application that consists of a Mathematica package and an external Java program. The purpose of the application is to read streamed data from a port and update a variable in the ...
23
votes
3answers
5k views

How to use Mathematica functions in Python programs?

I'd like to know how can I call Mathematica functions from Python. I appreciate a example, for example, using the Mathematica function Prime. I had search about MathLink but how to use it in Python ...
28
votes
1answer
725 views

Transferring a large amount of data in parallel calculations

This question is inspired by one of @whuber's answers Consider the following code: ...
22
votes
3answers
901 views

Calling IronPython code from Mathematica

I'd like to call some IronPython code from Mathematica using .NET/Link. The problem is that the code lives in .py files, yet from Mathematica I can only load .NET assemblies which are DLLs. So it ...
9
votes
1answer
242 views

Suppress Mathematica Kernel taskbar tab when using .NETLink

Is there a possibility to suppress the Mathematica Kernel taskbar tab when accessing it through .NETLink on Windows?
9
votes
2answers
273 views

Is it possible to set a timeout for LinkWrite[]?

This came up in relation to this answer Is it possible to set a timeout for LinkWrite? LinkWrite seems to block until the sent ...
7
votes
1answer
686 views

How do you get high resolution plots in applications using the Mathematica MathService?

This is for Mac users only using MathService (MathService it seems, given that it was created back in 2004, is a power pc code and requires Rosetta to run on Intel). If I type a plot command in ...
7
votes
1answer
314 views

Using NETLink.MathKernel.Compute() for graphics results fails with GraphPlot[]

I'm using MMA 8.0 to provide backend on a .NET application I'm writing. I am trying to use the high-level Wolfram.NETLink.MathKernel interface to export an image ...
9
votes
2answers
320 views

Specifying the ports used by LinkCreate or LinkLaunch

Whenever a Link is created using LinkCreate or LinkLaunch with ...
10
votes
5answers
719 views

Connecting to and disconnecting from a continuously running kernel, on demand

I realized that there are lots of advantages to driving C/C++/FORTRAN code directly from Mathematica as LibraryLink functions (instead of running them from the command line or a shell script, as I ...
6
votes
1answer
222 views

Is the communication protocol underlying MathLink user-customizable?

MathLink supports two communication protocols on all platforms: TCPIP or shared memory. There are additional protocols supported on some systems only ("FileMap" and "Pipes" according to the docs). I ...
13
votes
1answer
552 views

Is it possible to use C# LINQ from Mathematica using .NET/Link?

Using Mathematica's .NET/Link (NETLink`) package, is it possible to call out to .NET's LINQ facilities for list manipulation and other operations?
9
votes
2answers
436 views

Correct way to handle mysterious NaN` result from MathLink function

I have a Mathematica expression that is mapped onto an external C function via MathLink. The external function passes a ...
11
votes
1answer
651 views

How to run mathlink external commands in parallel?

I have an external function called increment (for the sake of illustration) that I call from Mathematica using MathLink. I.e., ...
51
votes
5answers
3k views

Minimal effort method for integrating C++ functions into Mathematica

As of Mathematica 8, what is the minimal effort way to integrate an existing C++ function into Mathematica? I think we have these: MathLink (it was quite long ago I used it last time) communication ...