#[non_exhaustive]#[repr(i32)]pub enum GenConstrType {
Show 18 variants
Max = 0,
Min = 1,
Abs = 2,
And = 3,
Or = 4,
Norm = 5,
Indicator = 6,
Pwl = 7,
Polynomial = 8,
NaturalExp = 9,
Exp = 10,
NaturalLog = 11,
Log = 12,
Logistic = 13,
Pow = 14,
Sin = 15,
Cos = 16,
Tan = 17,
}Expand description
Type of general constraint
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Max = 0
The constraint $r = \max{x_1,\ldots,x_k,c}$ states that the resultant variable $r$ should be equal to the maximum of the operand variables $x_1,\ldots,x_k$ and the constant $c$.
For example, a solution $(r=3, x_1=2, x_2=3, x_3=0)$ would be feasible for the constraint $r = \max{x_1,x_2,x_3,1.7}$ because $3$ is indeed the maximum of $2$, $3$, $0$, and $1.7$.
Min = 1
The constraint $r = \min{x_1,\ldots,x_k,c}$ states that the resultant variable $r$ should be equal to the minimum of the operand variables $x_1,\ldots,x_k$ and the constant $c$.
Abs = 2
The constraint $r = \mbox{abs}{x}$ states that the resultant variable $r$ should be equal to the absolute value of the operand variable $x$.
For example, a solution $(r=3, x=-3)$ would be feasible for the constraint $r = \mbox{abs}{x}$.
And = 3
The constraint $r = \mbox{and}{x_1,\ldots,x_k}$ states that the binary resultant variable $r$ should be $1$ if and only if all of the binary operand variables $x_1,\ldots,x_k$ are equal to $1$.
For example, a solution $(r=1, x_1=1, x_2=1, x_3=1)$ would be feasible for the constraint $r = \mbox{and}{x_1,x_2,x_3}$.
Note that any involved variables that are not already binary are converted to binary.
Or = 4
Similar to an AND constraint, the constraint $r = \mbox{or}{x_1,\ldots,x_k}$ states that the binary resultant variable $r$ should be $1$ if and only if at least one of the binary operand variables $x_1,\ldots,x_k$ is equal to $1$.
Note that any involved variables that are not already binary are converted to binary.
Norm = 5
The constraint $r = \mbox{norm}{x_1,\ldots,x_k}$ states that the resultant variable $r$ should be equal to the vector norm of the operand variables $x_1,\ldots,x_k$.
A few options are available: the 0-norm, 1-norm, 2-norm, and infinity-norm.
Indicator = 6
An indicator constraint $y = f \rightarrow a^Tx \leq b$ states that if the binary indicator variable $y$ is equal to $f$ in a given solution, where $f \in {0,1}$, then the linear constraint $a^Tx \leq b$ has to be satisfied. On the other hand, if $y \neq f$ (i.e., $y = 1-f$) then the linear constraint may be violated.
Note that the sense of the linear constraint can also be $=$ or $\geq$; refer to this earlier section for a more detailed description of linear constraints.
Note also that declaring an INDICATOR constraint implicitly declares the indicator variable to be of binary type.
Pwl = 7
A piecewise-linear constraint $y = f(x)$ states that the point $(x, y)$ must lie on the piecewise-linear function $f()$ defined by a set of points $(x_1, y_1), (x_2, y_2), …, (x_n, y_n)$.
Refer to the description of piecewise-linear objectives for details of how piecewise-linear functions are defined.
Polynomial = 8
$y = p_0 x^n + p_1 x^{n-1} + … + p_n x + p_{n+1}$
NaturalExp = 9
$y = exp(x)$ or $y = e^x$
Exp = 10
$y = a^x$, where $a > 0$ is the base for the exponential function
NaturalLog = 11
: $y = \log_e(x)$ or $y = \ln(x)$
Log = 12
$y = \log_a(x)$, where $a > 0$ is the base for the logarithmic function
Logistic = 13
$y = \frac{1}{1 + exp(-x)}$ or $y = \frac{1}{1 + e^{-x}}$
Pow = 14
$y = x^a$, where $x \geq 0$ for any $a$ and $x > 0$ for $a < 0$
Sin = 15
$y = \sin(x)$
Cos = 16
$y = \cos(x)$
Tan = 17
$y = \tan(x)$
Trait Implementations§
Source§impl Clone for GenConstrType
impl Clone for GenConstrType
Source§fn clone(&self) -> GenConstrType
fn clone(&self) -> GenConstrType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more