• Jason Rhinelander's avatar
    Fix 2D Nx1/1xN inputs to eigen dense vector args · 6a81dbbb
    Jason Rhinelander authored
    This fixes a bug introduced in b68959e8
    when passing in a two-dimensional, but conformable, array as the value
    for a compile-time Eigen vector (such as VectorXd or RowVectorXd).  The
    commit switched to using numpy to copy into the eigen data, but this
    broke the described case because numpy refuses to broadcast a (N,1)
    into a (N).
    
    This commit fixes it by squeezing the input array whenever the output
    array is 1-dimensional, which will let the problematic case through.
    (This shouldn't squeeze inappropriately as dimension compatibility is
    already checked for conformability before getting to the copy code).
    6a81dbbb
test_eigen.cpp 16.2 KB