versatile-mcmc  0.1.7
Classes | Functions
algorithm.hpp File Reference

Contains abstract base class for MCMC sampling algorithms. More...

#include <vmcmc/parameter.hpp>
#include <vmcmc/chain.hpp>
#include <vmcmc/typetraits.hpp>
#include <functional>
#include <vector>
#include <cmath>
Include dependency graph for algorithm.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  vmcmc::Algorithm
 Abstract base class for the core MCMC sampling algorithms. More...
 

Functions

template<size_t NParams, typename C , typename... Ts>
std::enable_if< NParams==sizeof...(Ts), double >::type vmcmc::detail::apply_first_n (C f, const std::vector< double > &v, Ts &&...ts)
 Call a variadic function using a vector of arguments. More...
 
template<size_t NParams, typename C , typename... Ts>
std::enable_if< NParams!=sizeof...(Ts), double >::type vmcmc::detail::apply_first_n (C f, const std::vector< double > &v, Ts &&...ts)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 

Detailed Description

Contains abstract base class for MCMC sampling algorithms.

Date
29.07.2016
Author
marco.nosp@m.@kle.nosp@m.esiek.nosp@m..com

Function Documentation

template<size_t NParams, typename C , typename... Ts>
std::enable_if<NParams == sizeof...(Ts), double>::type vmcmc::detail::apply_first_n ( f,
const std::vector< double > &  v,
Ts &&...  ts 
)
inline

Call a variadic function using a vector of arguments.

The vector is recursively packed into a variadic argument pack. Inspired by http://stackoverflow.com/a/23954589/6908762.

Parameters
NParamsThe number of arguments.
fThe target function to call.
vThe argument vector.
tsUsed internally for packing.
Returns
The target callable result.