BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
Precomputed Namespace Reference

Classes

struct  ReciprocalFactorial
 
struct  ReciprocalFactorial< 0 >
 

Functions

template<template< size_t > class F, size_t... I>
constexpr std::array< double, sizeof...(I)> GenerateArrayHelper (std::index_sequence< I... >)
 
template<size_t N, typename Indices = std::make_index_sequence<N>>
constexpr std::array< double, N > GenerateReciprocalFactorialArray ()
 

Detailed Description

Compile-time generated std::array of reciprocal factorials.

Function Documentation

◆ GenerateArrayHelper()

template<template< size_t > class F, size_t... I>
constexpr std::array<double, sizeof...(I)> Precomputed::GenerateArrayHelper ( std::index_sequence< I... >  )
constexpr

Definition at line 34 of file Precomputed.h.

35 {
36  return {F<I>::value...};
37 };

◆ GenerateReciprocalFactorialArray()

template<size_t N, typename Indices = std::make_index_sequence<N>>
constexpr std::array<double, N> Precomputed::GenerateReciprocalFactorialArray ( )
constexpr

Definition at line 40 of file Precomputed.h.

41 {
42  return GenerateArrayHelper<ReciprocalFactorial>(Indices{});
43 };