pub struct ConstraintTransform { /* private fields */ }Expand description
Validated ordered mapping between free solver coordinates and all values.
Implementations§
Source§impl ConstraintTransform
impl ConstraintTransform
Sourcepub fn new(
parameters: ParameterSet,
constraints: Vec<Constraint>,
) -> Result<Self, ConstraintError>
pub fn new( parameters: ParameterSet, constraints: Vec<Constraint>, ) -> Result<Self, ConstraintError>
Validate target ownership, uniqueness, source ownership, and dependency order.
§Errors
Returns ConstraintError for unknown keys, duplicate targets, or a
source that is not already resolved (including cycles).
Sourcepub const fn parameters(&self) -> &ParameterSet
pub const fn parameters(&self) -> &ParameterSet
Borrow the validated parameter set.
Sourcepub fn constraints(&self) -> &[Constraint]
pub fn constraints(&self) -> &[Constraint]
Borrow constraints in required dependency order.
Sourcepub fn free_keys(&self) -> &[ParameterKey]
pub fn free_keys(&self) -> &[ParameterKey]
Borrow free identities in stable packing order.
Sourcepub fn pack(&self) -> Result<Vec<f64>, ConstraintError>
pub fn pack(&self) -> Result<Vec<f64>, ConstraintError>
Pack current physical values into scaled free solver coordinates.
§Errors
Returns ConstraintError if a stored value unexpectedly becomes
non-finite.
Sourcepub fn pack_values(
&self,
values: &BTreeMap<ParameterKey, f64>,
) -> Result<Vec<f64>, ConstraintError>
pub fn pack_values( &self, values: &BTreeMap<ParameterKey, f64>, ) -> Result<Vec<f64>, ConstraintError>
Pack caller-supplied physical values into scaled free coordinates.
§Errors
Returns ConstraintError for a missing or non-finite free value.
Sourcepub fn unpack(
&self,
vector: &[f64],
clip: bool,
) -> Result<BTreeMap<ParameterKey, f64>, ConstraintError>
pub fn unpack( &self, vector: &[f64], clip: bool, ) -> Result<BTreeMap<ParameterKey, f64>, ConstraintError>
Expand scaled free coordinates into all bounded physical values.
When clip is true, free physical values are projected to their bounds
before constraints are evaluated. Constraint results are never clipped.
§Errors
Returns ConstraintError for shape, finiteness, or final-bound failures.
Sourcepub fn derivative_matrix(
&self,
) -> Result<ConstraintDerivativeMatrix, ConstraintError>
pub fn derivative_matrix( &self, ) -> Result<ConstraintDerivativeMatrix, ConstraintError>
Build the exact row-major physical-to-scaled-free derivative matrix.
§Errors
Returns ConstraintError::MatrixSizeOverflow if the matrix element
count cannot be represented, or ConstraintError::InternalInvariant
if validated transform state is unexpectedly inconsistent.
Trait Implementations§
Source§impl Clone for ConstraintTransform
impl Clone for ConstraintTransform
Source§fn clone(&self) -> ConstraintTransform
fn clone(&self) -> ConstraintTransform
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 ConstraintTransform
impl Debug for ConstraintTransform
Source§impl PartialEq for ConstraintTransform
impl PartialEq for ConstraintTransform
impl StructuralPartialEq for ConstraintTransform
Auto Trait Implementations§
impl Freeze for ConstraintTransform
impl RefUnwindSafe for ConstraintTransform
impl Send for ConstraintTransform
impl Sync for ConstraintTransform
impl Unpin for ConstraintTransform
impl UnsafeUnpin for ConstraintTransform
impl UnwindSafe for ConstraintTransform
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.