% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/toCsparse.R
\name{toCsparse}
\alias{toCsparse}
\title{Convert a SparseArraySeed to a CsparseMatrix}
\usage{
toCsparse(x)
}
\arguments{
\item{x}{Any object produced by block processing with \code{\link{colBlockApply}} or \code{\link{rowBlockApply}}.
This can be a matrix, sparse matrix or a two-dimensional \linkS4class{SparseArraySeed}.}
}
\value{
\code{x} is returned unless it was a \linkS4class{SparseArraySeed},
in which case an appropriate \linkS4class{CsparseMatrix} object is returned instead.
}
\description{
Exactly what it says in the title.
}
\details{
This is intended for use inside functions to be passed to \code{\link{colBlockApply}} or \code{\link{rowBlockApply}}.
The idea is to pre-process blocks for user-defined functions that don't know how to deal with SparseArraySeed objects,
which is often the case for R-defined functions that do not benefit from \pkg{beachmat}'s C++ abstraction.
}
\examples{
library(DelayedArray)
out <- SparseArraySeed(c(10, 10), 
    nzindex=cbind(1:10, sample(10)),
    nzdata=runif(10))
toCsparse(out)

}
\author{
Aaron Lun
}
