|
| Mixer (std::size_t max_history) |
| Construct a mixer. Functions have to initialized individually. More...
|
|
template<std::size_t FUNC_INDEX, typename... ARGS> |
void | initialize_function (const FunctionProperties< typename std::tuple_element< FUNC_INDEX, std::tuple< FUNCS... > >::type > &function_prop, const typename std::tuple_element< FUNC_INDEX, std::tuple< FUNCS... > >::type &init_value, ARGS &&... args) |
|
template<std::size_t FUNC_INDEX> |
void | set_input (const typename std::tuple_element< FUNC_INDEX, std::tuple< FUNCS... > >::type &input) |
| Set input for next mixing step. More...
|
|
template<std::size_t FUNC_INDEX> |
void | get_output (typename std::tuple_element< FUNC_INDEX, std::tuple< FUNCS... > >::type &output) |
| Access last generated output. Mixing must have been performed at least once. More...
|
|
double | mix (double rms_min__) |
| Mix input and stored history. Returns the root mean square error computed by inner products of residuals. More...
|
|
|
virtual void | mix_impl ()=0 |
|
void | update_residual () |
|
void | update_rms () |
|
std::size_t | idx_hist (std::size_t step) const |
|
template<bool normalize> |
double | inner_product (const std::tuple< std::unique_ptr< FUNCS >... > &x, const std::tuple< std::unique_ptr< FUNCS >... > &y) |
|
void | scale (double alpha, std::tuple< std::unique_ptr< FUNCS >... > &x) |
|
void | copy (const std::tuple< std::unique_ptr< FUNCS >... > &x, std::tuple< std::unique_ptr< FUNCS >... > &y) |
|
void | axpy (double alpha, const std::tuple< std::unique_ptr< FUNCS >... > &x, std::tuple< std::unique_ptr< FUNCS >... > &y) |
|
void | rotate (double c, double s, std::tuple< std::unique_ptr< FUNCS >... > &x, std::tuple< std::unique_ptr< FUNCS >... > &y) |
|
template<typename... FUNCS>
class sirius::mixer::Mixer< FUNCS >
Abstract mixer for variadic number of Function objects, which are described by FunctionProperties.
Can mix variadic number of functions objects, for which operations are defined in FunctionProperties. Only functions, which are explicitly initialized, are mixed.
Definition at line 278 of file mixer.hpp.
template<typename... FUNCS>
template<std::size_t FUNC_INDEX, typename... ARGS>
void sirius::mixer::Mixer< FUNCS >::initialize_function |
( |
const FunctionProperties< typename std::tuple_element< FUNC_INDEX, std::tuple< FUNCS... > >::type > & |
function_prop, |
|
|
const typename std::tuple_element< FUNC_INDEX, std::tuple< FUNCS... > >::type & |
init_value, |
|
|
ARGS &&... |
args |
|
) |
| |
|
inline |
Initialize function at given index with given value. A new function object is created with "args" passed to the constructor. Only initialized functions are mixed.
- Parameters
-
[in] | function_prop | Function properties, which describe operations. |
[in] | init_value | Initial function value for input / output. |
[in] | args | Arguments, which are passed to the constructor of function placeholder objects. |
Definition at line 307 of file mixer.hpp.