R Under development (unstable) (2024-02-21 r85967 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(lfe) Loading required package: Matrix > options(digits=3) > set.seed(42) > B <- matrix(rnorm(40000),200) > A <- band(crossprod(B), -30,30) > tx <- rnorm(ncol(A)) > b <- A %*% tx > fun <- function(x) A %*% x > sol <- cgsolve(fun,b,eps=-0.001, symmtest=TRUE) > sqrt(sum((sol-tx)^2)) [1] 0.000138 > > A[5,6] <- 0.24 > options(warn=2) > try(cgsolve(fun,b,symmtest=TRUE)) Error in cgsolve(fun, b, symmtest = TRUE) : (converted from warning) fun seems to be non-symmetric > > proc.time() user system elapsed 0.93 0.04 0.95