pub struct GtspInstance {
pub clusters: Vec<GtspCluster>,
pub distances: Vec<Vec<f64>>,
pub home_distances: Vec<f64>,
pub cluster_offsets: Vec<usize>,
pub total_candidates: usize,
}Expand description
A complete GTSP instance with distance matrix.
Fields§
§clusters: Vec<GtspCluster>Clusters (one per contour).
distances: Vec<Vec<f64>>Asymmetric distance matrix between all candidates.
distances[i][j] = rapid distance from end_point of global candidate i
to pierce point of global candidate j.
Intra-cluster distances are set to f64::MAX (invalid transitions).
home_distances: Vec<f64>Distance from home position to each candidate’s pierce point.
cluster_offsets: Vec<usize>Cumulative offset for each cluster in the global index.
total_candidates: usizeTotal number of candidates across all clusters.
Implementations§
Source§impl GtspInstance
impl GtspInstance
Sourcepub fn global_to_local(&self, global_idx: usize) -> (usize, usize)
pub fn global_to_local(&self, global_idx: usize) -> (usize, usize)
Returns the cluster index and local candidate index for a global index.
Sourcepub fn local_to_global(&self, cluster_idx: usize, candidate_idx: usize) -> usize
pub fn local_to_global(&self, cluster_idx: usize, candidate_idx: usize) -> usize
Returns the global index for a cluster and local candidate index.
Sourcepub fn candidate(&self, global_idx: usize) -> &PierceCandidate
pub fn candidate(&self, global_idx: usize) -> &PierceCandidate
Returns the candidate at a global index.
Trait Implementations§
Source§impl Clone for GtspInstance
impl Clone for GtspInstance
Source§fn clone(&self) -> GtspInstance
fn clone(&self) -> GtspInstance
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GtspInstance
impl RefUnwindSafe for GtspInstance
impl Send for GtspInstance
impl Sync for GtspInstance
impl Unpin for GtspInstance
impl UnsafeUnpin for GtspInstance
impl UnwindSafe for GtspInstance
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
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,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§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).Source§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.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.