mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-24 22:25:10 +00:00
d9d224f288
Currently when we do a conversion between a numpy array and an Eigen Vector, we allow the conversion only if the Eigen type is a compile-time vector (i.e. at least one dimension is fixed at 1 at compile time), or if the type is dynamic on *both* dimensions. This means we can run into cases where MatrixXd allow things that conforming, compile-time sizes does not: for example, `Matrix<double,4,Dynamic>` is currently not allowed, even when assigning from a 4-element vector, but it *is* allowed for a `Matrix<double,Dynamic,Dynamic>`. This commit also reverts the current behaviour of using the matrix's storage order to determine the structure when the Matrix is fully dynamic (i.e. in both dimensions). Currently we assign to an eigen row if the storage order is row-major, and column otherwise: this seems wrong (the storage order has nothing to do with the shape!). While numpy doesn't distinguish between a row/column vector, Eigen does, but it makes more sense to consistently choose one than to produce something with a different shape based on the intended storage layout. |
||
---|---|---|
.. | ||
attr.h | ||
cast.h | ||
chrono.h | ||
class_support.h | ||
common.h | ||
complex.h | ||
descr.h | ||
eigen.h | ||
eval.h | ||
functional.h | ||
numpy.h | ||
operators.h | ||
options.h | ||
pybind11.h | ||
pytypes.h | ||
stl_bind.h | ||
stl.h | ||
typeid.h |