SCIP++ refs/heads/main
 
Loading...
Searching...
No Matches
scippp::Var Struct Reference

Wrapper for a SCIP variable. More...

#include <var.hpp>

Public Member Functions

double getSolVal (const Solution &solution) const
 Get the assigned value in the solution.
 
int getSolValAsInt (const Solution &solution) const
 Gets the assigned value in the solution and converts it to int.
 
long long getSolValAsLongInt (const Solution &solution) const
 Gets the assigned value in the solution and converts it to long long.
 
SCIP_Var * getVar ()
 Pointer to the underlying SCIP variable.
 
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.
 
bool isZero (const Solution &solution) const
 Checks whether the value of this variable in the primal solution is in range epsilon of 0.0.
 

Public Attributes

SCIP_Var * var { nullptr }
 Pointer to the underlying SCIP variable.
 

Detailed Description

Wrapper for a SCIP variable.

It does not own the memory. Memory management is done by the Model.

Since
1.0.0

Definition at line 17 of file var.hpp.

Member Function Documentation

◆ getSolVal()

double scippp::Var::getSolVal ( const Solution & solution) const
nodiscard

Get the assigned value in the solution.

Since
1.0.0
Parameters
solutionPrimal CIP solution.
Returns
value of this variable in primal CIP solution.

◆ getSolValAsInt()

int scippp::Var::getSolValAsInt ( const Solution & solution) const
nodiscard

Gets the assigned value in the solution and converts it to int.

Since
1.1.0
Parameters
solutionPrimal CIP solution.
Returns
value of this variable in primal CIP solution as integer.

◆ getSolValAsLongInt()

long long scippp::Var::getSolValAsLongInt ( const Solution & solution) const
nodiscard

Gets the assigned value in the solution and converts it to long long.

Since
1.1.0
Parameters
solutionPrimal CIP solution.
Returns
value of this variable in primal CIP solution as long integer.

◆ getVar() [1/2]

SCIP_Var * scippp::Var::getVar ( )
nodiscard

Pointer to the underlying SCIP variable.

Since
1.3.0
Returns
underlying SCIP variable.

◆ getVar() [2/2]

SCIP_Var *const scippp::Var::getVar ( ) const
nodiscard

Pointer to the underlying SCIP variable.

Since
1.3.0
Returns
underlying SCIP variable.

◆ isVoid()

bool scippp::Var::isVoid ( ) const
nodiscard

Checks whether an existing SCIP variable is wrapped or the wrapper is empty.

Since
1.2.0
Returns
true iff the wrapper is empty

◆ isZero()

bool scippp::Var::isZero ( const Solution & solution) const
nodiscard

Checks whether the value of this variable in the primal solution is in range epsilon of 0.0.

Since
1.1.0
Parameters
solutionPrimal CIP solution.
Returns
true iff the value of this variable in the primal solution is in range epsilon of 0.0.

Member Data Documentation

◆ var

SCIP_Var* scippp::Var::var { nullptr }

Pointer to the underlying SCIP variable.

Deprecated
since 1.3.0: Use getVar() instead

Definition at line 22 of file var.hpp.


The documentation for this struct was generated from the following file: