Read-only view of a subset of the coordinates of every component of a mixture or a hybrid, which iterates the components and gives each one's marginal in turn (decisions.md [element-marginals]).
More...
|
|
using | Scalar = typename Source::Scalar |
| | the scalar type
|
|
using | Index = Eigen::Index |
| | Eigen's index type.
|
|
using | SpaceType = SubSpace |
| | the selected block's space
|
|
using | allocator_type = typename Source::allocator_type |
| | the source's allocator
|
|
using | ComponentType = typename Source::ComponentType |
| | a component of the source
|
|
using | ResolvedType = typename internal::SelectionHolder<Source, Selection, SubSpace>::ResolvedType |
| | the selection, resolved
|
|
using | IndexVectorType = decltype(ResolvedType::indices) |
| | The selected mean entries' indices.
|
|
using | DifferenceIndexVectorType = decltype(ResolvedType::differenceIndices) |
| | The selected covariance rows' indices.
|
| using | ComponentMarginalType |
| | The marginal of one component, which borrows this view's selection.
|
|
using | value_type = Element |
| | an element, made when read
|
|
using | const_iterator = internal::ElementIterator<MixtureMarginal> |
| | iterates the elements
|
|
using | iterator = const_iterator |
| | iterates the elements; they are read-only
|
| using | ParamsType |
| | what copy() returns: the container of the components' marginals, as parameters
|
template<typename Source, typename Selection, typename SubSpace>
class Emrys::MixtureMarginal< Source, Selection, SubSpace >
Read-only view of a subset of the coordinates of every component of a mixture or a hybrid, which iterates the components and gives each one's marginal in turn (decisions.md [element-marginals]).
Obtained from marginal() of MixtureParams, Mixture, or Hybrid, and held by auto: its Selection is internal, so its type is never spelled, and a function that takes one takes it as a template parameter. It is a random-access range whose elements, made when read, hold a component's log-weight and the marginal of the component, as the entries of a mixture hold its log-weight and the component: a GaussianMarginal for a Gaussian, and a MixtureMarginal of the modes for a Hybrid. Nothing is copied, and nothing allocates: the selected coordinates are resolved once, here, and every component's marginal borrows them, so an element must not outlive this view. Of parameters it checks their shape, each time an element is made; of a Mixture it holds a copy of the view, and so the view's check. Weights are those of the source.
for (auto const & [logWeight, position] : mixture.marginal<Position>())
{
position.mean();
}
- Template Parameters
-
| Source | a MixtureParams, a Mixture, or a Hybrid |
| Selection | an internal::Coordinates of the index sets of the selected block, from idx() for the means and diffIdx() for the covariances, or an internal::SharedSelection of a selection resolved already |
| SubSpace | space of the selected block |