pub struct ResolvedNcsFactors { /* private fields */ }Expand description
Pre-resolved per-block NCS generation scaling factors.
Provides O(1) lookup of the generation factor by (ncs_index, stage_index, block_index). Returns 1.0 for absent entries (no scaling). Populated
by cobre-io during the resolution step and stored in crate::System.
Uses dense 3D storage (n_ncs * n_stages * max_blocks) initialized to
1.0. The total size is small (typically < 10K entries) and the lookup is
on the LP-building hot path.
§Examples
use cobre_core::resolved::ResolvedNcsFactors;
let empty = ResolvedNcsFactors::empty();
assert!((empty.factor(0, 0, 0) - 1.0).abs() < f64::EPSILON);Implementations§
Source§impl ResolvedNcsFactors
impl ResolvedNcsFactors
Sourcepub fn empty() -> Self
pub fn empty() -> Self
Create an empty NCS factors table. All lookups return 1.0.
Used as the default when no non_controllable_factors.json exists.
§Examples
use cobre_core::resolved::ResolvedNcsFactors;
let t = ResolvedNcsFactors::empty();
assert!((t.factor(5, 3, 2) - 1.0).abs() < f64::EPSILON);Sourcepub fn new(n_ncs: usize, n_stages: usize, max_blocks: usize) -> Self
pub fn new(n_ncs: usize, n_stages: usize, max_blocks: usize) -> Self
Create a new NCS factors table with the given dimensions.
All entries are initialized to 1.0 (no scaling). Use set to
populate individual entries.
Trait Implementations§
Source§impl Clone for ResolvedNcsFactors
impl Clone for ResolvedNcsFactors
Source§fn clone(&self) -> ResolvedNcsFactors
fn clone(&self) -> ResolvedNcsFactors
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResolvedNcsFactors
impl Debug for ResolvedNcsFactors
Source§impl PartialEq for ResolvedNcsFactors
impl PartialEq for ResolvedNcsFactors
impl StructuralPartialEq for ResolvedNcsFactors
Auto Trait Implementations§
impl Freeze for ResolvedNcsFactors
impl RefUnwindSafe for ResolvedNcsFactors
impl Send for ResolvedNcsFactors
impl Sync for ResolvedNcsFactors
impl Unpin for ResolvedNcsFactors
impl UnsafeUnpin for ResolvedNcsFactors
impl UnwindSafe for ResolvedNcsFactors
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
Mutably borrows from an owned value. Read more