pub struct SolutionBuilder { /* private fields */ }Expand description
Implementations§
Source§impl SolutionBuilder
impl SolutionBuilder
Sourcepub fn evaluated_constraints(
self,
evaluated_constraints: BTreeMap<ConstraintID, EvaluatedConstraint>,
) -> Self
pub fn evaluated_constraints( self, evaluated_constraints: BTreeMap<ConstraintID, EvaluatedConstraint>, ) -> Self
Sets the evaluated constraints.
Sourcepub fn evaluated_constraints_collection(
self,
evaluated_constraints: EvaluatedCollection<Constraint>,
) -> Self
pub fn evaluated_constraints_collection( self, evaluated_constraints: EvaluatedCollection<Constraint>, ) -> Self
Sets the evaluated constraints from a collection.
Sourcepub fn evaluated_indicator_constraints_collection(
self,
evaluated_indicator_constraints: EvaluatedCollection<IndicatorConstraint>,
) -> Self
pub fn evaluated_indicator_constraints_collection( self, evaluated_indicator_constraints: EvaluatedCollection<IndicatorConstraint>, ) -> Self
Sets the evaluated indicator constraints from a collection.
Sourcepub fn evaluated_indicator_constraints(
self,
evaluated_indicator_constraints: BTreeMap<IndicatorConstraintID, EvaluatedIndicatorConstraint>,
) -> Self
pub fn evaluated_indicator_constraints( self, evaluated_indicator_constraints: BTreeMap<IndicatorConstraintID, EvaluatedIndicatorConstraint>, ) -> Self
Sets the evaluated indicator constraints.
Sourcepub fn evaluated_one_hot_constraints_collection(
self,
evaluated_one_hot_constraints: EvaluatedCollection<OneHotConstraint>,
) -> Self
pub fn evaluated_one_hot_constraints_collection( self, evaluated_one_hot_constraints: EvaluatedCollection<OneHotConstraint>, ) -> Self
Sets the evaluated one-hot constraints from a collection.
Sourcepub fn evaluated_sos1_constraints_collection(
self,
evaluated_sos1_constraints: EvaluatedCollection<Sos1Constraint>,
) -> Self
pub fn evaluated_sos1_constraints_collection( self, evaluated_sos1_constraints: EvaluatedCollection<Sos1Constraint>, ) -> Self
Sets the evaluated SOS1 constraints from a collection.
Sourcepub fn evaluated_named_functions(
self,
evaluated_named_functions: BTreeMap<NamedFunctionID, EvaluatedNamedFunction>,
) -> Self
pub fn evaluated_named_functions( self, evaluated_named_functions: BTreeMap<NamedFunctionID, EvaluatedNamedFunction>, ) -> Self
Sets the evaluated named functions.
Sourcepub fn decision_variables(
self,
decision_variables: BTreeMap<VariableID, EvaluatedDecisionVariable>,
) -> Self
pub fn decision_variables( self, decision_variables: BTreeMap<VariableID, EvaluatedDecisionVariable>, ) -> Self
Sets the decision variables.
Sourcepub fn variable_labels(self, variable_labels: VariableLabelStore) -> Self
pub fn variable_labels(self, variable_labels: VariableLabelStore) -> Self
Sets the per-variable modeling-label store.
Sourcepub fn named_function_labels(
self,
named_function_labels: NamedFunctionLabelStore,
) -> Self
pub fn named_function_labels( self, named_function_labels: NamedFunctionLabelStore, ) -> Self
Sets the per-named-function modeling-label store.
Sourcepub fn feasibility_atol(self, feasibility_atol: ATol) -> Self
pub fn feasibility_atol(self, feasibility_atol: ATol) -> Self
Sets the absolute tolerance used to compute and validate feasibility fields.
Sourcepub fn optimality(self, optimality: Optimality) -> Self
pub fn optimality(self, optimality: Optimality) -> Self
Sets the optimality status.
Sourcepub fn relaxation(self, relaxation: Relaxation) -> Self
pub fn relaxation(self, relaxation: Relaxation) -> Self
Sets the relaxation status.
Sourcepub fn build(self) -> Result<Solution>
pub fn build(self) -> Result<Solution>
Builds the Solution with full validation.
§Errors
Returns an error if:
- Required fields (
objective,evaluated_constraints,decision_variables,sense) are not set - Constraint collection sidecars contain invalid keys
- Named-function labels reference IDs not present in the evaluated named-function table
- Variables referenced in constraints’ or named functions’
used_decision_variable_idsare not indecision_variables
Sourcepub unsafe fn build_unchecked(self) -> Result<Solution>
pub unsafe fn build_unchecked(self) -> Result<Solution>
Builds the Solution without host-level revalidation.
§Safety
This method still constructs table owners through their checked constructors, so table-level invariants such as label IDs referring to existing table rows are enforced. It does not revalidate host-level cross references. The caller must ensure:
decision_variablesis keyed by the intendedVariableIDfor each row- All
used_decision_variable_idsin constraints and evaluated named functions exist indecision_variables - Special-constraint
indicator_active,active_variable, and per-constraintfeasiblefields are consistent withdecision_variablesunderfeasibility_atol
Use Self::build for validated construction.
This method is useful when invariants are guaranteed by construction,
such as when creating a Solution from Instance::evaluate.
§Errors
Returns an error if required fields are not set or table-level sidecar invariants fail.
Trait Implementations§
Source§impl Clone for SolutionBuilder
impl Clone for SolutionBuilder
Source§fn clone(&self) -> SolutionBuilder
fn clone(&self) -> SolutionBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SolutionBuilder
impl Debug for SolutionBuilder
Source§impl Default for SolutionBuilder
impl Default for SolutionBuilder
Source§fn default() -> SolutionBuilder
fn default() -> SolutionBuilder
Auto Trait Implementations§
impl Freeze for SolutionBuilder
impl RefUnwindSafe for SolutionBuilder
impl Send for SolutionBuilder
impl Sync for SolutionBuilder
impl Unpin for SolutionBuilder
impl UnsafeUnpin for SolutionBuilder
impl UnwindSafe for SolutionBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more