pub struct KnapsackDP {
pub weights: Vec<usize>,
pub values: Vec<usize>,
pub capacity: usize,
}Expand description
0/1 knapsack solver with item selection tracking.
Fields§
§weights: Vec<usize>Item weights.
values: Vec<usize>Item values.
capacity: usizeKnapsack capacity.
Implementations§
Trait Implementations§
Source§impl Clone for KnapsackDP
impl Clone for KnapsackDP
Source§fn clone(&self) -> KnapsackDP
fn clone(&self) -> KnapsackDP
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for KnapsackDP
impl RefUnwindSafe for KnapsackDP
impl Send for KnapsackDP
impl Sync for KnapsackDP
impl Unpin for KnapsackDP
impl UnsafeUnpin for KnapsackDP
impl UnwindSafe for KnapsackDP
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