Loading...
Searching...
No Matches
gpr::derivatives::generated Namespace Reference

Classes

struct  RadialTerms

Functions

template<typename Real>
RadialTerms< Real > squaredExponentialTerms (const Real &s, const Real &energy_weight, const Real &gradient_residual_dot)
template<typename Real>
RadialTerms< Real > matern32Terms (const Real &s, const Real &energy_weight, const Real &gradient_residual_dot)
template<typename Real>
RadialTerms< Real > matern52Terms (const Real &s, const Real &energy_weight, const Real &gradient_residual_dot)

Variables

constexpr double kSqrt3 = 1.7320508075688772935274463415059
constexpr double kSqrt5 = 2.2360679774997896964091736687313
constexpr int kSquaredExponentialCountOps = 11
constexpr int kMatern32CountOps = 26
constexpr int kMatern52CountOps = 32

Function Documentation

◆ matern32Terms()

template<typename Real>
RadialTerms< Real > gpr::derivatives::generated::matern32Terms ( const Real & s,
const Real & energy_weight,
const Real & gradient_residual_dot )

Matern32: phi(s) = (sqrt(3)*sqrt(s) + 1)*exp(-sqrt(3)*sqrt(s)). sympy.count_ops after cse: 26.

Definition at line 60 of file RadialKernelJets.h.

63{
64 using std::exp;
65 using std::sqrt;
67 const Real rho = sqrt(s);
68 const Real t0 = kSqrt3*rho;
69 const Real t1 = exp(-t0);
70 const Real t2 = 3.0*gradient_residual_dot;
71 const Real t3 = (1.0/(rho));
72 const Real t4 = gradient_residual_dot*kSqrt3;
73 const Real t5 = 3.0*t1;
74 const Real t6 = t3*t5;
75 out.value = t1*(energy_weight*t0 + energy_weight + t2);
76 out.gradient_residual = -t5*(energy_weight + t3*t4);
77 out.gradient_weight = t5;
78 out.hessian_residual = t6*(energy_weight*kSqrt3 + t2*t3 + t4/(rho*rho));
79 out.hessian_cross = -kSqrt3*t6;
80 return out;
81}
eon_relax_band_t eon_relax_surface_fn void eon_relax_outcome_t * out

◆ matern52Terms()

template<typename Real>
RadialTerms< Real > gpr::derivatives::generated::matern52Terms ( const Real & s,
const Real & energy_weight,
const Real & gradient_residual_dot )

Matern52: phi(s) = (sqrt(5)*sqrt(s) + 5*s/3 + 1)*exp(-sqrt(5)*sqrt(s)). sympy.count_ops after cse: 32.

Definition at line 86 of file RadialKernelJets.h.

89{
90 using std::exp;
91 using std::sqrt;
93 const Real rho = sqrt(s);
94 const Real t0 = kSqrt5*rho;
95 const Real t1 = exp(-t0);
96 const Real t2 = ((5.0/3.0))*gradient_residual_dot;
97 const Real t3 = energy_weight*t0 + energy_weight;
98 const Real t4 = ((5.0/3.0))*t1;
99 const Real t5 = ((25.0/3.0))*t1;
100 out.value = t1*(((5.0/3.0))*energy_weight*(rho*rho) + t0*t2 + t2 + t3);
101 out.gradient_residual = -t4*(5.0*gradient_residual_dot + t3);
102 out.gradient_weight = t4*(t0 + 1.0);
103 out.hessian_residual = t5*(energy_weight + gradient_residual_dot*kSqrt5/rho);
104 out.hessian_cross = -t5;
105 return out;
106}

◆ squaredExponentialTerms()

template<typename Real>
RadialTerms< Real > gpr::derivatives::generated::squaredExponentialTerms ( const Real & s,
const Real & energy_weight,
const Real & gradient_residual_dot )

SquaredExponential: phi(s) = exp(-s). sympy.count_ops after cse: 11.

Definition at line 40 of file RadialKernelJets.h.

43{
44 using std::exp;
45 using std::sqrt;
47 const Real t0 = exp(-s);
48 const Real t1 = t0*(energy_weight + 2.0*gradient_residual_dot);
49 out.value = t1;
50 out.gradient_residual = -2.0*t1;
51 out.gradient_weight = 2.0*t0;
52 out.hessian_residual = 4.0*t1;
53 out.hessian_cross = -4.0*t0;
54 return out;
55}

Variable Documentation

◆ kMatern32CountOps

int gpr::derivatives::generated::kMatern32CountOps = 26
inlineconstexpr

Definition at line 34 of file RadialKernelJets.h.

◆ kMatern52CountOps

int gpr::derivatives::generated::kMatern52CountOps = 32
inlineconstexpr

Definition at line 35 of file RadialKernelJets.h.

◆ kSqrt3

double gpr::derivatives::generated::kSqrt3 = 1.7320508075688772935274463415059
inlineconstexpr

Definition at line 17 of file RadialKernelJets.h.

◆ kSqrt5

double gpr::derivatives::generated::kSqrt5 = 2.2360679774997896964091736687313
inlineconstexpr

Definition at line 18 of file RadialKernelJets.h.

◆ kSquaredExponentialCountOps

int gpr::derivatives::generated::kSquaredExponentialCountOps = 11
inlineconstexpr

Definition at line 33 of file RadialKernelJets.h.