* using log directory 'd:/RCompile/CRANincoming/R-devel/rtmpinv.Rcheck' * using R Under development (unstable) (2026-01-28 r89344 ucrt) * using platform: x86_64-w64-mingw32 * R was compiled by gcc.exe (GCC) 14.3.0 GNU Fortran (GCC) 14.3.0 * running under: Windows Server 2022 x64 (build 20348) * using session charset: UTF-8 * checking for file 'rtmpinv/DESCRIPTION' ... OK * checking extension type ... Package * this is package 'rtmpinv' version '0.2.0' * package encoding: UTF-8 * checking CRAN incoming feasibility ... OK * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking whether package 'rtmpinv' can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking for future file timestamps ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking code files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd line widths ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking examples ... OK * checking for unstated dependencies in 'tests' ... OK * checking tests ... [42s] ERROR Running 'testthat.R' [42s] Running the tests in 'tests/testthat.R' failed. Complete output: > library(testthat) > library(rtmpinv) > > test_check("rtmpinv") Saving _problems/test-tmpinv-90.R [ FAIL 1 | WARN 10 | SKIP 0 | PASS 11 ] ══ Failed tests ════════════════════════════════════════════════════════════════ ── Error ('test-tmpinv.R:83:3'): tmpinv works for reduced AP/TM on 20x20 zero-diagonal matrix ── Error in `(function (object, problem = "", C = NULL, S = NULL, M = NULL, b = NULL, m = NULL, p = NULL, i = 1L, j = 1L, zero_diagonal = FALSE, r = 1L, Z = NULL, rcond = FALSE, tolerance = NULL, iteration_limit = NULL, final = TRUE, alpha = NULL, ...) { if (!is.null(C) || !is.null(M) || (!is.null(m) && !is.null(p))) { object <- canonize.clsp(object, problem, C, S, M, NULL, b, m, p, i, j, zero_diagonal) } else if (is.null(object$A)) stop("At least one of C, M, m, or p must be provided.") if (nrow(object$A) != nrow(object$b)) stop(sprintf(paste0("The matrix A and vector b must have the same number ", "of rows: A has %d, b has %d"), nrow(object$A), nrow(object$b))) if (r < 1L) stop("Number of refinement iterations r must be ≥ 1.") if (!is.null(Z)) object$Z <- Z else if (is.null(object$Z)) object$Z <- diag(ncol(object$A)) if (!is.null(tolerance)) object$tolerance <- tolerance if (!is.null(iteration_limit)) object$iteration_limit <- iteration_limit if (!isTRUE(all.equal(object$Z, t(object$Z), tolerance = object$tolerance)) || !isTRUE(all.equal(object$Z %*% object$Z, object$Z, tolerance = object$tolerance)) || nrow(object$Z) != ncol(object$A)) stop(sprintf(paste0("Matrix Z must be symmetric, idempotent and match ", "the number of columns in A: expected (%d,%d), ", "got (%d,%d)"), ncol(object$A), ncol(object$A), nrow(object$Z), ncol(object$Z))) for (n_iter in seq_len(if (nrow(object$A) > object$C_idx[1]) r else 1L)) { if (n_iter > 1L) { res <- object$b - object$A %*% object$zhat nrmse_prev <- .nrmse.r2(object, res = res) Q <- diag(as.numeric(-sign(res[(object$C_idx[1] + 1):nrow(object$A), , drop = FALSE]))) object <- canonize.clsp(object, problem, C, S, M, Q, b, m, p, i, j, zero_diagonal) Z_delta <- ncol(object$A) - nrow(object$Z) if (Z_delta > 0L) { object$Z <- rbind(cbind(object$Z, matrix(0, nrow(object$Z), Z_delta)), cbind(matrix(0, Z_delta, ncol(object$Z)), diag(Z_delta))) } } object$zhat <- (MASS::ginv(object$Z %*% crossprod(object$A) %*% object$Z, tol = if (is.null(rcond)) sqrt(.Machine$double.eps) else if (isTRUE(rcond)) object$tolerance else rcond) %*% object$Z %*% t(object$A)) %*% object$b object$nrmse <- .nrmse.r2(object, res = object$b - object$A %*% object$zhat) object$r <- n_iter if (n_iter > 1L && (abs(object$nrmse - nrmse_prev) < object$tolerance || n_iter > object$iteration_limit)) break } if (!all(is.finite(object$zhat))) { object$zhat <- NA_real_ stop("Pseudoinverse estimate zhat failed") } if (!is.null(final)) object$final <- isTRUE(final) if (!is.null(alpha)) object$alpha <- max(0, min(1, as.numeric(alpha))) if (isTRUE(object$final)) { A_csc <- as(Matrix::Matrix(object$A, sparse = TRUE), "dgCMatrix") z_cvx <- CVXR::Variable(ncol(A_csc)) d_cvx <- z_cvx - as.numeric(object$zhat) if (isTRUE(all.equal(object$alpha, 0))) { f_obj <- CVXR::norm1(d_cvx) s_cvx <- "ECOS" } else if (isTRUE(all.equal(object$alpha, 1))) { f_obj <- CVXR::sum_squares(d_cvx) s_cvx <- "OSQP" } else { f_obj <- (1 - object$alpha) * CVXR::norm1(d_cvx) + object$alpha * CVXR::sum_squares(d_cvx) s_cvx <- "SCS" } c_cvx <- list(A_csc %*% z_cvx == as.numeric(object$b)) p_cvx <- CVXR::Problem(CVXR::Minimize(f_obj), c_cvx) dots <- list(...) dots$rcond <- NULL solution <- try(do.call(p_cvx$solve, c(list(solver = s_cvx, verbose = FALSE), dots)), silent = TRUE) if (inherits(solution, "try-error") || is.null(z_cvx$value)) { warning(sprintf("Step 2 infeasible (%s); falling back", p_cvx@status), call. = FALSE) object$z <- object$zhat } else { object$z <- as.numeric(z_cvx$value) object$nrmse <- .nrmse.r2(object) } } else { object$z <- object$zhat } object$x <- matrix(object$z[1:object$C_idx[2], , drop = FALSE], nrow = if (!is.null(m)) m else object$C_idx[2], ncol = if (!is.null(p)) p else 1) object$y <- (if (ncol(object$A) > object$C_idx[2]) object$z[(object$C_idx[2] + 1):length(object$z), , drop = FALSE] else matrix(numeric(0), ncol = 1)) object$kappaC <- kappa(object$A[1:object$C_idx[1], , drop = FALSE]) object$kappaB <- kappa(object$A %*% MASS::ginv(object$A[1:object$C_idx[1], , drop = FALSE])) object$kappaA <- kappa(object$A) if (nrow(object$A) > object$C_idx[1]) { object$r2_partial <- .nrmse.r2(object, r2 = TRUE, partial = TRUE) object$nrmse_partial <- .nrmse.r2(object, partial = TRUE) } b_norm <- sqrt(sum(object$b^2)) dz <- if (isTRUE(all.equal(b_norm, 0))) Inf else object$kappaA * sqrt(sum((object$b - object$A %*% matrix(object$z, ncol = 1))^2))/b_norm object$z_lower <- object$z * (1 - dz) object$z_upper <- object$z * (1 + dz) object$x_lower <- matrix(object$z_lower[1:object$C_idx[2], , drop = FALSE], nrow = if (!is.null(m)) m else object$C_idx[2], ncol = if (!is.null(p)) p else 1) object$x_upper <- matrix(object$z_upper[1:object$C_idx[2], , drop = FALSE], nrow = if (!is.null(m)) m else object$C_idx[2], ncol = if (!is.null(p)) p else 1) object$y_lower <- (if (ncol(object$A) > object$C_idx[2]) object$z_lower[(object$C_idx[2] + 1):length(object$z), , drop = FALSE] else matrix(numeric(0), ncol = 1)) object$y_upper <- (if (ncol(object$A) > object$C_idx[2]) object$z_upper[(object$C_idx[2] + 1):length(object$z), , drop = FALSE] else matrix(numeric(0), ncol = 1)) object })(list(A = NULL, C_idx = c(NA_integer_, NA_integer_), b = NULL, Z = NULL, tolerance = 1.49011611938477e-08, iteration_limit = 50L, r = 0L, zhat = NULL, final = TRUE, alpha = 1, z = NULL, x = NULL, y = NULL, kappaC = NA_real_, kappaB = NA_real_, kappaA = NA_real_, rmsa = NA_real_, rmsa_i = NULL, rmsa_dkappaC = NULL, rmsa_dkappaB = NULL, rmsa_dkappaA = NULL, rmsa_dnrmse = NULL, rmsa_dzhat = NULL, rmsa_dz = NULL, rmsa_dx = NULL, r2_partial = NA_real_, nrmse = NA_real_, nrmse_partial = NA_real_, nrmse_ttest = NULL, z_lower = NULL, z_upper = NULL, x_lower = NULL, x_upper = NULL, y_lower = NULL, y_upper = NULL, seed = 123456789L, distribution = function (n, mean = 0, sd = 1) .Call(C_rnorm, n, mean, sd)), tolerance = 1.49011611938477e-08, final = TRUE, alpha = 1, problem = "ap", C = structure(c(0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1), dim = c(4L, 4L)), S = structure(c(1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1), dim = c(8L, 12L)), M = structure(c(1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1), dim = 3:4), b = structure(c(3801, 3800, 7031, 7410, 0, 1.24370555229162e+298, 0, 0, 0, 0, 0), dim = c(11L, 1L)), m = 2L, p = 2L, i = 1L, j = 1L, zero_diagonal = FALSE, r = 1L, Z = NULL, rcond = FALSE, iteration_limit = 50L)`: Pseudoinverse estimate zhat failed Backtrace: ▆ 1. └─rtmpinv::tmpinv(...) at test-tmpinv.R:83:3 2. ├─base::suppressWarnings(...) 3. │ └─base::withCallingHandlers(...) 4. ├─base::do.call(...) 5. └─rtmpinv (local) ``(...) 6. ├─base::do.call(...) 7. └─rclsp (local) ``(...) 8. ├─base::do.call(...) 9. └─rclsp (local) ``(...) 10. ├─base::do.call(...) 11. └─rclsp (local) ``(...) [ FAIL 1 | WARN 10 | SKIP 0 | PASS 11 ] Error: ! Test failures. Execution halted * checking PDF version of manual ... [12s] OK * checking HTML version of manual ... OK * DONE Status: 1 ERROR