1#ifndef IPPL_RANDOM_UTILITY_H
2#define IPPL_RANDOM_UTILITY_H
4#include <Kokkos_MathematicalConstants.hpp>
5#include <Kokkos_MathematicalFunctions.hpp>
6#include <Kokkos_Random.hpp>
27 template <
typename T,
class Distribution>
31 unsigned int max_iter = 20;
52 KOKKOS_INLINE_FUNCTION
void solve(
unsigned int d, T& x, T& u) {
53 unsigned int iter = 0;
54 while (iter < max_iter && Kokkos::fabs(dist.
getObjFunc(x, d, u)) > atol) {
The class that represents a distribution.
Definition Distribution.h:33
KOKKOS_INLINE_FUNCTION T getObjFunc(T x, unsigned int d, T u) const
Definition Distribution.h:92
KOKKOS_INLINE_FUNCTION T getDerObjFunc(T x, unsigned int d) const
Definition Distribution.h:100
Functor for solving equations using the Newton-Raphson method.
Definition Utility.h:28
KOKKOS_INLINE_FUNCTION void solve(unsigned int d, T &x, T &u)
Solve an equation using the Newton-Raphson method.
Definition Utility.h:52