trsl logo
Public Member Functions | List of all members
trsl::weight_accessor< WeightType, ElementType > Struct Template Reference

Weight accessor that always returns 1. More...

#include <weight_accessor.hpp>

Public Member Functions

WeightType operator() (ElementType const &e) const
 Functor implementation. More...
 

Detailed Description

template<typename WeightType, typename ElementType>
struct trsl::weight_accessor< WeightType, ElementType >

Weight accessor that always returns 1.

This accessor can be passed to sample from a population of equal-weight elements. The total weight of the population should naturally be set to the number of elements in the population. This accessor is of type functor, see Accessors for more details.

Definition at line 23 of file weight_accessor.hpp.

Member Function Documentation

◆ operator()()

template<typename WeightType , typename ElementType >
WeightType trsl::weight_accessor< WeightType, ElementType >::operator() ( ElementType const &  e) const
inline

Functor implementation.

Returns
1.

Definition at line 30 of file weight_accessor.hpp.


The documentation for this struct was generated from the following file:
© Copyright 2007-2011 Renaud Detry.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at www.boost.org/LICENSE_1_0.txt.)
Revised Wed Jan 8 2020 14:43:32.