Skip to content
Snippets Groups Projects
Commit 433217f8 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

ENH,RF: Implement clamped extrapolation boundary condition for coefficient initialisation

parent 197f9d63
No related branches found
No related tags found
1 merge request!17ENH: Allow `Splinterpolator` instances to be created from an existing set of spline coefficients, and extend extrapolation options
......@@ -1643,11 +1643,17 @@ double Splinterpolator<T>::SplineColumn::init_fwd_sweep(double z, ExtrapolationT
double z2i=z;
for (unsigned int i=1; i<n; i++, ptr--, z2i*=z) iv += z2i * *ptr;
}
else {
else if (et == Mirror) {
double *ptr=&_col[1];
double z2i=z;
for (unsigned int i=1; i<n; i++, ptr++, z2i*=z) iv += z2i * *ptr;
}
// et == Constant || et == Zeros
else {
double *ptr=&_col[0];
double z2i=z;
for (unsigned int i=0; i<n; i++, ptr++, z2i*=z) iv += z2i * *ptr;
}
return(iv);
}
......@@ -1674,9 +1680,14 @@ double Splinterpolator<T>::SplineColumn::init_bwd_sweep(double z, double lv, Ext
}
iv /= (z2i-1.0);
}
else {
else if (et == Mirror) {
iv = -z/(1.0-z*z) * (2.0*_col[_sz-1] - lv);
}
// et == Constant || et == Zeros
else {
iv = z / (z - 1) * _col[_sz-1];
}
return(iv);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment