#[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 CustomCurveFit {
#[builder(custom(type = super::StringConstant, convert = Box::new))]
#[serde(rename = "formula")]
formula: Box<super::StringConstant>,
#[builder(
default,
map(key(type = super::LocalVariableName), value(type = super::CurveFitVariable))
)]
#[serde(
rename = "variables",
skip_serializing_if = "std::collections::BTreeMap::is_empty",
default
)]
variables: std::collections::BTreeMap<
super::LocalVariableName,
super::CurveFitVariable,
>,
#[builder(
default,
map(key(type = String, into), value(type = super::DoubleConstant))
)]
#[serde(
rename = "parameters",
skip_serializing_if = "std::collections::BTreeMap::is_empty",
default
)]
parameters: std::collections::BTreeMap<String, super::DoubleConstant>,
}
impl CustomCurveFit {
#[inline]
pub fn new(formula: super::StringConstant) -> Self {
Self::builder().formula(formula).build()
}
#[inline]
pub fn formula(&self) -> &super::StringConstant {
&*self.formula
}
#[inline]
pub fn variables(
&self,
) -> &std::collections::BTreeMap<super::LocalVariableName, super::CurveFitVariable> {
&self.variables
}
#[inline]
pub fn parameters(
&self,
) -> &std::collections::BTreeMap<String, super::DoubleConstant> {
&self.parameters
}
}