2

The last version of armadillo gives a warning of matrix not symmetric when using inv_sympd. However, the matrix is a cross-product so I am sure it is symmetric. When I print A-arma::trans(A) I get that all the elements are 0 except one that is 1.1369e-013.

The warning causes Rstudio to crush sometimes because I am using parallel computing, so different cores can try to print at the same time and make it crush. How can I disable the warning or make it less strict?

Roberto
  • 41
  • 7
  • Can you force it to be symmetric, e.g. by using `arma::inv_sympd(arma::symmatu(A))`? And are you certain that your matrix is positive definite (and not only symmetric)? – hejseb May 03 '19 at 08:20
  • Thank you. What you suggest would work. However, I use the inv_sympd in many places in the code, so I would have to modify all those. Also, I am afraid it adds unnecessary operations. For the moment I am using #define ARMA_DONT_PRINT_ERRORS #include which disable all warning messages. I was just wondering if there is any way to disable only the non symmetric warning, or to modify it so that it is not so strict. By the way, yes, I am sure the matrix is positive definite and symmetric. A=arma::trans(X)*X+other symmetric pd matrices. – Roberto May 04 '19 at 00:31
  • 2
    This seems to be fixed in Armadillo 9.400.3 – hbrerkere May 06 '19 at 03:38
  • Thank you. When I install the package RccppArmadillo in Rstudio, it seems that it installs version 9.400.2, which has the problem I described. How can I try the new version in Rstudio? – Roberto May 08 '19 at 01:55
  • Try this in your R session: `install.packages("devtools")` Then enable devtools: `library(devtools)` Then install the latest RcppArmadillo from GitHub: `devtools::install_github("RcppCore/RcppArmadillo")` – hbrerkere May 08 '19 at 04:05
  • It is now on CRAN and before that was available for `install.packages()` via the [RcppCore drat repo](http://rcppcore.github.io/drat/) . I'd recommend against `install_github()`. – Dirk Eddelbuettel May 13 '19 at 21:17
  • Thank you, problem solved. I installed again RcppArmadillo, which seems to install version 9.400.3. Now I don't get the warning. (I tried to install also devtools, but I didn't manage.) – Roberto May 14 '19 at 05:36

0 Answers0