% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{init_motif_specs}
\alias{init_motif_specs}
\title{Initialise and validate a list of motif specifications}
\usage{
init_motif_specs(motifs)
}
\arguments{
\item{motifs}{A list of motif specifications (see above).}
}
\value{
A list with three elements:
\describe{
  \item{\code{compute}}{A function \code{function(A)} that evaluates all
    motifs on an adjacency matrix and returns a named numeric vector.}
  \item{\code{edge_counts}}{Integer vector of edge counts, one per moment.}
  \item{\code{names}}{Character vector of moment names, in the same order
    as \code{edge_counts}.}
}
}
\description{
Parses a mixed list of built-in motif names (character strings) and
user-supplied specifications (lists with \code{fn} and \code{n_edges})
into an internal representation used throughout the package.
}
\details{
Built-in motifs and their edge counts:
\itemize{
  \item \code{"v_shape"} -- 2-star (V-shape), 2 edges
  \item \code{"triangle"} -- triangle, 3 edges
  \item \code{"star3"} -- 3-star, 3 edges
}

A user-supplied specification must be a named list with:
\itemize{
  \item \code{fn}: a \code{function(A)} that accepts a square binary
    adjacency matrix and returns a \emph{named} numeric vector of one or
    more moment values (one element per motif computed by that function).
  \item \code{n_edges}: integer vector whose length equals the length of
    \code{fn}'s return value, giving the number of edges in each
    corresponding motif.  Used for density normalisation.
}
}
\keyword{internal}
