% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/format5.R
\name{getbd5snp_buf}
\alias{getbd5snp_buf}
\title{Read a Format 5 SNP into pre-allocated vectors (buffered variant)}
\usage{
getbd5snp_buf(bd5info, snp, dosage, p0, p1, p2)
}
\arguments{
\item{bd5info}{Object returned by \code{getbdinfo}.}

\item{snp}{1-based integer index or character SNP ID.}

\item{dosage}{Pre-allocated \code{numeric(n_samples)} vector.}

\item{p0}{Pre-allocated \code{numeric(n_samples)} vector.}

\item{p1}{Pre-allocated \code{numeric(n_samples)} vector.}

\item{p2}{Pre-allocated \code{numeric(n_samples)} vector.}
}
\value{
\code{NULL} invisibly.  \code{dosage}, \code{p0}, \code{p1}, and
\code{p2} are updated in place.
}
\description{
Like \code{getbd5snp} but writes results into caller-supplied vectors
instead of allocating new ones.  Intended for tight loops where thousands
of SNPs are read sequentially; pre-allocating the output vectors once
avoids repeated memory allocation.
}
\details{
The four output vectors \strong{must not} have more than one R binding at
the call site (no extra variables pointing to the same object); R's
copy-on-modify semantics would otherwise prevent in-place update.
}
