#' @export
ising_m2 <- function(
    params, use_MC = NULL, nr_samples = 10000L,
    warmup = 15L, nr_threads = 1L
) {
    if (missing(use_MC)) {
        use_MC <- if (is.matrix(params)) 19 < nrow(params) else 190 < length(params)
    }

    m2 <- .Call("C_ising_m2", params, use_MC, nr_samples, warmup, nr_threads,
            PACKAGE = "tensorPredictors"
    )

    M2 <- vech.pinv(m2)
    attr(M2, "log_prob_0") <- attr(m2, "log_prob_0")

    M2
}
