ampsci
c++ program for high-precision atomic structure calculations of single-valence systems
Classes | Functions | Variables
AdamsMoulton Namespace Reference

Contains classes and functions which use general N-step Adams Moulton method to solve systems of 2x2 ODEs, up to N=12. More...

Classes

struct  DerivativeMatrix
 Pure-virtual struct, holds the derivative matrix for 2x2 system of ODEs. Derive from this, and implement a(t),b(t),c(t),d(t) to define the 2x2 ODE. More...
 
struct  AM_Coefs
 Holds the K+1 Adams-Moulton ak coefficients for the K-step AM method. Final one, aK, is stored separately. More...
 
class  ODESolver2D
 Solves a 2D system of ODEs using a K-step Adams-Moulton method. More...
 

Functions

template<typename T , typename U , std::size_t N, std::size_t M>
constexpr T inner_product (const std::array< T, N > &a, const std::array< U, M > &b)
 Inner product of two std::arrays. More...
 

Variables

template<typename T >
constexpr bool is_complex_v = is_complex<T>::value
 User-defined type-trait: Checks whether T is a std::complex type. More...
 

Detailed Description

Contains classes and functions which use general N-step Adams Moulton method to solve systems of 2x2 ODEs, up to N=12.

Function Documentation

◆ inner_product()

template<typename T , typename U , std::size_t N, std::size_t M>
constexpr T AdamsMoulton::inner_product ( const std::array< T, N > &  a,
const std::array< U, M > &  b 
)
constexpr

Inner product of two std::arrays.

\[ inner_product(a, b) = \sum_{i=0}^{N-1} a_i * b_i \]

Where N = min(a.size(), b.size()). The types of the arrays may be different (T and U). However, U must be convertable to T; the return-type is T (same as first array).

Variable Documentation

◆ is_complex_v

template<typename T >
constexpr bool AdamsMoulton::is_complex_v = is_complex<T>::value
constexpr

User-defined type-trait: Checks whether T is a std::complex type.

For example: static_assert(!is_complex_v<double>); static_assert(!is_complex_v<float>); static_assert(is_complex_v<std::complex<double>>); static_assert(is_complex_v<std::complex<float>>); static_assert(is_complex<std::complex<float>>::value);