Skip to main content

SendableCostNode

pub struct SendableCostNode<D, S, C, L> { /* private fields */ }
Expand description

Node ordered by the cost.

Implementations§

Source§

impl<D, S, C, L> SendableCostNode<D, S, C, L>
where D: DpMut<State = S, CostType = C>, C: Neg<Output = C>, L: Copy + Default,

Source

pub fn create_root(dp: &D, state: S, cost: C) -> Self

Creates a new root node given the state and the cost.

Source

pub fn create_child(&self, dp: &D, state: S, cost: C, transition: L) -> Self

Creates a new child node given the state, the cost, and the transition.

Trait Implementations§

Source§

impl<D, S, C, L> Clone for SendableCostNode<D, S, C, L>
where S: Clone, C: Clone,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<D, S, C, L> Eq for SendableCostNode<D, S, C, L>
where C: Eq,

Source§

impl<D, S, C, L> Ord for SendableCostNode<D, S, C, L>
where C: Eq + Ord,

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl<D, S, C, L> PartialEq for SendableCostNode<D, S, C, L>
where C: PartialEq,

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<D, S, C, L> PartialOrd for SendableCostNode<D, S, C, L>
where C: Eq + Ord,

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<D, S, C, L> SearchNode for SendableCostNode<D, S, C, L>
where D: DpMut<State = S, CostType = C, Label = L>, C: Copy + Neg<Output = C>, L: Copy,

Source§

type DpData = D

Type of the DP data.
Source§

type State = S

Type of the state.
Source§

type CostType = C

Type of the cost.
Source§

type Label = L

Type of the transition label.
Source§

fn get_state(&self, _: &Self::DpData) -> &Self::State

Returns the state of the node.
Source§

fn get_state_mut(&mut self, _: &Self::DpData) -> &mut Self::State

Returns the state of the node.
Source§

fn get_cost(&self, dp: &Self::DpData) -> Self::CostType

Returns the cost of the node.
Source§

fn get_bound(&self, _: &Self::DpData) -> Option<Self::CostType>

Returns the dual bound of the path cost extending the node.
Source§

fn is_closed(&self) -> bool

Returns whether the node is closed.
Source§

fn close(&self)

Closes the node.
Source§

fn get_transitions(&self, _: &D) -> Vec<L>

Returns the transitions to reach the node.
Source§

fn check_solution( &self, dp: &mut Self::DpData, ) -> Option<(Self::CostType, Vec<Self::Label>)>

Checks if the node is a solution and returns the cost and transitions if it is.
Source§

fn ordered_by_bound() -> bool

Returns whether the nodes are ordered by dual bound values.

Auto Trait Implementations§

§

impl<D, S, C, L> !Freeze for SendableCostNode<D, S, C, L>

§

impl<D, S, C, L> RefUnwindSafe for SendableCostNode<D, S, C, L>

§

impl<D, S, C, L> Send for SendableCostNode<D, S, C, L>
where S: Send, C: Send, Arc<ArcIdTree<L>>: Send, PhantomData<(D, L)>: Send,

§

impl<D, S, C, L> Sync for SendableCostNode<D, S, C, L>
where S: Sync, C: Sync, Arc<ArcIdTree<L>>: Sync, PhantomData<(D, L)>: Sync,

§

impl<D, S, C, L> Unpin for SendableCostNode<D, S, C, L>

§

impl<D, S, C, L> UnsafeUnpin for SendableCostNode<D, S, C, L>

§

impl<D, S, C, L> UnwindSafe for SendableCostNode<D, S, C, L>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.