pub enum HardConstraint {
Outside {
a: String,
b: String,
clash_dist: f64,
lagrangian: u8,
},
Inside {
a: String,
b: String,
pad: f64,
lagrangian: u8,
},
MaxDist {
a: String,
b: String,
dist: f64,
lagrangian: u8,
},
ParallelClear {
a: String,
b: String,
clash_dist: f64,
lagrangian: u8,
},
}Expand description
Inequality constraints g(x) ≤ 0 enforced via augmented Lagrangian.
Soft Constraint hinges can leave residual overlap when PreferPose /
PreferSide fight them. Hard rows here get Powell–Hestenes–Rockafellar
multipliers so clearance, tether, and contain converge to feasibility.
The lagrangian field groups rows: lower is stronger —
[LAGRANGIAN_CLEAR], then [LAGRANGIAN_TETHER], then [LAGRANGIAN_CONTAIN].
Variants§
Outside
Require edge_signed(a,b) ≥ clash_dist (g = clash_dist - d).
Fields
Inside
Require a inside b by at least pad (g = protrusion / shallow depth).
Kits put this on [LAGRANGIAN_CONTAIN] so snug / keep-off / tether can
finish first; a shared PHR with PreferPose used to pin inside labels.
MaxDist
Require edge_signed(a,b) ≤ dist (g = d - dist). Overlap (d < 0) is fine.
This is a closest-point tether: some part of a must lie within
dist of b (the far side of a long label may stick out). Atom labels
use it so bond-clear AL cannot fling the label across the molecule.
ParallelClear
Nearly-parallel overlapping segments must stay clash_dist apart
(g = clash - d_perp). Transverse crossings do not activate.
Trait Implementations§
Source§impl Clone for HardConstraint
impl Clone for HardConstraint
Source§fn clone(&self) -> HardConstraint
fn clone(&self) -> HardConstraint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for HardConstraint
impl RefUnwindSafe for HardConstraint
impl Send for HardConstraint
impl Sync for HardConstraint
impl Unpin for HardConstraint
impl UnsafeUnpin for HardConstraint
impl UnwindSafe for HardConstraint
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 more