mod chebyshev;
mod hermite;
mod lagrange;
pub use chebyshev::{chebyshev_eval, chebyshev_eval_poly};
pub use hermite::hermite_eval;
use hifitime::Epoch;
pub use lagrange::lagrange_eval;
use snafu::Snafu;
use crate::errors::{DecodingError, MathError};
pub(crate) const MAX_SAMPLES: usize = 32;
#[derive(Copy, Clone, Debug, Snafu, PartialEq)]
#[snafu(visibility(pub(crate)))]
#[non_exhaustive]
pub enum InterpolationError {
#[snafu(display("decoding error during interpolation: {source}"))]
InterpDecoding {
#[snafu(backtrace)]
source: DecodingError,
},
#[snafu(display("math error during interpolation: {source}"))]
InterpMath {
#[snafu(backtrace)]
source: MathError,
},
#[snafu(display("spline valid from {start} to {end} but requested {req}"))]
NoInterpolationData {
req: Epoch,
start: Epoch,
end: Epoch,
},
#[snafu(display("no interpolation data to {epoch}, but prior checks succeeded (check integrity of the data?)"))]
MissingInterpolationData { epoch: Epoch },
#[snafu(display("interpolation data corrupted: {what}"))]
CorruptedData { what: &'static str },
#[snafu(display("{op} is unsupported for {kind}"))]
UnsupportedOperation {
kind: &'static str,
op: &'static str,
},
#[snafu(display(
"{dataset} is not yet supported -- https://github.com/nyx-space/anise/issues/{issue}"
))]
UnimplementedType { issue: u32, dataset: &'static str },
#[snafu(display("no interpolation data in this ephemeris"))]
EmptyInterpolationData {},
}