Skip to main content

Uncomputed

Trait Uncomputed 

Source
pub trait Uncomputed<SolId, Dom, SInfo>
where Self: Solution<SolId, Dom, SInfo> + IntoComputed, SolId: Id, Dom: Domain, SInfo: SolInfo,
{ type TwinUC<B: Domain>: Uncomputed<SolId, B, SInfo, Twin<Dom> = Self, TwinUC<Dom> = Self>; // Required methods fn twin<B: Domain>( &self, x: <Self::TwinUC<B> as Solution<SolId, B, SInfo>>::Raw, ) -> Self::TwinUC<B>; fn new<T>(id: SolId, x: T, info: Arc<SInfo>) -> Self where T: Into<Self::Raw>; fn default(info: Arc<SInfo>, size: usize) -> Self; fn default_vec(info: Arc<SInfo>, size: usize, vsize: usize) -> Vec<Self>; }
Expand description

Trait for solutions that have not yet been evaluated.

Uncomputed represents solutions generated by sampling or optimization but not yet evaluated by the objective function. These solutions can be converted to Computed solutions via the IntoComputed trait and a TypeCodom.

§Type Parameters

  • SolId - The unique identifier type
  • Dom - The domain defining variable types and constraints
  • SInfo - The solution metadata type

§Lifecycle

       Uncomputed --[evaluate]-> Computed
             ^                       |
             |                       |
TypeCodom <--+------[extract]--------+

§Builder methods

Uncomputed provides multiple ways to create solutions:

  • new - From explicit values
  • default - Placeholder with zero/default values
  • default_vec - Batch of placeholders

Required Associated Types§

Source

type TwinUC<B: Domain>: Uncomputed<SolId, B, SInfo, Twin<Dom> = Self, TwinUC<Dom> = Self>

The uncomputed twin type in an alternative domain.

Unlike Twin, this always produces an Uncomputed solution, preserving the uncomputed status across domain transformations.

Required Methods§

Source

fn twin<B: Domain>( &self, x: <Self::TwinUC<B> as Solution<SolId, B, SInfo>>::Raw, ) -> Self::TwinUC<B>

Creates an uncomputed twin solution in a different domain.

§Type Parameters
  • B - The target domain
§Parameters
  • x - Variable values in the target domain
§Returns

An uncomputed solution in domain B with the same Id as self.

Source

fn new<T>(id: SolId, x: T, info: Arc<SInfo>) -> Self
where T: Into<Self::Raw>,

Creates a new uncomputed solution with specified values.

§Parameters
  • id - Unique identifier for this solution
  • x - Variable values (convertible to Raw)
  • info - Solution metadata
§Returns

A new uncomputed solution.

Source

fn default(info: Arc<SInfo>, size: usize) -> Self

Creates a placeholder uncomputed solution with default/zero values.

Useful for initializing data structures before filling them with actual solutions.

§Parameters
  • info - Solution metadata
  • size - Number of variables (dimension)
§Returns

An uncomputed solution with default values.

Source

fn default_vec(info: Arc<SInfo>, size: usize, vsize: usize) -> Vec<Self>

Creates a vector of placeholder uncomputed solutions.

Batch version of default for initializing collections.

§Parameters
  • info - Shared solution metadata
  • size - Number of variables per solution (dimension)
  • vsize - Number of solutions to create
§Returns

A vector of vsize uncomputed solutions, each with size default values.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<SolId, Dom, Info> Uncomputed<SolId, Dom, Info> for BaseSol<SolId, Dom, Info>
where Dom: Domain, Info: SolInfo, SolId: Id,

Source§

type TwinUC<B: Domain> = BaseSol<SolId, B, Info>

Source§

impl<SolId, Dom, Info> Uncomputed<SolId, Dom, Info> for FidelitySol<SolId, Dom, Info>
where Dom: Domain, Info: SolInfo, SolId: StepId,

Source§

type TwinUC<B: Domain> = FidelitySol<SolId, B, Info>