#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    conjure_object::private::DeriveWith
)]
#[serde(crate = "conjure_object::serde")]
#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct CurveFitResult {
    #[serde(rename = "r2")]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    r2: f64,
    #[builder(custom(type = super::CurveResultDetails, convert = Box::new))]
    #[serde(rename = "curveResultDetails")]
    curve_result_details: Box<super::CurveResultDetails>,
}
impl CurveFitResult {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(r2: f64, curve_result_details: super::CurveResultDetails) -> Self {
        Self::builder().r2(r2).curve_result_details(curve_result_details).build()
    }
    /// R^2 (coefficient of determination) for the fit curve, a normalized measure of how well the curve fits the data.
    /// Usually ranges from 0 to 1, with higher indicating better fit (points closer to fit line).
    #[inline]
    pub fn r2(&self) -> f64 {
        self.r2
    }
    /// Description of the fit curve.
    #[inline]
    pub fn curve_result_details(&self) -> &super::CurveResultDetails {
        &*self.curve_result_details
    }
}
