#include <gpr/ml/gp/DerivativeSKI.h>
|
| | UniformGrid (double lo, double hi, Eigen::Index m) |
| Eigen::Index | size () const noexcept |
| double | spacing () const noexcept |
| double | at (Eigen::Index i) const noexcept |
| double | indexOf (double x) const noexcept |
| | Grid coordinate of x in index units.
|
Uniform grid of m points spanning [lo, hi] with two cells of padding, so every interior input keeps its full four-point stencil.
Definition at line 54 of file DerivativeSKI.h.
◆ UniformGrid()
| gpr::ski::UniformGrid::UniformGrid |
( |
double | lo, |
|
|
double | hi, |
|
|
Eigen::Index | m ) |
Definition at line 54 of file DerivativeSKI.cpp.
55{
56 if (m < 4) throw std::invalid_argument("SKI grid needs at least 4 points");
57 if (!(hi >= lo)) throw std::invalid_argument("SKI grid bounds inverted");
58 m_ = m;
59
60
61
62
63 const double span = hi - lo;
64 const Eigen::Index steps = m - 5;
65 if (span > 0.0 && steps == 0) {
66 throw std::invalid_argument(
67 "SKI grid needs an interior interval to span a positive range");
68 }
69 h_ = (span > 0.0) ? span / static_cast<double>(steps) : 1.0;
70 origin_ = lo - 2.0 * h_;
71}
◆ at()
| double gpr::ski::UniformGrid::at |
( |
Eigen::Index | i | ) |
const |
|
inlinenodiscardnoexcept |
Definition at line 66 of file DerivativeSKI.h.
67 {
68 return origin_ + static_cast<double>(i) * h_;
69 }
◆ indexOf()
| double gpr::ski::UniformGrid::indexOf |
( |
double | x | ) |
const |
|
inlinenodiscardnoexcept |
Grid coordinate of x in index units.
Definition at line 71 of file DerivativeSKI.h.
72 {
73 return (
x - origin_) / h_;
74 }
◆ size()
| Eigen::Index gpr::ski::UniformGrid::size |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
◆ spacing()
| double gpr::ski::UniformGrid::spacing |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
The documentation for this class was generated from the following files: