Tag Info

Hot answers tagged

3

There are a lot of def functions in the header file "WolframCompileLibrary.h", which make the type conversion very easy and straight forward. I'm using Mathematica version 8. For example, the following functions can be used to get data from the MTensor variables, they will return pointers to the basic m types such as mint, mreal, or mcomplex from the ...


3

Yes, you can. This would involve transferring the matrix to Mathematica, invoking the multiplication function, then transferring the result back. Doings this for the kinds of small (4 by 4 and 3 by 3) matrices that come up in your application area is going to be slower than either using pure Mathematica or pure C++ (due to the transfer) take more ...


2

Then let me give you a minimal example using LibraryLink. Create a file named my_vector.cpp (it is in my "tmp" folder here). #include "mathlink.h" #include "WolframLibrary.h" #include <vector> DLLEXPORT mint WolframLibrary_getVersion(){ return WolframLibraryVersion; } DLLEXPORT int WolframLibrary_initialize( WolframLibraryData libData) { return ...


1

The data types defined for LibraryLink are just simple typedefs for standard data types. --> see WolframLibrary.h typedef int mint; /* 32-bit architecture */ typedef long long mint; /* 64-bit architecture */ typedef double mreal; The MArgument_setter and MArgument_getter are just simple #defines for accessing the union MArgument: typedef union { ...



Only top voted, non community-wiki answers of a minimum length are eligible