pub struct Variable {
pub component: Vary,
pub perturbation: f64,
pub init_guess: f64,
pub max_step: f64,
pub max_value: f64,
pub min_value: f64,
pub frame: Option<Frame>,
}
Fields§
§component: Vary
The component that will be varied in the targeter
perturbation: f64
The perturbation for the finite differencing algorithm
init_guess: f64
The initial guess of this variable
max_step: f64
The maximum step this variable may have between each iteration
max_value: f64
The absolute maximum value this parameter can ever have
min_value: f64
The absolute minimum value this parameter can ever have
frame: Option<Frame>
The frame in which this variable should be applied, must be either a local frame or inertial
Implementations§
source§impl Variable
impl Variable
sourcepub fn valid(&self) -> Result<(), TargetingError>
pub fn valid(&self) -> Result<(), TargetingError>
Returns whether the configuration of this variable is valid
pub fn with_initial_guess(self, guess: f64) -> Self
pub fn with_pert(self, pert: f64) -> Self
pub fn with_min(self, min_val: f64) -> Self
pub fn with_max(self, max_val: f64) -> Self
sourcepub fn apply_bounds(&self, val: f64) -> f64
pub fn apply_bounds(&self, val: f64) -> f64
Ensure that val
is within the variable bounds
sourcepub fn ensure_bounds(&self, val: &mut f64)
pub fn ensure_bounds(&self, val: &mut f64)
Ensure that val
is within the variable bounds
sourcepub fn check_bounds(&self, val: f64) -> (f64, bool)
pub fn check_bounds(&self, val: f64) -> (f64, bool)
Returns the input value unless it is out of bounds, then it returns the bound, and whether the input value was OK
Trait Implementations§
impl Copy for Variable
impl StructuralPartialEq for Variable
Auto Trait Implementations§
impl Freeze for Variable
impl RefUnwindSafe for Variable
impl Send for Variable
impl Sync for Variable
impl Unpin for Variable
impl UnwindSafe for Variable
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.