% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/precompute.R
\name{precompute}
\alias{precompute}
\title{Compute a dense COO table in a database connection}
\usage{
precompute(conn, m, n, verbose = FALSE)
}
\arguments{
\item{conn}{duckdb database connection}

\item{m}{number of rows of precomputed dbMatrix table}

\item{n}{number of columns of precomputed dbMatrix table}

\item{verbose}{logical, print progress messages. default: FALSE.}
}
\value{
A \code{tbl_dbi} object referencing the newly created precomputed lookup
table in DuckDB.
}
\description{
Precomputes a COO list table in a specificied database connection in column-
major order.
This can speed up operations that involve breaking
sparsity of a \code{dbSparseMatrix},
such as in cases when performing + or - arithmetic operations.
}
\details{
The \code{m} and \code{n} parameters must exceed the
maximum row and column indices of the \code{dbMatrix} in order to be used for
densifying any \code{dbMatrix}. If these params are less than the maximum
row and column indices, a new precomputed table will be automatically
generated with the name 'precomp_mXn'.

In such cases, run this function again with a larger
\code{n_rows} and \code{num_cols}, or to manually remove the precomputed
table set \code{options(dbMatrix.precomp = NULL)} in the R console.
}
\concept{dbMatrix}
\keyword{internal}
