% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mappers.R, R/mapper_collect.R,
%   R/mapper_repeat.R, R/mapper_sum.R
\name{ibm_n}
\alias{ibm_n}
\alias{ibm_n.default}
\alias{ibm_n.bm_fmesher}
\alias{ibm_n.bm_fm_mesh_1d}
\alias{ibm_n.bm_taylor}
\alias{ibm_n.bm_linear}
\alias{ibm_n.bm_matrix}
\alias{ibm_n.bm_factor}
\alias{ibm_n.bm_const}
\alias{ibm_n.bm_shift}
\alias{ibm_n.bm_scale}
\alias{ibm_n.bm_aggregate}
\alias{ibm_n.bm_marginal}
\alias{ibm_n.bm_pipe}
\alias{ibm_n.bm_multi}
\alias{ibm_n.bm_harmonics}
\alias{ibm_n.bm_reparam}
\alias{ibm_n.bm_collect}
\alias{ibm_n.bm_repeat}
\alias{ibm_n.bm_sum}
\title{Size of the latent vector of a mapping}
\usage{
ibm_n(mapper, inla_f = FALSE, ...)

\method{ibm_n}{default}(mapper, inla_f = FALSE, ...)

\method{ibm_n}{bm_fmesher}(mapper, ...)

\method{ibm_n}{bm_fm_mesh_1d}(mapper, ...)

\method{ibm_n}{bm_taylor}(mapper, inla_f = FALSE, multi = FALSE, ...)

\method{ibm_n}{bm_linear}(mapper, ...)

\method{ibm_n}{bm_matrix}(mapper, ...)

\method{ibm_n}{bm_factor}(mapper, ...)

\method{ibm_n}{bm_const}(mapper, ...)

\method{ibm_n}{bm_shift}(mapper, ..., state = NULL, n_state = NULL)

\method{ibm_n}{bm_scale}(mapper, ..., state = NULL, n_state = NULL)

\method{ibm_n}{bm_aggregate}(mapper, ..., input = NULL, state = NULL, n_state = NULL)

\method{ibm_n}{bm_marginal}(mapper, ..., state = NULL, n_state = NULL)

\method{ibm_n}{bm_pipe}(mapper, ..., input = NULL, state = NULL)

\method{ibm_n}{bm_multi}(mapper, inla_f = FALSE, multi = FALSE, ...)

\method{ibm_n}{bm_harmonics}(mapper, inla_f = FALSE, ...)

\method{ibm_n}{bm_reparam}(mapper, ...)

\method{ibm_n}{bm_collect}(mapper, inla_f = FALSE, multi = FALSE, ...)

\method{ibm_n}{bm_repeat}(mapper, ...)

\method{ibm_n}{bm_sum}(mapper, inla_f = FALSE, multi = FALSE, ...)
}
\arguments{
\item{mapper}{A mapper S3 object, inheriting from \code{bru_mapper}.}

\item{inla_f}{logical; when \code{TRUE} for \code{ibm_n()} and \code{ibm_values()}, the
result must be compatible with the \code{INLA::f(...)} and corresponding
\code{INLA::inla.stack(...)} constructions.  For \verb{ibm_\{eval,jacobian,linear\}},
the \code{input} interpretation may be different.
Implementations do not normally need to do anything different, except
for mappers of the type needed for hidden multicomponent models such
as "bym2", which can be handled by \code{bm_collect}.}

\item{\dots}{Arguments passed on to other methods}

\item{multi}{logical;
If \code{TRUE} (or positive), recurse one level into sub-mappers}

\item{state}{A vector of latent state values for the mapping,
of length \code{ibm_n(mapper, inla_f = FALSE)}}

\item{n_state}{integer giving the length of the state vector for mappers
that have state dependent output size.}

\item{input}{Data input for the mapper.}
}
\description{
Implementations must return the size of the latent vector
being mapped to.
}
\section{Methods (by class)}{
\itemize{
\item \code{ibm_n(default)}: Returns a non-null element 'n' from the
mapper object, and gives an error if it doesn't exist. If \code{inla_f=TRUE},
first checks for a 'n_inla' element.

\item \code{ibm_n(bm_fmesher)}: Returns the \code{\link[fmesher:fm_dof]{fmesher::fm_dof()}} value of the mesh being
mapped.

\item \code{ibm_n(bm_fm_mesh_1d)}: Returns the \code{\link[fmesher:fm_dof]{fmesher::fm_dof()}} value of the mesh being
mapped.

\item \code{ibm_n(bm_linear)}: Returns \code{1L}

\item \code{ibm_n(bm_matrix)}: Returns the number of columns in the matrix mapper.

\item \code{ibm_n(bm_factor)}: Returns the number of levels when \code{factor_mapping} is
"full", and the number of levels minus one if \code{factor_mapping} is
"contrast".

}}
\seealso{
Other mapper methods: 
\code{\link{bru_mapper_generics}},
\code{\link{ibm_eval}()},
\code{\link{ibm_eval2}()},
\code{\link{ibm_inla_subset}()},
\code{\link{ibm_invalid_output}()},
\code{\link{ibm_is_linear}()},
\code{\link{ibm_is_rowwise}()},
\code{\link{ibm_jacobian}()},
\code{\link{ibm_linear}()},
\code{\link{ibm_n_output}()},
\code{\link{ibm_names}()},
\code{\link{ibm_simplify}()},
\code{\link{ibm_values}()}
}
\concept{mapper methods}
