Scippy

SCIP

Solving Constraint Integer Programs

ProbDataObjectives Class Reference

Detailed Description

Stores coefficients and basic methods for objectives of given multi-objective problem.

In order to store the coefficients of our multi-objective problem we use specialisation of SCIP's ObjProbData

Definition at line 40 of file prob_data_objectives.h.

Stores coefficients and basic methods for objectives of given multi-objective problem. More...

#include <prob_data_objectives.h>

Public Member Functions

virtual ~ProbDataObjectives ()
 
std::size_t getNoObjs () const
 
void addObjName (const char *name)
 
void addObjCoeff (SCIP_VAR *var, const char *obj_name, polyscip::ValueType val)
 
polyscip::ValueType getObjCoeff (SCIP_VAR *var, std::size_t obj_no)
 
polyscip::ValueType getWeightedObjVal (SCIP_VAR *var, const polyscip::WeightType &weight)
 
polyscip::ValueType getObjVal (SCIP_VAR *var, std::size_t obj_no, polyscip::ValueType sol_val)
 
std::vector< SCIP_VAR * > getNonZeroCoeffVars (std::size_t obj_no) const
 
void negateAllCoeffs ()
 
std::size_t getNumberNonzeroCoeffs (std::size_t obj_no) const
 
void ignoreObjectives (std::size_t obj_1, std::size_t obj_2)
 
void unignoreObjectives ()
 
virtual SCIP_RETCODE scip_delorig (SCIP *scip)
 
- Public Member Functions inherited from scip::ObjProbData
 ObjProbData ()
 
virtual ~ObjProbData ()
 
virtual SCIP_RETCODE scip_trans (SCIP *scip, ObjProbData **objprobdata, SCIP_Bool *deleteobject)
 
virtual SCIP_RETCODE scip_deltrans (SCIP *scip)
 
virtual SCIP_RETCODE scip_initsol (SCIP *scip)
 
virtual SCIP_RETCODE scip_exitsol (SCIP *scip, SCIP_Bool restart)
 
virtual SCIP_RETCODE scip_copy (SCIP *scip, SCIP *sourcescip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, ObjProbData **objprobdata, SCIP_Bool global, SCIP_RESULT *result)
 

Constructor & Destructor Documentation

◆ ~ProbDataObjectives()

virtual ProbDataObjectives::~ProbDataObjectives ( )
inlinevirtual

(Virtual) Destructor

Definition at line 46 of file prob_data_objectives.h.

Member Function Documentation

◆ getNoObjs()

std::size_t ProbDataObjectives::getNoObjs ( ) const
inline

◆ addObjName()

void ProbDataObjectives::addObjName ( const char *  name)

Add identifier of objective

Parameters
nameObjective identifier

Definition at line 47 of file prob_data_objectives.cpp.

References getNoObjs().

Referenced by getNoObjs(), and readRowsMop().

◆ addObjCoeff()

void ProbDataObjectives::addObjCoeff ( SCIP_VAR var,
const char *  obj_name,
polyscip::ValueType  val 
)

Add objective coefficient

Parameters
varCorresponding variable
obj_nameCorresponding objective identifier
valCorresponding coefficient

Definition at line 64 of file prob_data_objectives.cpp.

References getNoObjs().

Referenced by getNoObjs(), and readColsMop().

◆ getObjCoeff()

ValueType ProbDataObjectives::getObjCoeff ( SCIP_VAR var,
std::size_t  obj_no 
)

Get objective coefficient

Parameters
varCorresponding variable
obj_noCorresponding number of objective

Get objective coefficient

Parameters
varCorresponding variable
obj_noCorresponding number of objective

Definition at line 83 of file prob_data_objectives.cpp.

Referenced by getNoObjs().

◆ getWeightedObjVal()

ValueType ProbDataObjectives::getWeightedObjVal ( SCIP_VAR var,
const polyscip::WeightType weight 
)

Scalar product of given weight and objectives w.r.t. given variable; if given variable is unknown, return 0.0 (since var can only have zero objective coefficients in given problem)

Parameters
varCorresponding variable
weightCorresponding weight vector

Scalar product of given weight and objectives w.r.t. given variable; if given variable is unknown, return 0.0 (since var can only have zero objective coefficients in given problem)

Parameters
varCorresponding variable
weightCorresponding weight vector

Definition at line 109 of file prob_data_objectives.cpp.

References w.

Referenced by getNoObjs().

◆ getObjVal()

ValueType ProbDataObjectives::getObjVal ( SCIP_VAR var,
std::size_t  obj_no,
polyscip::ValueType  sol_val 
)

Product of given solution value and objective coefficient w.r.t. given variable and objective number

Parameters
varCorresponding variable
obj_noCorresponding objective number
sol_valCorresponding solution value

Product of given solution value and objective coefficient w.r.t. given variable and objective number

Parameters
varCorresponding variable
obj_noCorresponding objective number
sol_valCorresponding solution value

Definition at line 144 of file prob_data_objectives.cpp.

Referenced by getNoObjs().

◆ getNonZeroCoeffVars()

vector< SCIP_VAR * > ProbDataObjectives::getNonZeroCoeffVars ( std::size_t  obj_no) const

Variables corresponding to non-zero objective coefficients

Parameters
obj_noCorresponding objective number

Definition at line 130 of file prob_data_objectives.cpp.

Referenced by getNoObjs().

◆ negateAllCoeffs()

void ProbDataObjectives::negateAllCoeffs ( )

Negate all objective coefficients of all variables in all objectives

Definition at line 155 of file prob_data_objectives.cpp.

Referenced by getNoObjs().

◆ getNumberNonzeroCoeffs()

size_t ProbDataObjectives::getNumberNonzeroCoeffs ( std::size_t  obj_no) const

Number of non-zero coefficients of objective

Parameters
obj_noCorresponding objective number

Definition at line 95 of file prob_data_objectives.cpp.

Referenced by getNoObjs().

◆ ignoreObjectives()

void ProbDataObjectives::ignoreObjectives ( std::size_t  obj_1,
std::size_t  obj_2 
)

Ignore two objectives

Parameters
obj_1First objective to ignore
obj_2Second objective to ignore

Definition at line 167 of file prob_data_objectives.cpp.

Referenced by getNoObjs().

◆ unignoreObjectives()

void ProbDataObjectives::unignoreObjectives ( )

Unignore latest two objectives that were ignored previously

Definition at line 183 of file prob_data_objectives.cpp.

Referenced by getNoObjs().

◆ scip_delorig()

virtual SCIP_RETCODE ProbDataObjectives::scip_delorig ( SCIP scip)
inlinevirtual

SCIP function for releasing memory

Parameters
scipCorresponding SCIP pointer

Reimplemented from scip::ObjProbData.

Definition at line 136 of file prob_data_objectives.h.

References SCIP_OKAY.