variable_set.h File Reference Detailed DescriptionDefinition of the Tvariable_set type and the associated functions.
Definition in file variable_set.h.
Macro Definition Documentation
Initial room for variables. It will be enlarged if necessary.
Definition at line 28 of file variable_set.h. Referenced by InitVariables(), and InitVarSet().
Indicates variables that are used without any trigonometric function. Definition at line 36 of file variable_set.h. Referenced by AddTerm2SearchCriterion(), AdjustBioWorldGeometry(), ApplyLinkRotFLinks(), ApplyLinkRotLinks(), ApplyLinkRotQLinks(), DeriveVarSet(), DummifyAndAddEquation(), EquationFromLinearConstraint(), EquationFromLinearConstraintProduct(), EvaluateVarSet(), EvaluateVarSetInt(), FixVariableInVarSet(), GenerateCrossProductEquations(), GenerateDotProductEquation(), GenerateEquationsFromBranch(), GenerateGeneralNormEquation(), GenerateJointEquations(), GenerateJointEquationsInBranch(), GenerateJointRangeEquations(), GenerateJointRangeSingularityEquations(), GenerateLinkRotQLinks(), GenerateScaledParabolaEquation(), GenerateScaledSaddleEquation(), GenerateWorldSingularityEquations(), GetSCpSystem(), PolynomialVarSet(), PrintVarSet(), ReplaceVariableInEquation(), ReplaceVariableInVarSet(), RewriteEquation2Simp(), SHTransformVarDisplacementAlongVector(), SHTransformVarTx(), SHTransformVarTxyz(), SHTransformVarTy(), SHTransformVarTz(), Var2AccumulateVector2EqVector(), VarAccumulateEquations(), VarAccumulateVector2EqVector(), and VarScaleEquation().
Do not use the variable but its sine. Definition at line 43 of file variable_set.h. Referenced by DeriveVarSet(), EvaluateVarSet(), EvaluateVarSetInt(), FixVariableInVarSet(), PrintVarSet(), SHTransformVarRx(), SHTransformVarRy(), and SHTransformVarRz().
Do not use the variable but its cosine. Definition at line 50 of file variable_set.h. Referenced by DeriveVarSet(), EvaluateVarSet(), EvaluateVarSetInt(), FixVariableInVarSet(), PrintVarSet(), SHTransformVarRx(), SHTransformVarRy(), and SHTransformVarRz().
Do not use the variable but its tangent. Definition at line 57 of file variable_set.h. Referenced by DeriveVarSet(), EvaluateVarSet(), EvaluateVarSetInt(), FixVariableInVarSet(), and PrintVarSet().
Do not use the variable but its squared secant (1/cos)^2. This only appears in the derivative of a tangent. Definition at line 65 of file variable_set.h. Referenced by DeriveVarSet(), EvaluateVarSet(), EvaluateVarSetInt(), FixVariableInVarSet(), and PrintVarSet().
Do not use the variable but its squared secand per tangent. This appears in the derivative of a squared secant (SEC2V), i.e., the second derivative of a tangent (TANV). Definition at line 74 of file variable_set.h. Referenced by DeriveVarSet(), EvaluateVarSet(), EvaluateVarSetInt(), FixVariableInVarSet(), and PrintVarSet().
Do not use the variable but its exponential. Definition at line 81 of file variable_set.h. Referenced by DeriveVarSet(), EvaluateVarSet(), EvaluateVarSetInt(), FixVariableInVarSet(), and PrintVarSet().
This is a conditional function that evaluates to the squared of the variable if it is negative and to 0 otherwise. Definition at line 89 of file variable_set.h. Referenced by DeriveVarSet(), EvaluateVarSet(), EvaluateVarSetInt(), FixVariableInVarSet(), and PrintVarSet().
Derivative of PWPV. This is a line for the negative values and 0 for the positive. Definition at line 97 of file variable_set.h. Referenced by DeriveVarSet(), EvaluateVarSet(), EvaluateVarSetInt(), FixVariableInVarSet(), and PrintVarSet().
Derivative of PWLV. This is a constant for the negative values and 0 for the positive. Definition at line 105 of file variable_set.h. Referenced by DeriveVarSet(), EvaluateVarSet(), EvaluateVarSetInt(), FixVariableInVarSet(), and PrintVarSet(). Function Documentation
Creates an empty set of variable indexes.
Definition at line 70 of file variable_set.c. References Tvariable_set::fun, INIT_NUM_VARIABLES, Tvariable_set::maxvars, NEW, Tvariable_set::nvars, Tvariable_set::power, and Tvariable_set::var_id. Referenced by CopyEquation(), DeriveEquation(), InitEquation(), InitMonomial(), and ReplaceVariableInVarSet().
Removes the information stored in a variable set (variable identifiers and powers) but not the allocated memory. To re-use a Tvariable_set it is more efficient to reset the variable to re-use instead of deleting it and constructing a new set.
Definition at line 79 of file variable_set.c. References Tvariable_set::nvars. Referenced by AddScaledMonomial(), DeriveVarSet(), ResetEquation(), ResetMonomial(), and VarScaleEquation().
Creates a set of variable from the informatin stored in another set.
Definition at line 84 of file variable_set.c. References Tvariable_set::fun, Tvariable_set::maxvars, NEW, Tvariable_set::nvars, Tvariable_set::power, and Tvariable_set::var_id. Referenced by CopyMonomial(), ProductVarSet(), and ReplaceVariableInVarSet().
When eliminating a variable from a problem, the indexes of the variables with an identifier above the removed varaible need to be decreased by one. This function performs this opearation for a single variable set. The variable that we are removing from the problem need to be removed before applying this operation. If the variable set still includes the variable to be removed this function triggers and error.
Definition at line 99 of file variable_set.c. References Error(), Tvariable_set::nvars, and Tvariable_set::var_id. Referenced by FixVariableInMonomial(), ReplaceVariableInEquation(), and ReplaceVariableInMonomial().
Compare two given variable sets. Variable sets are compared first taking into account the numver of indexes they include, then the powers of the variables and, finally, the indexes of the variables.
Definition at line 112 of file variable_set.c. References Tvariable_set::fun, Tvariable_set::nvars, Tvariable_set::power, and Tvariable_set::var_id. Referenced by CmpMonomial(), and FindMonomial().
Identifies variable sets formed only by products of variables, i.e. without functions in the variables.
Definition at line 153 of file variable_set.c. References FALSE, Tvariable_set::fun, and NFUN. Referenced by BilinearMonomial(), LinearMonomial(), PolynomialMonomial(), and QuadraticMonomial().
Gets the position of a variable index in a set of variable indexes.
Definition at line 165 of file variable_set.c. References FALSE, NO_UINT, and Tvariable_set::var_id. Referenced by ReplaceVariableInEquation(), and VarIncluded().
Determines if a variable index is included in a set of variable indexes.
Definition at line 183 of file variable_set.c. References GetPlaceinSet(), and NO_UINT. Referenced by CSRemoveUnusedVars(), DeriveMonomial(), RemoveEquationsWithVar(), UsedVarInEquations(), and UsedVarInNonDummyEquations().
Determines if a variable index is included in a set of variable indexes with a given power and function.
Definition at line 188 of file variable_set.c. References FALSE, Tvariable_set::fun, Tvariable_set::power, and Tvariable_set::var_id. Referenced by VarSetIntersect().
Checks if a variable set is empty.
Definition at line 148 of file variable_set.c. References Tvariable_set::nvars. Referenced by PrintMonomial().
Adds a variable index with a given power to a variable set.
Definition at line 265 of file variable_set.c. References AddVariableInt(), FALSE, Tvariable_set::fun, Tvariable_set::power, and Tvariable_set::var_id. Referenced by AddVariable2Monomial(), ProductVarSet(), and ReplaceVariableInVarSet().
Accumulates two variable sets in one. Note that this is different from UnionVarSet since here we keep the sum of the exponentionals (not the maximum one).
Definition at line 282 of file variable_set.c. References AddVariable2Set(), CopyVarSet(), Tvariable_set::fun, Tvariable_set::nvars, Tvariable_set::power, and Tvariable_set::var_id. Referenced by MonomialProduct().
Removes a variable index from a variable set. This operates indepedently of the function/power applied to the variable.
Definition at line 305 of file variable_set.c. References Tvariable_set::fun, Tvariable_set::nvars, Tvariable_set::power, and Tvariable_set::var_id.
Replaces a variable by a constant.
Definition at line 323 of file variable_set.c. References COSV, Error(), EXPV, Tvariable_set::fun, NFUN, Tvariable_set::nvars, Tvariable_set::power, PWCV, PWLV, PWPV, SEC2TANV, SEC2V, SINV, TANV, Tvariable_set::var_id, and ZERO. Referenced by FixVariableInMonomial().
Replaces a variable by a scaled variable. Note that variables inside functions can only be replaced with a scale factor set to 1.
Definition at line 398 of file variable_set.c. References AddVariable2Set(), CopyVarSet(), DeleteVarSet(), Error(), Tvariable_set::fun, InitVarSet(), NFUN, Tvariable_set::nvars, Tvariable_set::power, and Tvariable_set::var_id. Referenced by ReplaceVariableInMonomial().
Returns the order of a variable set: the sum of the powers of the variables in the set.
Definition at line 423 of file variable_set.c. References Tvariable_set::nvars, and Tvariable_set::power. Referenced by MonomialOrder().
Returns the number of elements of a variable set.
Definition at line 442 of file variable_set.c. References Tvariable_set::nvars. Referenced by BilinearMonomial(), CropEquation(), CtMonomial(), DummifyAndAddEquation(), EvaluateMonomial(), EvaluateMonomialInt(), GetBoxMaxSizeVarSet(), GetBoxMinSizeVarSet(), GetEquationNumVariables(), IsSimplificable(), LinearMonomial(), QuadraticMonomial(), ReplaceVariableInEquation(), RewriteEquation2Orig(), RewriteEquation2Simp(), and SetEquationInfo().
Returns the identifier for the n-th variable in the set. If the set has less than n elements this functions triggers an error.
Definition at line 447 of file variable_set.c. References Error(), and Tvariable_set::var_id. Referenced by CropEquation(), DummifyAndAddEquation(), ErrorDueToVariable(), GetBoxMaxSizeVarSet(), GetBoxMinSizeVarSet(), GetFirstOrderApproximationToEquation(), IsSimplificable(), LinearEquation2LinearConstraint(), LinearizeBilinealMonomialEquation(), LinearizeCircleEquation(), LinearizeGeneralEquation(), LinearizeParabolaEquation(), LinearizeSaddleEquation(), LinearizeSphereEquation(), RewriteEquation2Orig(), RewriteEquation2Simp(), SetEquationInfo(), and UpdateSplitWeight().
Returns the variable identifiers stored in a variable set.
Definition at line 458 of file variable_set.c. References Tvariable_set::var_id.
Returns the power for the n-th variable in the set. If the set has less than n elements this functions triggers an error.
Definition at line 463 of file variable_set.c. References Error(), and Tvariable_set::power. Referenced by BilinearMonomial(), DummifyAndAddEquation(), LinearMonomial(), QuadraticMonomial(), ReplaceVariableInEquation(), and RewriteEquation2Orig().
Returns the function applied to the n-th variable in the set. If the set has less than n elements this functions triggers an error.
Definition at line 474 of file variable_set.c. References Error(), and Tvariable_set::fun. Referenced by DummifyAndAddEquation(), RewriteEquation2Orig(), and RewriteEquation2Simp().
Returns the variable powers stored in a variable set.
Definition at line 485 of file variable_set.c. References Tvariable_set::power.
Determines if two variable sets have any element in common. To determine if two variable set elements are the same we take into account bot the variable index, its power, and its associated function (if any).
Definition at line 205 of file variable_set.c. References FALSE, Tvariable_set::fun, Included(), Tvariable_set::power, and Tvariable_set::var_id.
Produces a variable set that is the union of two variable sets: i.e., it includes the variables in both sets.
Definition at line 221 of file variable_set.c. References AddVariableInt(), FALSE, Tvariable_set::fun, Tvariable_set::nvars, Tvariable_set::power, and Tvariable_set::var_id. Referenced by AddScaledMonomial(), and VarScaleEquation().
Evaluates a variable set for a given set of value for the variables.
Definition at line 490 of file variable_set.c. References COSV, Error(), EXPV, Tvariable_set::fun, NFUN, Tvariable_set::nvars, Tvariable_set::power, PWCV, PWLV, PWPV, SEC2TANV, SEC2V, SINV, TANV, Tvariable_set::var_id, and ZERO. Referenced by EvaluateMonomial().
Evaluates a variable set for a given set of ranges for the variables using interval arithmetics.
Definition at line 564 of file variable_set.c. References CopyInterval(), COSV, Error(), EXPV, Tvariable_set::fun, IntervalCosine(), IntervalExp(), IntervalPow(), IntervalProduct(), IntervalScale(), IntervalSecant2(), IntervalSecant2Tangent(), IntervalSine(), IntervalTangent(), LowerLimit(), NewInterval(), NFUN, Tvariable_set::nvars, Tvariable_set::power, PWCV, PWLV, PWPV, SEC2TANV, SEC2V, SINV, TANV, UpperLimit(), and Tvariable_set::var_id. Referenced by EvaluateMonomialInt().
Derives a variable set with respect to a given variable.
Definition at line 657 of file variable_set.c. References COSV, Error(), EXPV, FALSE, Tvariable_set::fun, Tvariable_set::maxvars, NEW, NFUN, Tvariable_set::nvars, Tvariable_set::power, PWCV, PWLV, PWPV, ResetVarSet(), SEC2TANV, SEC2V, SINV, TANV, TRUE, and Tvariable_set::var_id. Referenced by DeriveMonomial().
Writes a variable set to a given stream.
Definition at line 774 of file variable_set.c. References COSV, Error(), EXPV, FALSE, Tvariable_set::fun, NFUN, Tvariable_set::nvars, Tvariable_set::power, PRINT_VARIABLE_NAME, PWCV, PWLV, PWPV, SEC2TANV, SEC2V, SINV, TANV, TRUE, and Tvariable_set::var_id. Referenced by PrintMonomial().
Deletes the information stored in the variable set and frees the allocated memory space.
Definition at line 852 of file variable_set.c. References Tvariable_set::fun, Tvariable_set::power, and Tvariable_set::var_id. Referenced by DeleteEquation(), DeleteMonomial(), and ReplaceVariableInVarSet(). |
Follow us!