|
|
linear_constraint.c File ReferenceImplementaton of the function operating on TLinearConstraint. More... #include "linear_constraint.h" #include "defines.h" #include "interval.h" #include <string.h> #include <math.h> Go to the source code of this file.
Detailed DescriptionImplementaton of the function operating on TLinearConstraint.
Definition in file linear_constraint.c. Function Documentation
Creates a new, empty linear constraint.
Definition at line 17 of file linear_constraint.c. References TLinearConstraint::ind, INIT_NUM_TERMS_LC, TLinearConstraint::max, NEW, ResetLinearConstraint(), and TLinearConstraint::val. Referenced by CleanLinearConstraint(), CSRemoveVarsWithCtRange(), FixVariableInEquation(), GetFirstOrderApproximationToEquation(), GetOriginalVarRelation(), InitMapping(), IsSimplificable(), LinearEquation2LinearConstraint(), LoadMapping(), ReduceRange(), ScaleLinearConstraint(), SetEquationInfo(), SimplexGetColConstraint(), SimplexGetOptimizationFunction(), SimplexGetRowConstraint(), and SimplifyCuikSystem().
Here is the call graph for this function:
Here is the caller graph for this function:
Deletes the information stored in a linear constrain, but does not frees the memory. It is more efficient to use ResetLinearConstraint instead of DeleteLinearConstraint plus InitLinearConstraint again.
Definition at line 25 of file linear_constraint.c. References TLinearConstraint::error, TLinearConstraint::n, and NewInterval(). Referenced by InitLinearConstraint(), and ReduceRange().
Here is the call graph for this function:
Here is the caller graph for this function:
Creates a new linear constraint from another one.
Definition at line 31 of file linear_constraint.c. References CopyInterval(), TLinearConstraint::error, TLinearConstraint::ind, TLinearConstraint::max, TLinearConstraint::n, NEW, and TLinearConstraint::val. Referenced by CleanLinearConstraint(), CopyEquationInfo(), CopyMapping(), CSRemoveLCVars(), GetOriginalVarRelation(), ScaleLinearConstraint(), SetOriginalVarRelation(), and SimplexAddNewConstraint().
Here is the call graph for this function:
Here is the caller graph for this function:
Returns the number of variables involved in a linear constraint.
Definition at line 44 of file linear_constraint.c. References TLinearConstraint::n. Referenced by CSRemoveLCVars(), EquationFromLinearConstraint(), EquationFromLinearConstraintProduct(), ReplaceVariableInEquation(), SimplexAddNewConstraint(), SimplexAddNewConstraintRaw(), SimplexGetOptimalValue(), SimplexSetOptimizationFunction(), and SimplifyCuikSystem().
Here is the caller graph for this function:
Returns the coefficients (i.e., the scale factors) in a linear constraint.
Definition at line 49 of file linear_constraint.c. References TLinearConstraint::val. Referenced by SimplexAddNewConstraintRaw(), and SimplexSetOptimizationFunction().
Here is the caller graph for this function:
Returns the coefficient (i.e., the scale factor) for a particular variable in a linear constraint. Note that the index of the variable refers to its position in the linear constraint and it is not the global identifier of the variable.
Definition at line 54 of file linear_constraint.c. References Error(), and TLinearConstraint::val. Referenced by CSRemoveLCVars(), EquationFromLinearConstraint(), EquationFromLinearConstraintProduct(), ReplaceVariableInEquation(), SimplexAddNewConstraintRaw(), SimplexGetOptimalValue(), SimplexSetOptimizationFunction(), and SimplifyCuikSystem().
Here is the call graph for this function:
Here is the caller graph for this function:
Returns the variables in a linear constraint.
Definition at line 65 of file linear_constraint.c. References TLinearConstraint::ind. Referenced by SimplexAddNewConstraintRaw().
Here is the caller graph for this function:
Returns the identifier of the i-th variable involved in the linear constraint.
Definition at line 70 of file linear_constraint.c. References Error(), TLinearConstraint::ind, and NO_UINT. Referenced by CSRemoveLCVars(), EquationFromLinearConstraint(), EquationFromLinearConstraintProduct(), ReplaceVariableInEquation(), SimplexAddNewConstraintRaw(), SimplexGetOptimalValue(), SimplexSetOptimizationFunction(), and SimplifyCuikSystem().
Here is the call graph for this function:
Here is the caller graph for this function:
Returns the right-hand side interval for the linear constraint.
Definition at line 81 of file linear_constraint.c. References CopyInterval(), and TLinearConstraint::error. Referenced by CropEquation(), CSRemoveLCVars(), EquationFromLinearConstraint(), EquationFromLinearConstraintProduct(), ReplaceVariableInEquation(), SimplexAddNewConstraint(), SimplexAddNewConstraintRaw(), SimplifyCuikSystem(), and UpdateOriginalFromSimple().
Here is the call graph for this function:
Here is the caller graph for this function:
Sets a new righ-hand side error of the linear constraint.
Definition at line 86 of file linear_constraint.c. References CopyInterval(), and TLinearConstraint::error. Referenced by CropEquation(), GetFirstOrderApproximationToEquation(), SetEquationInfo(), SimplexAddNewConstraint(), SimplexGetColConstraint(), and SimplexGetRowConstraint().
Here is the call graph for this function:
Here is the caller graph for this function:
Shifts the righ-hand side error of the linear constraint by the given value (changing the sign to move it to the righ-hand side).
Definition at line 91 of file linear_constraint.c. References TLinearConstraint::error, and IntervalOffset(). Referenced by CSRemoveLCVars(), CSRemoveVarsWithCtRange(), FixVariableInEquation(), IsSimplificable(), LinearEquation2LinearConstraint(), and SimplifyCuikSystem().
Here is the call graph for this function:
Here is the caller graph for this function:
Adds a scaled variable to the linear constraint. If the varaible was already present in the constraint, we just add the scale factors.
Definition at line 96 of file linear_constraint.c. References FALSE, TLinearConstraint::ind, TLinearConstraint::max, MEM_DUP, MEM_EXPAND, TLinearConstraint::n, and TLinearConstraint::val. Referenced by AddLinearConstraints(), CleanLinearConstraint(), CSRemoveLCVars(), GetFirstOrderApproximationToEquation(), InitMapping(), IsSimplificable(), LinearEquation2LinearConstraint(), ReduceRange(), ScaleLinearConstraint(), SetEquationInfo(), SimplexGetColConstraint(), SimplexGetOptimizationFunction(), SimplexGetRowConstraint(), and SimplifyCuikSystem().
Here is the caller graph for this function:
Removes a variable from a linear constraint.
Definition at line 126 of file linear_constraint.c. References FALSE, TLinearConstraint::ind, TLinearConstraint::n, and TLinearConstraint::val. Referenced by CSRemoveLCVars().
Here is the caller graph for this function:
Checks if a variable is included in a linear constraint.
Definition at line 156 of file linear_constraint.c. References FALSE, and TLinearConstraint::ind. Referenced by CSRemoveLCVars().
Here is the caller graph for this function:
Changes the sign of a linear constraint.
Definition at line 172 of file linear_constraint.c. References TLinearConstraint::error, IntervalInvert(), TLinearConstraint::n, and TLinearConstraint::val. Referenced by IsSimplificable().
Here is the call graph for this function:
Here is the caller graph for this function:
Scales a linear constraint.
Definition at line 182 of file linear_constraint.c. References AddTerm2LinearConstraint(), CopyLinearConstraint(), DeleteLinearConstraint(), TLinearConstraint::error, TLinearConstraint::ind, InitLinearConstraint(), IntervalScale(), TLinearConstraint::n, and TLinearConstraint::val. Referenced by CSRemoveLCVars(), and IsSimplificable().
Here is the call graph for this function:
Here is the caller graph for this function:
Adds two a linear constraints.
Definition at line 199 of file linear_constraint.c. References AddTerm2LinearConstraint(), TLinearConstraint::error, TLinearConstraint::ind, IntervalAdd(), TLinearConstraint::n, and TLinearConstraint::val. Referenced by CSRemoveLCVars().
Here is the call graph for this function:
Here is the caller graph for this function:
Variables in the linear constraint with very narrow range or scaled by tiny scale factors can be removed and added to the error term. This enhances the numerical robustness of the system. This can lead to tiny error ranges. If the When using GLPK it is compulsatory to use
Definition at line 222 of file linear_constraint.c. References AddTerm2LinearConstraint(), CopyInterval(), CopyLinearConstraint(), DeleteLinearConstraint(), TLinearConstraint::error, TLinearConstraint::ind, InitLinearConstraint(), IntervalAdd(), IntervalScale(), IntervalSize(), TLinearConstraint::n, and TLinearConstraint::val. Referenced by SimplexAddNewConstraint().
Here is the call graph for this function:
Here is the caller graph for this function:
Linear constraints involving only one variable can be directly used to reduce the variable range. We compute the range for the variable as
Only linear equations with just one variable are feasible to be used to directly reduce variable ranges. Linear constraints that can be directly applied do not need to be added to the simplex.
Definition at line 253 of file linear_constraint.c. References TLinearConstraint::error, FALSE, TLinearConstraint::ind, Intersection(), IntervalDivision(), IntervalProduct(), TLinearConstraint::n, NewInterval(), TRUE, TLinearConstraint::val, and ZERO. Referenced by SimplexAddNewConstraint().
Here is the call graph for this function:
Here is the caller graph for this function:
We have that a linear constraint can be manipulated as Sum_i k_i x_i - k_j x_j + k_j x_j = error, k_j x_j= error - Sum_(i!=k) k_i x_i, x_j = (error + Sum_(i!=k) - k_i x_i))/ k_j, that can be evaluated using interval arithmetics. Thus, a linear constraint can be used to compute a new range for all the variables in the constraint that can be intersected with the given range, possibly producing a range reduction. This can be seen as a generalization of SimplifyLinearConstraint for the case where the linear constraint involves more than one variable.
Definition at line 287 of file linear_constraint.c. References CopyInterval(), EMPTY_BOX, TLinearConstraint::error, FALSE, GetBoxIntervals(), GetBoxNIntervals(), TLinearConstraint::ind, INF, Intersection(), IntervalAdd(), IntervalDivision(), IntervalProduct(), IntervalSize(), IsInside(), LowerLimit(), TLinearConstraint::n, NewInterval(), NOT_REDUCED_BOX, REDUCED_BOX, TRUE, UpperLimit(), TLinearConstraint::val, and ZERO. Referenced by CropEquation(), and CSRemoveLCVars().
Here is the call graph for this function:
Here is the caller graph for this function:
We compare the linear constraints first checking if they involve the same sub-set of variables, and then computing the cosinus of the angle between them (i.e., between the vectors defining the hyperplane of the constraint). The output scaleOne2Two gives the constant so that lc1*scaleOne2Two=lc2
Definition at line 403 of file linear_constraint.c. References FALSE, TLinearConstraint::ind, TLinearConstraint::n, TRUE, TLinearConstraint::val, and ZERO.
Evaluates a linear combination for a given point NOTE: The right-hand side of the linear constraint (represented as a error interval) is not taken into account in the evaluation.
Definition at line 466 of file linear_constraint.c. References TLinearConstraint::ind, TLinearConstraint::n, and TLinearConstraint::val.
Evaluates a linear constaint for a given ranges of the variables using interval arithmetics.
Definition at line 478 of file linear_constraint.c. References TLinearConstraint::ind, IntervalAdd(), IntervalProduct(), TLinearConstraint::n, NewInterval(), TLinearConstraint::val, and ZERO. Referenced by UpdateOriginalFromSimple().
Here is the call graph for this function:
Here is the caller graph for this function:
Writes a linear constraint into a given stream, that can be stdout.
Definition at line 495 of file linear_constraint.c. References TLinearConstraint::error, TLinearConstraint::ind, IntervalCenter(), IntervalInvert(), IntervalSize(), TLinearConstraint::n, PrintInterval(), TLinearConstraint::val, and ZERO. Referenced by CSRemoveLCVars(), PrintMapping(), SimplexAddNewConstraint(), and SimplexAddNewConstraintRaw().
Here is the call graph for this function:
Here is the caller graph for this function:
Saves the linear constraint into a file.
Definition at line 547 of file linear_constraint.c. References TLinearConstraint::error, TLinearConstraint::ind, LowerLimit(), TLinearConstraint::max, TLinearConstraint::n, UpperLimit(), and TLinearConstraint::val. Referenced by SaveMapping().
Here is the call graph for this function:
Here is the caller graph for this function:
Defines a linear constraint from a file.
Definition at line 559 of file linear_constraint.c. References TLinearConstraint::error, TLinearConstraint::ind, TLinearConstraint::max, TLinearConstraint::n, NEW, NewInterval(), and TLinearConstraint::val. Referenced by LoadMapping().
Here is the call graph for this function:
Here is the caller graph for this function:
Deletes the information stored in a linear constraint and frees the allocated memory.
Definition at line 579 of file linear_constraint.c. References DeleteInterval(), TLinearConstraint::error, TLinearConstraint::ind, and TLinearConstraint::val. Referenced by CleanLinearConstraint(), CropEquation(), CSRemoveLCVars(), CSRemoveVarsWithCtRange(), DeleteEquationInfo(), DeleteMapping(), FixVariableInEquation(), LinearizeGeneralEquationInt(), ReduceRange(), RewriteEquation(), ScaleLinearConstraint(), SimplexAddNewConstraint(), SimplexGetOptimalValue(), and SimplifyCuikSystem().
Here is the call graph for this function:
Here is the caller graph for this function:
|