Scippy

SCIP

Solving Constraint Integer Programs

weight_space_facet.cpp
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.cpp
17  * @brief Implements class representing a facet of the weight space polyhedron
18  * @author Sebastian Schenker
19  *
20  */
21 
22 #include "weight_space_facet.h"
23 
24 #include <algorithm>
25 #include <cstddef> // std::size_t
26 #include <iterator> // std::prev
27 #include <numeric>
28 #include <ostream>
29 
30 using std::ostream;
31 using std::size_t;
32 
33 namespace polyscip {
34 
35  /**
36  * Default constructor
37  * @param outcome Values for w_coeffs_
38  * @param wov_coeff Values for wov_coeff
39  */
41  ValueType wov_coeff)
42  : w_coeffs_(std::move(outcome)),
43  wov_coeff_(std::move(wov_coeff)) { }
44 
45 
46  /**
47  * Print function
48  * @param os Output stream to print to
49  */
50  void WeightSpaceFacet::print(ostream &os) const {
51  os << " Facet: ";
52  size_t counter{0};
53  std::for_each(w_coeffs_.cbegin(), std::prev(w_coeffs_.cend()),
54  [&](ValueType val){os << val << " w_" << counter++ << " + ";});
55  os << w_coeffs_.back() << " w_" << counter << " >= ";
56  if (wov_coeff_ == 0.)
57  os << "0\n";
58  else
59  os << wov_coeff_ << " wov\n";
60  }
61 
62 }
void print(std::ostream &os) const
SCIP_Real ValueType
Type for computed values.
std::vector< ValueType > OutcomeType
Type for points, rays in objective space.
Definition: pqueue.h:28
Class representing a facet of the weight space polyhedron.
WeightSpaceFacet(OutcomeType outcome, ValueType wov_coeff)