% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/is_leslie.R
\name{is_leslie}
\alias{is_leslie}
\title{Test whether a matrix is a Leslie matrix}
\usage{
is_leslie(A, tol = sqrt(.Machine$double.eps))
}
\arguments{
\item{A}{A numeric square matrix. A length-1 positive numeric will be coerced to a 1x1 matrix.}

\item{tol}{Numeric tolerance used for structural comparisons and bounds checks.}
}
\value{
Logical; \code{TRUE} if \code{A} is a Leslie matrix, otherwise \code{FALSE}.
}
\description{
Checks whether a matrix \code{A} has Leslie form: nonzero entries are allowed only in the first row
(fertility rates) and on the subdiagonal (survival probabilities). Survival probabilities
must be in \eqn{(0, 1]} (within tolerance), fertility rates must be nonnegative, and
at least one fertility rate must be positive.
}
\details{
A 1x1 matrix with a positive entry is treated as a valid (degenerate) Leslie matrix.
}
\examples{
L <- matrix(c(
  0, 2, 1,
  0.6, 0, 0,
  0, 0.7, 0
), nrow = 3, byrow = TRUE)
is_leslie(L)

}
