% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/FloodComplex.R
\name{flood_complex}
\alias{flood_complex}
\title{Construct a Flood complex}
\usage{
flood_complex(
  points,
  landmarks,
  max_dimension = NULL,
  points_per_edge = 30,
  backend = c("auto", "cpu", "torch"),
  batch_points = 2^22,
  delaunay = NULL
)
}
\arguments{
\item{points}{A numeric matrix (N x d) of witness points.}

\item{landmarks}{Either an integer (number of FPS landmarks) or a numeric matrix (N_l x d) of explicit landmark coordinates.}

\item{max_dimension}{Top dimension of the simplices. Defaults to d.}

\item{points_per_edge}{Grid resolution per simplex edge (accuracy vs. speed trade-off). Defaults to 30, as in flooder.}

\item{backend}{One of \code{"auto"}, \code{"cpu"}, \code{"torch"}.
\code{"cpu"} uses a kd-tree (RANN). \code{"torch"} uses the torch R package and runs on CUDA when available. \code{"auto"} picks torch only if a CUDA device is present, else the kd-tree.}

\item{batch_points}{Maximum number of grid points processed per batch (bounds memory). Defaults to 2^22.}

\item{delaunay}{Optional precomputed Delaunay triangulation of the landmarks: an m x (d+1) integer matrix of 1-based landmark indices. If NULL (default), computed via \code{geometry::delaunayn}.}
}
\value{
A list of class \code{"flood_complex"} with elements
  \code{simplices} (list of integer vectors, landmark indices),
  \code{filtration} (numeric vector of flood times),
  \code{landmarks} (matrix), \code{landmark_indices} (or NULL).
}
\description{
Builds the Flood complex of a point cloud: a Delaunay complex on a set of
landmarks whose simplices are filtered by their covering radius with
respect to the full point cloud ("flood time").
}
\examples{
\dontrun{
pts <- matrix(rnorm(3000), ncol = 2)
fc <- flood_complex(pts, landmarks = 40)
}
}
