EIGEN_DEFAULT_TO_ROW_MAJOR and other flags

Open
#118 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp, r
Domain
data

Research direction

Start with the EIGEN_DEFAULT_TO_ROW_MAJOR definition and the RcppEigen.h include in the reported Rcpp example, checking how macro placement affects the generated matrix layout. Compare the result with R's column-major behavior; done means the supported configuration or limitation is established and documented or tested.

Written by the indexing model from the issue text.

Description

I'm interfacing with a legacy C++ code which sets EIGEN_DEFAULT_TO_ROW_MAJOR (well known to break compatibility) but, basic searching and playing with defining the macro doesn't seem to help at all in R, matrices are still in column order and have to be manually reshaped (say matrix(byrow=T, ncol=3)).

I could wrap this thing in an R class and deal with this there every-time but was hoping I might have missed a way of setting the flag.

Things I tried:

#define EIGEN_DEFAULT_TO_ROW_MAJOR
#include <RcppEigen.h>
// [[Rcpp::depends(RcppEigen)]]

And moving it after the #include or the comment also does not help.

Dominant language
C++
Stars
118
Forks
43
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from RcppCore/RcppEigen

All issues in RcppCore/RcppEigen

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.