GHOST
Public Member Functions | List of all members
ghost::global_constraints::LinearEquationEq Class Reference

#include <linear_equation_eq.hpp>

Inheritance diagram for ghost::global_constraints::LinearEquationEq:
Inheritance graph
Collaboration diagram for ghost::global_constraints::LinearEquationEq:
Collaboration graph

Public Member Functions

 LinearEquationEq (const std::vector< int > &variables_index, double rhs, const std::vector< double > &coefficients)
 
 LinearEquationEq (const std::vector< int > &variables_index, double rhs)
 
 LinearEquationEq (const std::vector< Variable > &variables, double rhs, const std::vector< double > &coefficients)
 
 LinearEquationEq (const std::vector< Variable > &variables, double rhs)
 
- Public Member Functions inherited from ghost::Constraint
 Constraint (const std::vector< int > &variables_index)
 
 Constraint (const std::vector< Variable > &variables)
 
 Constraint (const Constraint &other)=default
 Default copy contructor. More...
 
 Constraint (Constraint &&other)=default
 Default move contructor. More...
 
Constraintoperator= (const Constraint &other)=delete
 Copy assignment operator disabled. More...
 
Constraintoperator= (Constraint &&other)=delete
 Move assignment operator disabled. More...
 
virtual ~Constraint ()=default
 Default virtual destructor. More...
 
bool has_variable (int var_id) const
 

Additional Inherited Members

- Protected Member Functions inherited from ghost::global_constraints::LinearEquation
 LinearEquation (const std::vector< int > &variables_index, double rhs, const std::vector< double > &coefficients)
 
 LinearEquation (const std::vector< Variable > &variables, double rhs, const std::vector< double > &coefficients)
 
double required_error (const std::vector< Variable * > &variables) const override
 
double optional_delta_error (const std::vector< Variable * > &variables, const std::vector< int > &variable_indexes, const std::vector< int > &candidate_values) const override
 
void conditional_update_data_structures (const std::vector< Variable * > &variables, int variable_id, int new_value) override
 
- Protected Member Functions inherited from ghost::Constraint
double get_current_error () const
 
int get_id () const
 Inline method to get the unique id of the Constraint object. More...
 
- Protected Attributes inherited from ghost::global_constraints::LinearEquation
double rhs
 

Detailed Description

Implementation of the Linear Equation constraint with equality, i.e., the Scalar Product constraint with the equality atom '='. See http://sofdem.github.io/gccat/gccat/Cscalar_product.html

Constructor & Destructor Documentation

◆ LinearEquationEq() [1/4]

ghost::global_constraints::LinearEquationEq::LinearEquationEq ( const std::vector< int > &  variables_index,
double  rhs,
const std::vector< double > &  coefficients 
)

Constructor with a vector of variable IDs. This vector is internally used by ghost::Constraint to know what variables from the global variable vector it is handling.

Parameters
variables_indexa const reference to a vector of IDs of variables composing the constraint.
rhsthe right-hand side real number of the equation.
coefficientsthe vector of real numbers coefficients for each variable of the equation.

◆ LinearEquationEq() [2/4]

ghost::global_constraints::LinearEquationEq::LinearEquationEq ( const std::vector< int > &  variables_index,
double  rhs 
)

Constructor with a vector of variable IDs. This constructor calls LinearEquationEq( const std::vector<int>& index, double rhs, const std::vector<double>& coefficients), with all coefficients set to 1.0.

Parameters
variables_indexa const reference to a vector of IDs of variables composing the constraint.
rhsthe right-hand side real number of the equation.

◆ LinearEquationEq() [3/4]

ghost::global_constraints::LinearEquationEq::LinearEquationEq ( const std::vector< Variable > &  variables,
double  rhs,
const std::vector< double > &  coefficients 
)

Constructor with a vector of variable.

Parameters
variablesa const reference to a vector of variables composing the constraint.
rhsthe right-hand side real number of the equation.
coefficientsthe vector of real numbers coefficients for each variable of the equation.

◆ LinearEquationEq() [4/4]

ghost::global_constraints::LinearEquationEq::LinearEquationEq ( const std::vector< Variable > &  variables,
double  rhs 
)

Constructor with a vector of variable. This constructor calls LinearEquationEq( const std::vector<Variable>& variables, double rhs, const std::vector<double>& coefficients), with all coefficients set to 1.0.

Parameters
variablesa const reference to a vector of variables composing the constraint.
rhsthe right-hand side real number of the equation.

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