Struct fastsim_core::cycle::RustCycleCache
source · pub struct RustCycleCache {
pub grade_all_zero: bool,
pub trapz_step_distances_m: Array1<f64>,
pub trapz_distances_m: Array1<f64>,
pub trapz_elevations_m: Array1<f64>,
pub stops: Array1<bool>,
/* private fields */
}Fields§
§grade_all_zero: bool§trapz_step_distances_m: Array1<f64>§trapz_distances_m: Array1<f64>§trapz_elevations_m: Array1<f64>§stops: Array1<bool>Implementations§
source§impl RustCycleCache
impl RustCycleCache
pub fn new(cyc: &RustCycle) -> Self
sourcepub fn interp_grade(&self, dist_m: f64) -> f64
pub fn interp_grade(&self, dist_m: f64) -> f64
Interpolate the single-point grade at the given distance. Assumes that the grade at i applies from sample point (i-1, i]
sourcepub fn interp_elevation(&self, dist_m: f64) -> f64
pub fn interp_elevation(&self, dist_m: f64) -> f64
Interpolate the elevation at the given distance
Trait Implementations§
source§impl Clone for RustCycleCache
impl Clone for RustCycleCache
source§fn clone(&self) -> RustCycleCache
fn clone(&self) -> RustCycleCache
Returns a copy 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 RustCycleCache
impl Debug for RustCycleCache
source§impl Default for RustCycleCache
impl Default for RustCycleCache
source§fn default() -> RustCycleCache
fn default() -> RustCycleCache
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for RustCycleCache
impl<'de> Deserialize<'de> for RustCycleCache
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<RustCycleCache> for RustCycleCache
impl PartialEq<RustCycleCache> for RustCycleCache
source§fn eq(&self, other: &RustCycleCache) -> bool
fn eq(&self, other: &RustCycleCache) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl SerdeAPI for RustCycleCache
impl SerdeAPI for RustCycleCache
source§fn to_file(&self, filename: &str) -> Result<(), Error>
fn to_file(&self, filename: &str) -> Result<(), Error>
Save current data structure to file. Method adaptively calls serialization methods
dependent on the suffix of the file given as str. Read more
source§fn from_file(filename: &str) -> Result<Self, Error>where
for<'de> Self: Sized + Deserialize<'de>,
fn from_file(filename: &str) -> Result<Self, Error>where for<'de> Self: Sized + Deserialize<'de>,
Read from file and return instantiated struct. Method adaptively calls deserialization
methods dependent on the suffix of the file name given as str.
Function returns a dynamic Error Result if it fails. Read more
source§fn to_bincode(&self) -> Vec<u8>
fn to_bincode(&self) -> Vec<u8>
bincode serialization method.
source§impl Serialize for RustCycleCache
impl Serialize for RustCycleCache
impl StructuralPartialEq for RustCycleCache
Auto Trait Implementations§
impl RefUnwindSafe for RustCycleCache
impl Send for RustCycleCache
impl Sync for RustCycleCache
impl Unpin for RustCycleCache
impl UnwindSafe for RustCycleCache
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