Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't assume Eigen's storage layout #224

Closed
intractabilis opened this issue Jun 26, 2021 · 1 comment
Closed

Don't assume Eigen's storage layout #224

intractabilis opened this issue Jun 26, 2021 · 1 comment
Assignees

Comments

@intractabilis
Copy link

I recently experience issue #135. The reason of not respected boundaries turned out to be here:

if (phenocandidates.size())
    _solutions._candidates.at(r).set_fvalue(
        _func(phenocandidates.col(r).data(), candidates.rows()));

The expression phenocandidates.col(r).data() assumes that the column data is adjacent in memory, which in fact depends on the defaults of the Eigen library. Suggested fix (in eo_matrix.h):

typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor> dMat;
typedef Eigen::Matrix<double, Eigen::Dynamic, 1, Eigen::ColMajor> dVec;
@beniz
Copy link
Collaborator

beniz commented Jun 28, 2021

Good catch, can you PR the improvement ? Thanks!

@beniz beniz self-assigned this Sep 10, 2021
@beniz beniz closed this as completed in a21fc5e Sep 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants