use crate::DType;
use super::GlobalOptions;
use numr::error::Result;
use numr::runtime::Runtime;
use numr::tensor::Tensor;
#[derive(Debug, Clone)]
pub struct ShgoResult<R: Runtime<DType = DType>> {
pub x: Tensor<R>,
pub fun: f64,
pub local_minima: Vec<(Tensor<R>, f64)>,
pub nfev: usize,
pub converged: bool,
}
pub trait ShgoAlgorithms<R: Runtime<DType = DType>> {
fn shgo<F>(
&self,
f: F,
lower_bounds: &Tensor<R>,
upper_bounds: &Tensor<R>,
options: &GlobalOptions,
) -> Result<ShgoResult<R>>
where
F: Fn(&Tensor<R>) -> Result<f64>;
}