1#ifndef __SIMULATION_PROBA_LEAVING_HPP__
2#define __SIMULATION_PROBA_LEAVING_HPP__
4#include <Kokkos_Assert.hpp>
5#include <Kokkos_Core.hpp>
6#include <common/maths.hpp>
24 template <
typename T,
typename FastSample = precision_tag>
25 KOKKOS_INLINE_FUNCTION
bool
31 template <
typename T,
typename FastSample = precision_tag>
32 KOKKOS_INLINE_FUNCTION
bool
35 KOKKOS_ASSERT(random_number >= 0. && random_number <= 1.);
36 KOKKOS_ASSERT(volume >= 0.);
37 KOKKOS_ASSERT(flow >= 0.);
38 KOKKOS_ASSERT(dt >= 0.);
46 KOKKOS_INLINE_FUNCTION
bool
52 KOKKOS_ASSERT(random_number >= 0. && random_number <= 1.);
53 KOKKOS_ASSERT(volume >= 0.);
54 KOKKOS_ASSERT(flow >= 0.);
55 KOKKOS_ASSERT(dt >= 0.);
57 return (dt * flow / volume) > random_number;
62 KOKKOS_INLINE_FUNCTION
bool
68 KOKKOS_ASSERT(random_number >= 0. && random_number <= 1.);
69 KOKKOS_ASSERT(volume >= 0.);
70 KOKKOS_ASSERT(flow >= 0.);
71 KOKKOS_ASSERT(dt >= 0.);
73 return (dt * flow / volume) > random_number;
KOKKOS_INLINE_FUNCTION float _ln(float x)
Definition maths.hpp:11
Definition kernels.hpp:19
KOKKOS_INLINE_FUNCTION bool probability_leaving< double, fast_tag >(double random_number, double volume, double flow, double dt)
Definition probability_leaving.hpp:63
static constexpr bool _use_kokkos_log
Definition probability_leaving.hpp:14
KOKKOS_INLINE_FUNCTION bool probability_leaving(const T random_number, const double lambda)
Definition probability_leaving.hpp:26
void fast_tag
Definition probability_leaving.hpp:11
int precision_tag
Definition probability_leaving.hpp:12
KOKKOS_INLINE_FUNCTION bool probability_leaving< float, fast_tag >(float random_number, double volume, double flow, double dt)
Definition probability_leaving.hpp:47