Scippy

SCIP

Solving Constraint Integer Programs

weight_space_facet.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program PolySCIP */
4 /* */
5 /* Copyright (C) 2012-2022 Konrad-Zuse-Zentrum */
6 /* fuer Informationstechnik Berlin */
7 /* */
8 /* PolySCIP is distributed under the terms of the ZIB Academic License. */
9 /* */
10 /* You should have received a copy of the ZIB Academic License */
11 /* along with PolySCIP; see the file LICENCE. */
12 /* */
13 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
14 
15 /**
16  * @file weight_space_facet.h
17  * @brief Class representing a facet of the weight space polyhedron
18  * @author Sebastian Schenker
19  *
20  */
21 
22 #ifndef POLYSCIP_SRC_WEIGHT_SPACE_FACET_H_INCLUDED
23 #define POLYSCIP_SRC_WEIGHT_SPACE_FACET_H_INCLUDED
24 
25 #include <iosfwd>
26 #include <memory>
27 #include <vector>
28 #include <tuple>
29 
30 #include "polyscip_types.h"
31 
32 namespace polyscip {
33 
34  /**
35  * @class WeightSpaceFacet
36  * @brief Class representing a facet of the (partial) weight space polyhedron
37  * @details A facet is described by the inequality w_coeffs \\cdot w >= wov_coeff * a
38  */
40  public:
41 
42  /**
43  * Simple class for less than comparison
44  */
45  struct Compare {
46  /**
47  * Callable less than comparator
48  * @param f1 lhs facet
49  * @param f2 rhs facet
50  * @return true if lhs facet is lexicographically smaller than rhs facet
51  */
52  bool operator()(const std::shared_ptr<const WeightSpaceFacet> &f1,
53  const std::shared_ptr<const WeightSpaceFacet> &f2) {
54  return std::tie(f1->wov_coeff_, f1->w_coeffs_) <
55  std::tie(f2->wov_coeff_, f2->w_coeffs_);
56  }
57  };
58 
59 
60  /**
61  * Default constructor
62  * @param outcome Values for w_coeffs_
63  * @param wov_coeff Values for wov_coeff
64  */
65  explicit WeightSpaceFacet(OutcomeType outcome,
66  ValueType wov_coeff);
67 
68 
69  /**
70  * Print function
71  * @param os Output stream to print to
72  */
73  void print(std::ostream& os) const;
74 
75  private:
76  OutcomeType w_coeffs_; ///< Corresponding lhs coefficients for facet inequality
77  ValueType wov_coeff_; ///< Corresponding rhs coefficients for facet inequality
78  };
79 }
80 
81 #endif // POLYSCIP_SRC_WEIGHT_SPACE_FACET_H_INCLUDED
void print(std::ostream &os) const
SCIP_Real ValueType
Type for computed values.
General types used for PolySCIP.
std::vector< ValueType > OutcomeType
Type for points, rays in objective space.
Class representing a facet of the (partial) weight space polyhedron.
bool operator()(const std::shared_ptr< const WeightSpaceFacet > &f1, const std::shared_ptr< const WeightSpaceFacet > &f2)
WeightSpaceFacet(OutcomeType outcome, ValueType wov_coeff)