MATLAB parfor and C++ class mex wrappers (copy constructor required?)

前端 未结 1 1667
花落未央
花落未央 2021-02-09 02:45

I\'m trying to wrap a C++ class in a matlab mex wrapper using the approach outlined here. Basically, I have an initialization mex file which returns a C++ object handle:

相关标签:
1条回答
  • 2021-02-09 03:01

    When you pass an object instance into the body of a PARFOR loop, the behaviour is the same as if you'd saved it to a file, and then loaded it again. The simplest solution is probably to mark your cpp_handle_ as Transient. Then, you need to implement SAVEOBJ and LOADOBJ to safely transport your data. See this page for more about customising the save/load behaviour of your class.

    0 讨论(0)
提交回复
热议问题