inlabru-org / inlabru

inlabru
https://inlabru-org.github.io/inlabru/
90 stars 21 forks source link

Tsparse fix needed for Matrix 1.5-2 #162

Closed finnlindgren closed 2 years ago

finnlindgren commented 2 years ago

From Matrix co-maintainer Mikael Jagan:

> packageDescription("inlabru", fields = c("Version", "Maintainer", "Imports"))
Version: 2.5.3
Maintainer: Finn Lindgren <[finn.lindgren@gmail.com](mailto:finn.lindgren@gmail.com)>
Imports: MatrixModels, magrittr, Matrix, patchwork, plyr, rgdal (>=
         1.5.8), rgeos, rlang, utils, withr

We are expecting to release Matrix 1.5-2 to CRAN next week, ahead of the release of R 4.2.2 on Oct 31, but

$ R CMD check inlabru_2.5.3.tar.gz

reveals a regression under the latest Matrix-devel (output attached). 00check.log

The reason is that kronecker(x, y), with one of 'x' and 'y' a CsparseMatrix and the other a TsparseMatrix, now returns a CsparseMatrix rather than a TsparseMatrix (for efficiency). Hence the result now has 'p' and 'i' slots rather than 'i' and 'j' slots.

If you absolutely need a TsparseMatrix, then you coerce the CsparseMatrix argument or result with as(., "TsparseMatrix").

Once you revise your source code, do verify that your package passes its checks under Matrix-devel, which you can install from R-Forge with

 > install.packages("Matrix", repos = "http://r-forge.r-project.org/")

If you are unable to make the requested changes before Oct 31, or if you need help or clarification while fixing your code, then please let me know.

finnlindgren commented 2 years ago

Need to move and/or copy the TsparseMatrix coersion to just before the assumption is need.

finnlindgren commented 2 years ago

Solved by #164