Minotaur 0.4.1
Docs for developers
LinBil.h
Go to the documentation of this file.
1//
2// Minotaur -- It's only 1/2 bull
3//
4// (C)opyright 2008 - 2025 The Minotaur Team.
5//
6
15#ifndef MINOTAURLINBIL_H
16#define MINOTAURLINBIL_H
17
18#include "Handler.h"
19
20namespace Minotaur {
21
26class LinBil {
27 private:
29 double aTol_;
30
32 ConstraintPtr c0_;
33
35 ConstraintPtr c1_;
36
38 ConstraintPtr c2_;
39
41 ConstraintPtr c3_;
42
43 // Quadratic constraint in the transformed problem.
44 ConstraintPtr qcon_;
45
47 double rTol_;
48
50 VariablePtr x0_;
51
53 VariablePtr x1_;
54
56 VariablePtr y_;
57
58 public:
61
63 ~LinBil();
64
66 ConstraintPtr getC0() { return c0_; };
67
69 ConstraintPtr getC1() { return c1_; };
70
72 ConstraintPtr getC2() { return c2_; };
73
75 ConstraintPtr getC3() { return c3_; };
76
78 ConstraintPtr getQCon() { return qcon_; };
79
81 VariablePtr getY() { return y_; };
82
84 VariablePtr getX0() { return x0_; };
85
87 VariablePtr getX1() { return x1_; };
88
91
93 bool isViolated(const double* x, double& vio) const;
94
99 bool isViolated(const double x0val, const double x1val,
100 const double y0val) const;
101
102 void setCons(ConstraintPtr c0, ConstraintPtr c1, ConstraintPtr c2,
103 ConstraintPtr c3);
104};
105
112 bool operator()(LinBil* b0, LinBil* b1) const;
113};
114
116typedef std::set<LinBil*, CompareLinBil> LinBilSet;
117
119typedef LinBilSet::iterator LinBilSetIter;
120} // namespace Minotaur
121
122#endif
123
Define abstract base class for handlers of various kinds.
The Constraint class is used to manage a constraint.
Definition: Constraint.h:61
Definition: LinBil.h:26
ConstraintPtr getC0()
Get the first out of the four constraints.
Definition: LinBil.h:66
ConstraintPtr getQCon()
Get the quadratic constraint.
Definition: LinBil.h:78
VariablePtr getOtherX(ConstVariablePtr x) const
Get the variable other than x, in the product.
Definition: LinBil.cpp:84
VariablePtr getX1()
Get .
Definition: LinBil.h:87
ConstraintPtr getC1()
Get the second out of the four constraints.
Definition: LinBil.h:69
VariablePtr getX0()
Get .
Definition: LinBil.h:84
ConstraintPtr getC2()
Get the third out of the four constraints.
Definition: LinBil.h:72
LinBil(VariablePtr y, VariablePtr x0, VariablePtr x1, ConstraintPtr con)
Default constructor.
Definition: LinBil.cpp:27
bool isViolated(const double *x, double &vio) const
Check if a bilinear constraint is violated at the current point x.
Definition: LinBil.cpp:64
VariablePtr getY()
Get the auxiliary variable.
Definition: LinBil.h:81
ConstraintPtr getC3()
Get the fourth out of the four constraints.
Definition: LinBil.h:75
~LinBil()
Destroy.
Definition: LinBil.cpp:40
Definition: Variable.h:31
Definition: ActiveNodeStore.h:20
LinBilSet::iterator LinBilSetIter
Iterator of LinBil objects over a set.
Definition: LinBil.h:119
std::set< LinBil *, CompareLinBil > LinBilSet
A set of bilinear objects.
Definition: LinBil.h:116
Definition: LinBil.h:111

Minotaur source code documented by Doxygen 1.9.4 on Thu Apr 24 2025