nominal_api_conjure/conjure/objects/scout/compute/api/
custom_curve_fit.rs1#[derive(
2 Debug,
3 Clone,
4 conjure_object::serde::Serialize,
5 conjure_object::serde::Deserialize,
6 conjure_object::private::DeriveWith
7)]
8#[serde(crate = "conjure_object::serde")]
9#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
10#[conjure_object::private::staged_builder::staged_builder]
11#[builder(crate = conjure_object::private::staged_builder, update, inline)]
12pub struct CustomCurveFit {
13 #[builder(custom(type = super::StringConstant, convert = Box::new))]
14 #[serde(rename = "formula")]
15 formula: Box<super::StringConstant>,
16 #[builder(
17 default,
18 map(key(type = super::LocalVariableName), value(type = super::CurveFitVariable))
19 )]
20 #[serde(
21 rename = "variables",
22 skip_serializing_if = "std::collections::BTreeMap::is_empty",
23 default
24 )]
25 variables: std::collections::BTreeMap<
26 super::LocalVariableName,
27 super::CurveFitVariable,
28 >,
29 #[builder(
30 default,
31 map(key(type = String, into), value(type = super::DoubleConstant))
32 )]
33 #[serde(
34 rename = "parameters",
35 skip_serializing_if = "std::collections::BTreeMap::is_empty",
36 default
37 )]
38 parameters: std::collections::BTreeMap<String, super::DoubleConstant>,
39}
40impl CustomCurveFit {
41 #[inline]
43 pub fn new(formula: super::StringConstant) -> Self {
44 Self::builder().formula(formula).build()
45 }
46 #[inline]
50 pub fn formula(&self) -> &super::StringConstant {
51 &*self.formula
52 }
53 #[inline]
55 pub fn variables(
56 &self,
57 ) -> &std::collections::BTreeMap<super::LocalVariableName, super::CurveFitVariable> {
58 &self.variables
59 }
60 #[inline]
65 pub fn parameters(
66 &self,
67 ) -> &std::collections::BTreeMap<String, super::DoubleConstant> {
68 &self.parameters
69 }
70}