samuel-watson / glmmrBase

R package for specifying, fitting, analysing, and simulating generalised linear mixed models
3 stars 0 forks source link

Covariance and linear predictor calculated twice in R6 Model class #22

Closed samuel-watson closed 11 months ago

samuel-watson commented 1 year ago

As it separately initialises the linked covariance and mean classes, it generates all the data twice, which is inefficient and slow. Passing pointers to the Model covariance and linear predictor classes does not seem to be memory safe. Best option is to improve the copy constructor to minimise calculations and pass the pointer as an argument from the covariance and mean classes.