LogarithmicCoordinates1D< NT > Class Template Reference#

DiFfRG: LogarithmicCoordinates1D< NT > Class Template Reference
DiFfRG
Discretization Framework for functional Renormalization Group flows
LogarithmicCoordinates1D< NT > Class Template Reference

Points on [start, stop], including both ends, with spacing growing exponentially in the index. More...

#include <coordinates.hh>

Public Types

using ctype = NT
 Scalar type.
 

Public Member Functions

 LogarithmicCoordinates1D (size_t grid_extent, double start, double stop, double bias)
 
template<typename NT2 >
 LogarithmicCoordinates1D (const LogarithmicCoordinates1D< NT2 > &other)
 Convert from another precision.
 
LogarithmicCoordinates1D prefix (size_t n) const
 The first n points of this grid, as a grid of the same type.
 
size_t KOKKOS_FORCEINLINE_FUNCTION parent_size () const
 Number of points of the grid this one is a prefix() of; size() unless it is a prefix.
 
device::array< size_t, 1 > KOKKOS_FORCEINLINE_FUNCTION from_linear_index (size_t i) const
 The multi-index {i} of point i.
 
template<typename IT >
NT KOKKOS_FORCEINLINE_FUNCTION forward (const IT &x) const
 The coordinate \(x(i)\) at grid index x (real values allowed).
 
template<typename IT >
device::array< NT, 1 > KOKKOS_FORCEINLINE_FUNCTION forward (const device::array< IT, 1 > &x) const
 As forward(x[0]).
 
NT KOKKOS_FORCEINLINE_FUNCTION backward (const NT &y) const
 The inverse map: the (fractional) grid index of the coordinate y.
 
NT KOKKOS_FORCEINLINE_FUNCTION backward_derivative (const NT &y) const
 \(di/dx\) at the coordinate y.
 
size_t KOKKOS_FORCEINLINE_FUNCTION size () const
 Number of points N.
 
device::array< size_t, 1 > KOKKOS_FORCEINLINE_FUNCTION sizes () const
 {N}.
 
std::string to_string () const
 "LogarithmicCoordinates1D(start, stop, bias, N)"; identifies the grid.
 

Public Attributes

const NT start
 The parameters.
 
const NT stop
 
const NT bias
 

Static Public Attributes

static constexpr size_t dim = 1
 One axis.
 

Friends

template<typename NT2 >
bool operator== (const LogarithmicCoordinates1D< NT > &lhs, const LogarithmicCoordinates1D< NT2 > &rhs)
 Same precision, parameters and number of points (and the same parent, for a prefix).
 

Detailed Description

template<typename NT = double>
requires std::is_floating_point_v<NT>
class DiFfRG::LogarithmicCoordinates1D< NT >

Points on [start, stop], including both ends, with spacing growing exponentially in the index.

With N = grid_extent ≥ 2, bias b ≠ 0 and grid index i (real values allowed):

\[ x(i) = \mathrm{start} + (\mathrm{stop} - \mathrm{start})\,\frac{e^{b\,i/(N-1)} - 1}{e^{b} - 1}\,. \]

For b > 0 the points cluster near start (consecutive spacings grow by the factor \(e^{b/(N-1)}\)), for b < 0 near stop; b → 0 approaches LinearCoordinates1D.

Template Parameters
NTScalar type of the coordinates.

Member Typedef Documentation

◆ ctype

template<typename NT = double>
using ctype = NT

Scalar type.

Constructor & Destructor Documentation

◆ LogarithmicCoordinates1D() [1/2]

template<typename NT = double>
LogarithmicCoordinates1D ( size_t grid_extent,
double start,
double stop,
double bias )
inline

grid_extent points (≥ 2) from start to stop with bias (≠ 0); throws otherwise. Constants are computed in double.

◆ LogarithmicCoordinates1D() [2/2]

template<typename NT = double>
template<typename NT2 >
LogarithmicCoordinates1D ( const LogarithmicCoordinates1D< NT2 > & other)
inline

Convert from another precision.

Member Function Documentation

◆ backward()

template<typename NT = double>
NT KOKKOS_FORCEINLINE_FUNCTION backward ( const NT & y) const
inline

The inverse map: the (fractional) grid index of the coordinate y.

◆ backward_derivative()

template<typename NT = double>
NT KOKKOS_FORCEINLINE_FUNCTION backward_derivative ( const NT & y) const
inline

\(di/dx\) at the coordinate y.

◆ forward() [1/2]

template<typename NT = double>
template<typename IT >
device::array< NT, 1 > KOKKOS_FORCEINLINE_FUNCTION forward ( const device::array< IT, 1 > & x) const
inline

As forward(x[0]).

◆ forward() [2/2]

template<typename NT = double>
template<typename IT >
NT KOKKOS_FORCEINLINE_FUNCTION forward ( const IT & x) const
inline

The coordinate \(x(i)\) at grid index x (real values allowed).

◆ from_linear_index()

template<typename NT = double>
device::array< size_t, 1 > KOKKOS_FORCEINLINE_FUNCTION from_linear_index ( size_t i) const
inline

The multi-index {i} of point i.

◆ parent_size()

template<typename NT = double>
size_t KOKKOS_FORCEINLINE_FUNCTION parent_size ( ) const
inline

Number of points of the grid this one is a prefix() of; size() unless it is a prefix.

◆ prefix()

template<typename NT = double>
LogarithmicCoordinates1D prefix ( size_t n) const
inline

The first n points of this grid, as a grid of the same type.

forward(i) is bit-identical to that of the full grid for i < n, and backward() is unchanged; use it to skip the upper end of a grid without changing the coordinate type. The prefix keeps the parameters and point count of the full grid (parent_size()); to_string() appends ".prefix(n)".

Parameters
nNumber of points kept, 1 ≤ n ≤ size().

◆ size()

template<typename NT = double>
size_t KOKKOS_FORCEINLINE_FUNCTION size ( ) const
inline

Number of points N.

◆ sizes()

template<typename NT = double>
device::array< size_t, 1 > KOKKOS_FORCEINLINE_FUNCTION sizes ( ) const
inline

{N}.

◆ to_string()

template<typename NT = double>
std::string to_string ( ) const
inline

"LogarithmicCoordinates1D(start, stop, bias, N)"; identifies the grid.

Friends And Related Symbol Documentation

◆ operator==

template<typename NT = double>
template<typename NT2 >
bool operator== ( const LogarithmicCoordinates1D< NT > & lhs,
const LogarithmicCoordinates1D< NT2 > & rhs )
friend

Same precision, parameters and number of points (and the same parent, for a prefix).

Member Data Documentation

◆ bias

template<typename NT = double>
const NT bias

◆ dim

template<typename NT = double>
size_t dim = 1
staticconstexpr

One axis.

◆ start

template<typename NT = double>
const NT start

The parameters.

◆ stop

template<typename NT = double>
const NT stop

The documentation for this class was generated from the following file:
  • /home/runner/work/DiFfRG/DiFfRG/DiFfRG/include/DiFfRG/discretization/coordinates/coordinates.hh