arnoudb
(Arnoud Buzing)
1
This is a list of a fully functional LibraryLink examples, starting with the bare minimum to more complicated cases:
- Doing nothing with LibraryLink -- Explains how to write a minimal example in LibraryLink that takes no arguments and returns nothing
- Saying hello with LibraryLink -- Explains how to return a value from a LibraryLink function
- Sending greetings from LibraryLink -- Explains how to pass in a value to a LibraryLink function
- Squaring integers with LibraryLink -- Explains how to write a basic arithmetic function with LibraryLink
- Writing a boolean function with LibraryLink -- Explains how to write a function that returns True or False
- Calculating the mean value of a list with LibraryLink -- Explains how to pass lists for a LibraryLink function
- Creating a matrix with LibraryLink -- Explains how to return a matrix from a LibraryLink function
- Working with complex numbers in LibraryLink
- Working with multiple functions in LibraryLink
LibraryLink examples which use WolframLink:
- Hello World revisited using WolframLink in LibraryLink
- Working with a variable number of arguments in LibraryLink
11 Likes
00iassi
(Michael Jasi)
2
Hello Arnoud,
thanks for these very helpful examples. Unfortunately, there is a case missing:
I would like to pass several MTensors as a result via LibraryLink.
Say, I have a real matrix and a list of integers that I want to pass on.
Thanks,
Michael
arnoudb
(Arnoud Buzing)
3
Not sure how to do this off-hand, but I will ask some people who might know.
Another good place to look for a possible answer is the Q&A site called StackExchange:
arnoudb
(Arnoud Buzing)
4
A possible answer here:
https://mathematica.stackexchange.com/questions/31545/returning-multiple-results-from-a-librarylink-function
With a mirror post here:
arnoudb
(Arnoud Buzing)
5
Code is also available in this GitHub repository:
1 Like