STORMM Source Documentation
Loading...
Searching...
No Matches
stormm::energy::LogSplineTable< T4 > Struct Template Reference

Abstract for the logarithmic splined function object, containing the table and critical constants for evaluating it. More...

#include <log_scale_spline.h>

Public Member Functions

 LogSplineTable (BasisFunctions basis_in, TableIndexing lookup_in, int detail_bits_in, int index_bound_in, uint sp_detail_mask_in, ullint dp_detail_mask_in, const float arg_offset_in, const T4 *table_in)
 As with other abstracts, the constructor takes a straight list of inputs for each member variable.
 
 LogSplineTable (const LogSplineTable &original)=default
 The const-ness of member variables implicitly deletes the copy and move assignment operators, but the default copy and move constructors are valid.
 
 LogSplineTable (LogSplineTable &&original)=default
 

Public Attributes

const BasisFunctions basis
 
const TableIndexing lookup
 
const int detail_bits
 
const int index_bound
 The maximum index of the table, for bounds checking.
 
const float arg_offset
 
const T4 * table
 The table of cubic spline coefficients.
 
const uint sp_detail_mask
 
const ullint dp_detail_mask
 

Detailed Description

template<typename T4>
struct stormm::energy::LogSplineTable< T4 >

Abstract for the logarithmic splined function object, containing the table and critical constants for evaluating it.

Member Data Documentation

◆ arg_offset

template<typename T4>
const float stormm::stmath::LogSplineTable< T4 >::arg_offset

The offset added to whatever argument (squared or unsquared value of the argument to the benchmark function) indexes into the table. Applied only if the indexing method is ARG_OFFSET or SQ_ARG_OFFSET. Represented as a float, as it must be a small power of two and thus entails no loss of information to represent it in the shorter format.

◆ basis

template<typename T4>
const BasisFunctions stormm::stmath::LogSplineTable< T4 >::basis

The type of basis functions f(x), g(x), h(x), and v(x) in the expression evaluated by the spline:

U(x) = A f(x) + B g(x) + C h(x) + D v(x)

◆ detail_bits

template<typename T4>
const int stormm::stmath::LogSplineTable< T4 >::detail_bits

The number of bits of the corresponding floating point format of the range argument. For a double4 LogSplineTable, the range argument is double and the number of detail bits (on any architecture STORMM is prepared for use on) should be 52 minus the number of mantissa bits used in the index. For float4 data and float range arguments, the number of index bits will be 23 minus the number of mantissa bits.

◆ lookup

template<typename T4>
const TableIndexing stormm::stmath::LogSplineTable< T4 >::lookup

The method of transforming the argument of the underlying benchmark function into a table index for selecting the correct spline

◆ sp_detail_mask

template<typename T4>
const uint stormm::stmath::LogSplineTable< T4 >::sp_detail_mask

The following detail masks guide the conversion of a range argument for the function of interest into an argument for polynomial basis functions. Both single- and double-precision forms of these masks must be included, as they cannot be cast to void (only pointers may be stripped of their templated characteristics). The detail masks are bitmasks with the lowest detail_bits set to one and all other bits set to zero. In effect, the range argument becomes divided into two parts, the high bits being an index and the low bits being the detail left over to submit to the interpolant's basis functions.

When the underlying LogScaleSpline object works on the BasisFunctions::POLYNOMIAL setting, the process is to take the range argument for the function of interest (e.g. the squared distance between two particles for computing the derivative of the Ewald direct space sum), mask off the final bits into an unsigned integer of equal size using the appropriate detail mask, shift these bits forward by the number of mantissa bits used to determine the table index (to put the remaining detail at the front of the mantissa, protecting it from roundoff error when computing the square or cube term), and replace the exponent bits with a mask indicating the range [1, 2). For IEEE float, the exponent bits are 0x3f800000 and for IEEE double the exponent bits are 0x3ff000000000000ULL (placing 127 and 1023 in the exponents of each number, respectively).


The documentation for this struct was generated from the following file: