SCIP++ refs/heads/main
 
Loading...
Searching...
No Matches
constant_coefficient.hpp
1#pragma once
2
3#include <cstdlib>
4
5namespace scippp {
6
13 const double m_COEFF;
14
15public:
21 explicit constexpr ConstantCoefficient(double c)
22 : m_COEFF { c }
23 {
24 }
30 inline double operator[](std::size_t) const
31 {
32 return m_COEFF;
33 }
34};
35
40static constexpr ConstantCoefficient COEFF_ZERO { 0 };
45static constexpr ConstantCoefficient COEFF_ONE { 1 };
46
47}
A class which an index operator that always returns a constant value.
constexpr ConstantCoefficient(double c)
Stores the constant value that will be returned by the index operator.
double operator[](std::size_t) const
Index operator that always returns the same constant value.
C++ wrapper for SCIP.
static constexpr ConstantCoefficient COEFF_ZERO
An object which index operator always returns 0.
static constexpr ConstantCoefficient COEFF_ONE
An object which index operator always returns 1.