Minotaur 0.4.1
Docs for developers
KnapsackList.h
Go to the documentation of this file.
1//
2// Minotaur -- It's only 1/2 bull
3//
4// (C)opyright 2008 - 2025 The Minotaur Team.
5//
6
7
14#ifndef MINOTAURKNAPSACKLIST_H
15#define MINOTAURKNAPSACKLIST_H
16
17#include "Problem.h"
18#include "Constraint.h"
19
20namespace Minotaur {
26 public:
27 // Default constructor.
29
30 // Constructs list from a given problem.
32
33 // Destructor.
35
36 // Generates the list of knapsack constraints.
37 void generateList();
38
39 // Evaluate a constraint and decide to add it to the list.
40 void evalConstraint(ConstraintConstIterator it);
41
42 // Add a constraint to list not.
43 void addConstraint(ConstraintConstIterator it);
44
45 // Get number of knapsack constraints.
46 size_t getNumKnaps() const { return list_->size(); }
47
48 // Get number of constrainst checked for linear or not.
49 UInt getNumConsChecked() const { return numConsChecked_; }
50
51 // Get an iterator for the beginning of knapsack list.
52 ConstraintIterator getListBegin() { return list_->begin(); }
53
54 // Get an iterator for the end of the knapsack list.
55 ConstraintIterator getListEnd() { return list_->end(); }
56
57
58 private:
59 // The problem that knapsack list is generated from.
60 ProblemPtr p_;
61 // A vector of pointers to kanpsack constraints.
62 ConstraintVectorPtr list_;
63 // Number of constraints checked.
64 UInt numConsChecked_;
65 };
66
67} //namespace Minotaur
68
69#endif // MINOTAURKNAPSACKLIST_H
Get information about a constraint in a given Problem.
Declare the base class Modification.
Definition: KnapsackList.h:25
void generateList()
Definition: KnapsackList.cpp:88
Definition: Problem.h:74
Definition: ActiveNodeStore.h:20
unsigned int UInt
Unsigned integer.
Definition: Types.h:30

Minotaur source code documented by Doxygen 1.9.4 on Sat May 17 2025