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

2
votes
1answer
67 views

MathLink c++ passing lists of real values simple example

So this may come down to me not being a very competent programmer but I am struggling with passing list from Mathematica via MathLink that aren't of integers. The final code I am hoping to get out of ...
2
votes
1answer
43 views

How to return escaped characters from MathLink?

I'd like to return Greek symbols through MathLink from a C function. However, returning the usual escape sequence (such as \[Alpha]) does not seem to work. Here's a minimal example .tm file ...
0
votes
0answers
45 views

Visual Studio 2013 Mathlink addtwo

I was needing to use Mathlink to call some c++ code so I thought I would learn from the basic examples but I am running into strange issue. Following the procedure outlined from the Mathematica ...
0
votes
0answers
24 views

Multiple scripts run using same kernel

I have an external program that calls Mathematica scripts upon certain events. Each script requires a large Mathematica library to load (takes a while). Is there some way to run an initial script ...
5
votes
0answers
74 views

Can Apple's Numbers spreadsheet link to a Mathematica function?

I use Apple's Numbers spreadsheet for a single thing, a double entry accounting model to understand complicated financial transactions. A current model depends on the value of a single initialization ...
2
votes
0answers
42 views

Pass Real32 to Mathlink

I've written a Mathlink program that is called from Mathematica 9. It works very well but currently uses double precision numbers in the C++ function. I've already replaced them with floats in C++ ...
0
votes
0answers
26 views

Reading Error Message from Mathematica using Mathlink C++

I am developing an UI on Visual Studio C++ and communicating with Mathematica using Mathlink. I create a function via Mathlink and in that function, I coded in such a way that it gives a message ...
9
votes
1answer
196 views

Multiplayer game in Mathematica: how to communicate between kernels?

This may have been asked already, but I am considering making a game in Mathematica that two people can play. However, the issue with my idea is that the other player can't view the cards of the first ...
1
vote
1answer
48 views

Hide MathKernel Tab on Taskbar when using C++ [duplicate]

I am connecting to MathKernel.exe using C++ via MathLink on Windows. Hence, to create the link, this is what I use: ...
1
vote
0answers
64 views

Read expression from Mathematica via Mathlink C++

This is a simple C++ program to send an expression to the_Mathematica_ Kernel and get its response. ...
1
vote
1answer
42 views

MLEvaluate() Function Gives Error

I am trying to link my C++ program to Mathematica Kernel. I am trying to use the MLEvaluate() evaluate but I receive an error while compilation. My codes are as below: ...
1
vote
2answers
147 views

MathLink Graphical Output (Plots) to File

In a custom Mathematica frontend based on MathLink I try to make use of plots produced in Notebooks. The idea is to write them to files whenever they get produced. According to C-code snippets I ...
0
votes
0answers
32 views

MathLink wrapper for NIntegrate

I wonder if I can benefit from the Mathematica numerical quadrature routines in a way which integrates completely into an existing C-program. To be more specific I have C-program which does numerical ...
0
votes
0answers
32 views

Set form of all output to InputForm

I try to interact with mathematica using MathLink for symbolic computations. By default it returns strings such as 2\012-1 + E\012-------\012 3\012 E if the ...
0
votes
0answers
44 views

Compiling Visual Studio C++ to Run on Computers without Mathematica [duplicate]

I have written a console application on Visual Studio C++ as below ...
2
votes
0answers
91 views

Calling Mathematica from Lazarus/Freepascal

I will appreciate if anyone can give me an hint about freepascal and mathematica mathlink communication. I'd like to build a Form using Lazarus/freepascal that call mathkernel. I'm trying to move ...
4
votes
1answer
104 views

Passing Mathematica function via MathLink or LibraryLink to c (or c++)

I want to numerically solve the heat equation. To do so I wrote a program in C++ - It is a BVP $(\alpha T +\kappa \frac{\partial T}{\partial r}=f(t))$, where $f(t)$ is an arbitrary function, whose ...
2
votes
1answer
198 views

Creating a C++ project with Visual Studio 2010

I am trying to create a GUI using Microsoft Visual Studio C++ 2010 by calling Mathematica in my codes. I have done everything step by step as mentioned here Then I wrote this code as mentioned in ...
1
vote
1answer
127 views

Calling Mathematica from Java

I'm trying to write a Java program that uses Mathematica code, but when I compile it, a window appears asking for MathLink. I enter ...
3
votes
1answer
71 views

LinkSnooper troubles on Windows

I'm trying to get LinkSnooper up and working on a Windows 7 machine to monitor the interaction between the Mathematica front end and MathLink. I'm facing great troubles following the instructions ...
0
votes
0answers
54 views

Can you set up a remote kernel for computation and a local kernel for predictive interface?

I am able to launch remote kernels from my Windows box to our Linux cluster that has the data I need and the capacity to run analysis (numerous & speedy cores, spacious memory, etc.). Works ...
2
votes
2answers
90 views

J/Link: getArray2() returns wrong array

I want to convert a matrix from Mathematica to an int[][] in Java. I use the code below: ...
0
votes
1answer
66 views

How to close all other MathKernel before opening the new one?

I use MathLink to call Mathematica from C program. After any opening to Mathematica, I do close the connection. However, I don't know why some connections are ...
2
votes
1answer
141 views

Mathlink works strangely

I have problem when using mathlink, the source code is quite simple: ...
6
votes
3answers
7k views

MathLink linking error after OS X 10.9 (Mavericks) upgrade

