New answers tagged

1

Thanks to Szabolcs for pointing out the right way. So I rewrite the real Inverse version into complex version, and pasted here for reference. libnewsource="#include<complex> #include<Eigen/Dense> #include<Eigen/LU> #include \"WolframLibrary.h\" DLLEXPORT mint WolframLibrary_getVersion(){return WolframLibraryVersion;} DLLEXPORT int ...


5

LibraryLink's complex type, mcomplex, is defined as two contiguous double values. In C++, std::complex<double> has exactly the same layout. This is guaranteed since C++11, but should hold in most other cases too in practice. This means that if you get a complex array from Mathematica, mcomplex *arr = MTensor_getComplexData(t); then you can ...



Top 50 recent answers are included