pub trait IntoComputedShape<SolId, SInfo>: SolutionShape<SolId, SInfo>where
SolId: Id,
SInfo: SolInfo,
Self::SolObj: Uncomputed<SolId, Self::Obj, SInfo> + IntoComputed,
Self::SolOpt: Uncomputed<SolId, Self::Opt, SInfo> + IntoComputed,{
type Computed<Out: Outcome>: SolutionShape<SolId, SInfo, Obj = Self::Obj, Opt = Self::Opt, SolObj = Computed<Self::SolObj, SolId, Self::Obj, Out, SInfo>, SolOpt = Computed<Self::SolOpt, SolId, Self::Opt, Out, SInfo>> + HasY<Out> + Serialize + for<'a> Deserialize<'a> + Debug;
// Required methods
fn into_computed<Out: Outcome>(
self,
y: Arc<TypeCodom<Out>>,
) -> Self::Computed<Out>;
fn extract<Out: Outcome>(
comp: Self::Computed<Out>,
) -> (Self, Arc<TypeCodom<Out>>);
}Required Associated Types§
Sourcetype Computed<Out: Outcome>: SolutionShape<SolId, SInfo, Obj = Self::Obj, Opt = Self::Opt, SolObj = Computed<Self::SolObj, SolId, Self::Obj, Out, SInfo>, SolOpt = Computed<Self::SolOpt, SolId, Self::Opt, Out, SInfo>> + HasY<Out> + Serialize + for<'a> Deserialize<'a> + Debug
type Computed<Out: Outcome>: SolutionShape<SolId, SInfo, Obj = Self::Obj, Opt = Self::Opt, SolObj = Computed<Self::SolObj, SolId, Self::Obj, Out, SInfo>, SolOpt = Computed<Self::SolOpt, SolId, Self::Opt, Out, SInfo>> + HasY<Out> + Serialize + for<'a> Deserialize<'a> + Debug
The computed type wrapping Self with an objective value.
This type must implement HasY to provide access to the objective function output.
Required Methods§
Sourcefn into_computed<Out: Outcome>(
self,
y: Arc<TypeCodom<Out>>,
) -> Self::Computed<Out>
fn into_computed<Out: Outcome>( self, y: Arc<TypeCodom<Out>>, ) -> Self::Computed<Out>
Converts this uncomputed solution into a computed one with an objective value.
§Type Parameters
Cod- The [Codomain] defining the output structureOut- The outcome type from the objective function
§Parameters
y- The objective function output to associate with this solution
§Returns
A computed solution containing both self and y.
Sourcefn extract<Out: Outcome>(
comp: Self::Computed<Out>,
) -> (Self, Arc<TypeCodom<Out>>)
fn extract<Out: Outcome>( comp: Self::Computed<Out>, ) -> (Self, Arc<TypeCodom<Out>>)
Extracts the uncomputed solution and objective value from a computed solution.
This is the inverse operation of into_computed,
decomposing a computed solution back into its constituent parts.
§Type Parameters
Cod- The [Codomain] of the objective valueOut- TheOutcometype
§Parameters
comp- The computed solution to decompose
§Returns
A tuple of (uncomputed_solution, objective_value).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".