Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Knapsack_Item< W, V > Struct Template Reference

An item for knapsack problems. More...

#include <Knapsack.H>

Public Attributes

W weight
 Weight (or cost) of the item.
 
V value
 Value (or profit) of the item.
 

Detailed Description

template<typename W, typename V>
struct Aleph::Knapsack_Item< W, V >

An item for knapsack problems.

Template Parameters
WWeight type (typically integral).
VValue type (typically numeric).
Examples
knapsack_example.cc.

Definition at line 92 of file Knapsack.H.

Member Data Documentation

◆ value

template<typename W , typename V >
V Aleph::Knapsack_Item< W, V >::value

Value (or profit) of the item.

Definition at line 95 of file Knapsack.H.

◆ weight

template<typename W , typename V >
W Aleph::Knapsack_Item< W, V >::weight

Weight (or cost) of the item.

Must be non-negative.

Definition at line 94 of file Knapsack.H.


The documentation for this struct was generated from the following file: