% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/matching_memory.R
\name{estimate_dense_matrix_mb}
\alias{estimate_dense_matrix_mb}
\title{Estimate dense cost-matrix memory footprint in megabytes}
\usage{
estimate_dense_matrix_mb(n, m, overhead_factor = 4)
}
\description{
The true peak footprint is not 8 bytes/cell: \code{matrix(0, n, m)} at the R
level (8B) is followed by \code{rcpp_to_cost_matrix()}'s copy into a
\code{lap::CostMatrix} (8B data + 4B mask), then \code{prepare_for_solve()}'s
unconditional copy (another 12B), and a possible \code{t()} transpose copy (8B).
Several of these are transient but can coexist during GC lag. A conservative
multiplier avoids systematically under-warning; \code{n}/\code{m} are coerced to
\code{double} before multiplying so the estimate itself can't overflow the way
\code{lap::CostMatrix}'s old \code{int} flat-index arithmetic did.
}
\keyword{internal}
