pub mod cubic;
pub mod gpu_config;
pub mod linear;
pub mod plot;
pub mod polynomial;
pub mod quadratic;
pub mod regression;
#[cfg(test)]
pub use plot::plot::plot_terminal;
#[cfg(test)]
pub fn gpu_available_or_skip(test: &str) -> bool {
match crate::gpu::types::GpuInterpolator::supports_f64_static() {
Ok(_) => true,
Err(e) if std::env::var_os("SPLIMES_REQUIRE_GPU").is_some() => panic!("{test}: SPLIMES_REQUIRE_GPU is set but no GPU adapter is available: {e:#}"),
Err(e) => {
eprintln!("{test}: skipped, no GPU adapter ({e:#}); set SPLIMES_REQUIRE_GPU=1 to make this a failure");
false
}
}
}