Enum tspf::WeightKind [−][src]
pub enum WeightKind {}Show variants
Explicit, Euc2d, Euc3d, Max2d, Max3d, Man2d, Man3d, Ceil2d, Geo, Att, Xray1, Xray2, Custom, Undefined,
Expand description
An enum for distance functions defined in the TSPLIB
format.
Variants
Weights are explicitly given in the data file.
Two-dimensional Euclidean distance.
Three-dimensional Euclidean distance.
Two-dimensional maximum distance.
Three-dimensional maximum distance.
Two-dimensional Manhattan distance.
Three-dimensional Manhattan distance.
Rounded-up two dimensional Euclidean distance.
Geographical distance.
Special distance function for problems att48
and att532
.
Special distance function for crystallography problems of version 1.
Special distance function for crystallography problems of version 2.
Distance function defined by users.
No distance function is given.
Implementations
impl WeightKind
[src]
impl WeightKind
[src]pub fn cost<T>(&self, a: &T, b: &T) -> f64 where
T: MetricPoint,
[src]
pub fn cost<T>(&self, a: &T, b: &T) -> f64 where
T: MetricPoint,
[src]Calculates and returns the cost (or distance) between two points.
For WeightKind::Custom
and WeightKind::Undefined
, the function will always return 0.
.
Trait Implementations
impl Clone for WeightKind
[src]
impl Clone for WeightKind
[src]fn clone(&self) -> WeightKind
[src]
fn clone(&self) -> WeightKind
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for WeightKind
[src]
impl Debug for WeightKind
[src]impl Display for WeightKind
[src]
impl Display for WeightKind
[src]impl From<WeightKind> for CoordKind
[src]
impl From<WeightKind> for CoordKind
[src]fn from(kind: WeightKind) -> Self
[src]
fn from(kind: WeightKind) -> Self
[src]Performs the conversion.
impl Hash for WeightKind
[src]
impl Hash for WeightKind
[src]impl PartialEq<WeightKind> for WeightKind
[src]
impl PartialEq<WeightKind> for WeightKind
[src]impl Copy for WeightKind
[src]
impl Eq for WeightKind
[src]
impl StructuralEq for WeightKind
[src]
impl StructuralPartialEq for WeightKind
[src]
Auto Trait Implementations
impl RefUnwindSafe for WeightKind
impl Send for WeightKind
impl Sync for WeightKind
impl Unpin for WeightKind
impl UnwindSafe for WeightKind
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more