% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/maxent.R
\name{maxent_background_indices}
\alias{maxent_background_indices}
\title{Generate Background Sample Indices}
\usage{
maxent_background_indices(grid, n = 10000L, seed = NULL)
}
\arguments{
\item{grid}{External pointer to a GridFloat object used as a reference
(e.g. an environmental layer). Only cells with valid data are eligible.}

\item{n}{Integer: number of background points to sample
(default \code{10000L}).}

\item{seed}{Integer or \code{NULL}: random seed for reproducibility.
If \code{NULL} (default), no seed is set.}
}
\value{
A named list with:
  \describe{
    \item{rows}{Integer vector of row indices (0-based).}
    \item{cols}{Integer vector of column indices (0-based).}
    \item{indices}{Integer vector of 0-based flat indices
      (\code{row * ncols + col}), suitable for
      \code{\link{maxent_featured_space}}.}
  }
}
\description{
Randomly selects valid (non-NODATA) cells from a reference grid for use
as background points in MaxEnt modeling.
}
\examples{
\donttest{
dim <- maxent_dimension(100, 100, -120, 35, 0.1)
grid <- maxent_grid(dim, "env1")
bg <- maxent_background_indices(grid, n = 5000, seed = 42)
bg$indices  # 0-based flat indices for FeaturedSpace
}
}
