Macaulay2 » Documentation
Packages » ForeignFunctions :: ForeignFunctions
next | previous | forward | backward | up | index | toc

ForeignFunctions -- foreign function interface

Description

This package provides the ability to load and call "foreign" functions from shared libraries and to convert back and forth between Macaulay2 things and the foreign objects used by these functions.

i1 : mycos = foreignFunction("cos", double, double)

o1 = cos

o1 : ForeignFunction
i2 : mycos pi

o2 = -1

o2 : ForeignObject of type double
i3 : value oo

o3 = -1

o3 : RR (of precision 53)

It is powered by libffi.

Author

Version

This documentation describes version 0.3 of ForeignFunctions.

Source code

The source code from which this documentation is derived is in the file ForeignFunctions.m2.

Exports

For the programmer

The object ForeignFunctions is a package.