SCIP++ refs/heads/main
 
Loading...
Searching...
No Matches
var.hpp
1#pragma once
2
3// forward declare
4struct SCIP_Var;
5
6namespace scippp {
7
8// forward declare
9struct Solution;
10
17struct Var {
22 SCIP_Var* var { nullptr };
23
29 [[nodiscard]] SCIP_Var* getVar();
30
37 [[nodiscard]] SCIP_Var* const getVar() const;
38
45 [[nodiscard]] double getSolVal(const Solution& solution) const;
46
53 [[nodiscard]] int getSolValAsInt(const Solution& solution) const;
54
61 [[nodiscard]] long long getSolValAsLongInt(const Solution& solution) const;
62
69 [[nodiscard]] bool isZero(const Solution& solution) const;
70
76 [[nodiscard]] bool isVoid() const;
77};
78
79}
C++ wrapper for SCIP.
Wrapper for a SCIP solution.
Definition solution.hpp:13
Wrapper for a SCIP variable.
Definition var.hpp:17
long long getSolValAsLongInt(const Solution &solution) const
Gets the assigned value in the solution and converts it to long long.
SCIP_Var * var
Pointer to the underlying SCIP variable.
Definition var.hpp:22
SCIP_Var *const getVar() const
Pointer to the underlying SCIP variable.
bool isVoid() const
Checks whether an existing SCIP variable is wrapped or the wrapper is empty.
int getSolValAsInt(const Solution &solution) const
Gets the assigned value in the solution and converts it to int.
SCIP_Var * getVar()
Pointer to the underlying SCIP variable.
double getSolVal(const Solution &solution) const
Get the assigned value in the solution.
bool isZero(const Solution &solution) const
Checks whether the value of this variable in the primal solution is in range epsilon of 0....