After macosx 10.9 mavericks upgrade i have a compilation problem, you can see below. Even the examples given in ...
2
votes
1answer
58 views

Read return value as string by Mathlink.h

I'm using "mathlink.h" to call Mathematica from a C program. I send a computation to Mathematica and its return result is a very big number (100 digits). Hence, I want to read that number as a string. ...
16
votes
1answer
341 views

Calling Mathematica from Visual Studio - example

I am trying to set up a connection between Visual Studio 10 and Mathematica 8.0 on a Windows system. I found several sources of information on the Wolfram website, but I get entirely lost. Most of the ...
4
votes
0answers
82 views

MathKernel with `-noprompt` hangs indefinitely when converting simple TeX expression

If I enter MathKernel -noprompt -run 'ToExpression["1", TeXForm]; Exit[]' the kernel hangs, apparently while running TeX.exe ...
9
votes
1answer
326 views

Example program for calling Mathematica from C

I want to call Mathematica from a C program. Suppose I have two numbers x =2 and y=3. I want to define the x, y in a C program and call Mathematica and I want Mathematica to do the sum and return me ...
3
votes
1answer
76 views

What leads to Mathlink connection lost when running

My C program called Mathematica several times during the execution. However, after 4 or 5 times Mathematica stopped and then I got this message. /home/sec/.Mathematica/Licensing/mathpass:3: The ...
10
votes
3answers
171 views

Returning multiple results from a LibraryLink function

What is the best way to return multiple inhomogeneous results from a LibraryLink function? Imagine that the result of a single computation is several tensors of different dimensions and several ...
2
votes
0answers
91 views

FrontEndTokens, MathLink, and Serializer.exe

I have been using some basic MathLink programming in my work and wanted to create some more sophisticated MathLink programs. I came across the book "MathLink: Network Programming with Mathematica", ...
15
votes
2answers
258 views

MathKernel doesn't return all Messages

In Mathematica I run this command: Plot[Sin[x], {x, 1, 15}, GridLines -> error] It generates a Plot with this error message: A GridLines specification ...
3
votes
1answer
114 views

MathLink and writing *.tm files

My goal is to use MathLink to access the functions in sofa (Standards of Fundamental Astronomy) So far I have had mixed success. I have very little C programing experience so I am hoping to get ...
2
votes
1answer
110 views

MathLink and a function of a real variable

I am trying to use a real function of a real variable written in C from Mathematica, my .tm file reads as follows: ...
1
vote
0answers
69 views

Is the TCPIP link type compressed?

Since I'm already piping a MathLink connection in a ssh tunnel (connect back is a pain!), I wonder if it makes sense to compress the data in the stream (ssh -C). As ...
10
votes
1answer
384 views

How to run an external program in parallel with a Mathematica package?

Under Mathematica 8 (Linux x84_64) I was able to run an external program in parallel from a Mathematica package. However this procedure breaks down under Mathematica 9. Within my Mathematica package ...
5
votes
0answers
58 views

At what point should MLSetMessageHandler() be called?

I have an Installable MathLink program written in C. I would like to use a custom message handler. At which point in the C source code should I call ...
3
votes
0answers
136 views

Mathlink and multithreading

In order to make my computations faster I have developed a C/C++ application calling Mathematica kernel and performing many operations using Mathematica functions for equation solving. Now I want to ...
1
vote
1answer
140 views

How to send a function definition to MathLink from C/C++?

In this tutorial some MathLink concepts are introduced. At page 33 in the last lines the author is talking about sending to MathLink a function definition like ...
4
votes
2answers
280 views

Cannot call custom function loaded from script using C/C++ MathLink

I am using MathLink with C/C++ on a Unix system in order to call a Mathematica (version 9) function and get the result. The function I need to call is a personal function of mine ...
2
votes
1answer
115 views

Cannot run Mathematica C-interfacing examples 'factor'

I am trying to run a Mathematica example concerning Mathematica interfacing issues with C programs. In particular I am trying to call a Mathematica function from C. Example ...
11
votes
1answer
767 views

Write C/C++ programs calling Mathematica functions

I need to write a C/C++ program and call some functions in Mathematica especially those like Solve or NDSolve. The problem is ...
5
votes
1answer
434 views

Compiling 64bit MathLink code under cygwin on Windows 7

I am aware that building MathLink executables is not without its challenges. However, I am trying to compile the MathLink example 'addtwo' from a makefile within cygwin on a 64 bit Windows 7 machine. ...
7
votes
1answer
261 views

Running .NET/Link on Mono (On MacOS or any UNIX or Linux Distro)

Has anyone have any luck running .NET/Link on Mono? When I run .NET/Link to call Mathematica from within a Mono program, this is the error message I receive. ...
18
votes
3answers
1k views

Efficiently determining if 3D points are within a surface composed of polygons

This is the 2nd part of a previous question which I edited to make into 2 separate questions: Extracting polygons from 3D contour plot surface As an extension of my earlier question involving simple ...
5
votes
1answer
292 views

Why do Mathematica and MathKernel need “incoming connections”?

My firewall (the "Application Firewall" in OS X 10.8.2) detects that Mathematica (9.0.1.0) and "MathKernel" both request incoming connections. My configuration expects all incoming connections to be ...
7
votes
2answers
207 views

Type conversion: LibraryLink mint vs. MathLink integer type

Assume the following situation: I have a WolframLibrary function which gets as parameter an integer tensor (which is for simplicity of rank 1) and the function should return an integer list through ...
6
votes
1answer
264 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
227 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 ...