Mathematica stuff

On this page I collected some Mathematica-related projects. This page is still under construction until everything is migrated from the old site.

Be sure to also check out the Mathematica-related blog posts!

Packages

An advanced interface for seamlessly calling MATLAB functions from Mathematica. Please see http://matlink.org/ for more details.

BoolEval

This is a package that allows a simple notation for doing MATLAB-style vectorized computations on numerical arrays. For example, to count the number of array elements greater than 0.5, one might write Count[arr, x_ /; x > 0.5]. This is clean and readable, but there’s an orders of magnitude faster way to do the same thing when working with a large packed numerical array:

Total@UnitStep[0.5 - arr]

Unfortunately this is not vey readable, and for complex conditions and comparisons it becomes very unwieldy to write. The package provides an alternative notation,

BoolCount[arr > 0.5]

There are functions for element selection, counting, and other similar operations, e.g.

BoolPick[arr, 0.5 < arr < 0.6]

which would take the much more complex Pick[arr, (1 - UnitStep[0.5 - arr]) UnitStep[0.6 - arr], 1] to write by hand.

Get the code here.

IGraphR

This package makes it easy to call the igraph graph manipulation library from Mathematica. This is useful both for graph operations that Mathematica doesn’t support and verifying results obtained with Mathematica. IGraphR is now mostly superseded by IGraph/M.

See the blog post and get the code here.

IGraph/M

IGraph/M is another Mathematica interface to igraph which does not depend on R and is more tightly integrated with Mathematica. IGraph/M does not cover all igraph functions, but it is much faster and more reliable than IGraphR due to not having to depend on RLink. If the function you need is present in IGraph/M, I recommend you use it instead of IGraphR.

IGraph/M is an ongoing effort and contributions are welcome.

See the blog post and get the package here.

MaTeX

This is a package for generating \(\mathsf{\LaTeX}\)-formatted labels within Mathematica.

MaTeX[Sin[x] + O[x]^6]

See the blog post and get the code here.

LTemplate

LTemplate is a Mathematica package that simplifies writing LibraryLink code. It automatically generates much of the necessary boilerplate code from “templates” that specify a class interface. A tutorial is included with the package.

Get the code here.

Mathematica on the Notre Dame CRC cluster

This package greatly simplifies running parallel Mathematica jobs on Notre Dame’s HPC cluster. Just include the package, which auto-detects the number of cores and hosts usable by the jobs and sets up Mathematica’s parallel tools appropriately.

Get the code here.

Links and tricks