Comments (4)
@patrikhuber I am not familiar with Eigen library, but my bet is that Eigen::MatrixXd
itself is a template and that might be treating Eigen::MatrixXd
as a container just like a std::vector
. The exact check is happening here
For a quick workaround for this issue, you can specialize std::vector<Eigen::MatrixXd>
.
To make conversion more efficient, you can instantiate numeric matrix first and use std::copy
or ANSI C memcpy
to copy data, assuming everything is column-major order.
https://github.com/patrikhuber/eos/blob/7f0e46179112c44c26321491ea0246394a9a5a8a/matlab/include/mexplus_eigen.hpp#L48
from mexplus.
@patrikhuber For now, I recommend std::vector<Eigen::MatrixXd>
specialization. The desired solution is a fix for a better template support (c.f., #25 ), but that requires major API updates.
from mexplus.
I am not familiar with Eigen library, but my bet is that Eigen::MatrixXd itself is a template and that might be treating Eigen::MatrixXd as a container just like a std::vector. The exact check is happening here
Yes, it is a template indeed. Aah! So the check, if I understand correctly, thinks that Eigen::MatrixXd
is a std::vector
, because it has a first template parameter (and it's a double
), so the check here fires:
mexplus/include/mexplus/mxtypes.h
Lines 309 to 311 in 49457dc
And then obviously it fails because it tries to call
std::vector::assign(...)
.Is that correct?
Do you think we could do a better solution than the "specialise std::vectorEigen::MatrixXd" workaround?
from mexplus.
@kyamagu Ok, I will! I'll close this then in favour of #25.
Thank you very much for the quick replies! :-)
from mexplus.
Related Issues (20)
- Intel IPP / MKL Interface HOT 2
- Possible memory leakage HOT 1
- Eigen support HOT 10
- Not able to set a cell with mxArray* HOT 1
- Getting matrix data out of a struct HOT 13
- Representing multi-dimensional arrays
- possible bug HOT 1
- How does this program compare with others? HOT 5
- auto_ptr is not available anymore in VS2017.3 HOT 3
- Add support for templated MxArray conversions HOT 5
- Declare noexcept the move constructor and move assignment operator
- Define MEX function as a MATLAB class method HOT 2
- mxGetPi - mxGetPiIsDeprecated error with Matlab R2018a HOT 4
- Building issues in Ubuntu HOT 3
- Invalid operation: foo HOT 2
- Static TLS problem with Matlab HOT 4
- Fusing mexplus with mexopencv HOT 5
- Issues when using mexplus to wrap the dc1394 driver HOT 2
- Error with `arguments.h` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mexplus.