bachmannpatrick / CLVTools

R-Package for estimating CLV
54 stars 14 forks source link

Integrate the functionality of RcppEigen #25

Closed mmeierer closed 1 month ago

mmeierer commented 4 years ago

Integrate the functionality of the package RcppEigen

mmeierer commented 4 years ago

This issue is not as straightforward as thought based on our intial assessment.

@pschil gave more details:

There is no bool-mask access to vectors and little support for non-continuous index acess for vectors.

That means:

non_zero = a != 0;  
log( a(non_zero) )

or

ind_non_zero = find(a != 0)
log( a(ind_non_zero) )

This seems to be achieved by using loops and is to some part still work-in-progress (in the Eigen library itself): http://eigen.tuxfamily.org/index.php?title=Working_notes_-_Indexing%2B%2B#Mask-based https://gitlab.com/libeigen/eigen/issues/329

There are examples where this is supported, but it does not yet work with RcppEigen (https://stackoverflow.com/questions/52289332/eigen-array-indexing/52342718#52342718).

We can consider as an alternative to write own mini-templates or helper functions for this, but this will take more time.

pschil commented 1 month ago

Interesting comparison but will not implement