variables.c File Reference IntroductionImplementation of the functions operating on box Tvariables.
Definition in file variables.c.
Function Documentation◆ InitVariables()
Defines an empty set of variables.
Definition at line 24 of file variables.c. References Tvariables::car, Tvariables::dum, INIT_NUM_VARIABLES, Tvariables::max_variables, Tvariables::n, Tvariables::ndy, NEW, Tvariables::sec, Tvariables::sys, Tvariables::vel, and Tvariables::vs. Referenced by InitCuikSystem(). ◆ CopyVariables()
Defines a set of variables from another set
Definition at line 42 of file variables.c. References Tvariables::car, CopyVariable(), Tvariables::dum, Tvariables::max_variables, Tvariables::n, Tvariables::ndy, NEW, Tvariables::sec, Tvariables::sys, Tvariables::vel, and Tvariables::vs. Referenced by CopyCuikSystem(), CopyMapping(), CuikSystemMerge(), GetCSVariables(), InitMapping(), and SimplifyCuikSystem(). ◆ NVariables()
Returns the number of variables in a variable set.
Definition at line 73 of file variables.c. References Tvariables::n. Referenced by BoxFromVariables(), CSRemoveLCVars(), CSRemoveUnusedVars(), CSRemoveVarsWithCtRange(), CuikSystemMerge(), DummifyAndAddEquation(), ErrorInInequalities(), ErrorInSolution(), EvaluateEqMin(), GetCSNumNonDummyVariables(), GetCSNumVariables(), GetCSPositionVars(), GetCSPositionVelocityVars(), GetCSSystemVariableName(), GetCSSystemVars(), IncrementalSampleCuikSystemInBox(), InitJacobian(), InitMapping(), InitNHessian(), InitPositionJacobian(), InitScalarPositionJacobian(), PointFromVariables(), PointInSystemBox(), PrintCuikSystem(), PrintCuikSystemWithSimplification(), SampleCuikSystemInBox(), SimplifyCuikSystem(), UpdateCuikSystem(), and VariablesFromBox(). ◆ GetNumCartesianVariables()
Returns the number of cartesian variables in a variable set.
Definition at line 81 of file variables.c. References Tvariables::car. ◆ GetNumDummyVariables()
Returns the number of dummy variables in a variable set.
Definition at line 86 of file variables.c. References Tvariables::dum. Referenced by CuikGradientInBox(), CuikNewtonInBox(), and GetCSNumNonDummyVariables(). ◆ GetNumPositionVariables()
Returns the number of position variables in a variable set.
Definition at line 91 of file variables.c. References Tvariables::n, Tvariables::ndy, and Tvariables::vel. Referenced by CopyNonDynamicsJacobian(), CopyPositionJacobian(), InitNJacobian(), InitPositionJacobian(), and InitScalarPositionJacobian(). ◆ GetNumVelocityVariables()
Returns the number of velocity variables in a variable set.
Definition at line 96 of file variables.c. References Tvariables::vel. Referenced by AddVelocityEquations(), CuikHasVelocity(), GetCSNumSystemVariables(), InitNHessian(), InitNJacobian(), and PrintCuikSystemWithSimplification(). ◆ GetNumNonDynamicVariables()
Returns the number of non-dynamic variables in a variable set.
Definition at line 101 of file variables.c. References Tvariables::ndy. Referenced by CopyNonDynamicsJacobian(), GetCSNumNonDynamicVariables(), GetCSNumSystemVariables(), InitNHessian(), and PrintCuikSystemWithSimplification(). ◆ GetNumSystemVariables()
Returns the number of system variables in a variable set.
Definition at line 109 of file variables.c. References Tvariables::sys. Referenced by GetCSNumSystemVariables(), and PrintCuikSystemWithSimplification(). ◆ GetNumSecondaryVariables()
Returns the number of secondary variables in a variable set.
Definition at line 117 of file variables.c. References Tvariables::sec. Referenced by GetCSNumSystemVariables(), and PrintCuikSystemWithSimplification(). ◆ IsSystemVariable()
Identifies system variables in a set.
Definition at line 122 of file variables.c. References GetVariableType(), SYSTEM_VAR, and Tvariables::vs. Referenced by CSRemoveLCVars(), GetCSSystemVariableName(), GetCSSystemVars(), IncrementalSampleCuikSystemInBox(), IsSystemVarInSimpCS(), and UpdateCuikSystem(). ◆ IsSecondaryVariable()
Identifies secondary variables in a set.
Definition at line 127 of file variables.c. References GetVariableType(), SECONDARY_VAR, and Tvariables::vs. Referenced by GetCSSystemVariableName(), GetCSSystemVars(), IsSystemVarInSimpCS(), and UpdateCuikSystem(). ◆ IsDummyVariable()
Identifies dummy variables in a set.
Definition at line 132 of file variables.c. References DUMMY_VAR, GetVariableType(), and Tvariables::vs. Referenced by PointInSystemBox(), RegenerateSolution(), and UpdateCuikSystem(). ◆ IsCartesianVariable()
Identifies cartesian variables in a set.
Definition at line 137 of file variables.c. References CARTESIAN_VAR, GetVariableType(), and Tvariables::vs. Referenced by RegenerateSolution(). ◆ IsPositionVariable()
Identifies position variables in a set (only used in dynamical systems). A variable is a position variable if it is not a velocity
Definition at line 142 of file variables.c. References GetVariableType(), NON_DYNAMIC_VAR, VELOCITY_VAR, and Tvariables::vs. Referenced by AddVelocityEquations(), CopyNonDynamicsJacobian(), CopyPositionJacobian(), CSRemoveVarsWithCtRange(), GetCSPositionVars(), GetCSSystemVariableName(), GetCSSystemVars(), InitPositionJacobian(), InitScalarPositionJacobian(), IsSystemVarInSimpCS(), and UpdateCuikSystem(). ◆ IsVelocityVariable()
Identifies velocity variables in a set (only used in dynamical systems).
Definition at line 149 of file variables.c. References GetVariableType(), VELOCITY_VAR, and Tvariables::vs. Referenced by CopyNonDynamicsJacobian(). ◆ IsNonDynamicVariable()
Identifies non-dynamic variables in a set (only used in dynamical systems).
Definition at line 154 of file variables.c. References GetVariableType(), NON_DYNAMIC_VAR, and Tvariables::vs. Referenced by GetCSPositionVelocityVars(). ◆ GetVariableTypeN()
Returns the type of a given variable in the set. If the set has less than n variables, this function triggers an error.
Definition at line 159 of file variables.c. References Error(), GetVariableType(), Tvariables::n, and Tvariables::vs. Referenced by CropEquation(), CropLinearConstraint(), CSRemoveUnusedVars(), SampleCuikSystemInBox(), and UpdateCuikSystem(). ◆ AddVariable()
Adds a variable to the set.
Definition at line 174 of file variables.c. References Tvariables::car, CARTESIAN_VAR, CopyVariable(), Tvariables::dum, DUMMY_VAR, Error(), GetVariableName(), GetVariableType(), GetVariableWithName(), Tvariables::max_variables, MEM_DUP, Tvariables::n, Tvariables::ndy, NEW, NON_DYNAMIC_VAR, Tvariables::sec, SECONDARY_VAR, Tvariables::sys, SYSTEM_VAR, Tvariables::vel, VELOCITY_VAR, and Tvariables::vs. Referenced by AddVariable2CS(), and DummifyAndAddEquation(). ◆ GetVariableWithName()
Returns a pointer to the variable information given the name of the variable to query.
Definition at line 213 of file variables.c. References GetVariableID(), NO_UINT, and Tvariables::vs. Referenced by AddVariable(). ◆ GetVariable()
Returns a pointer to the variable information given its position in the set (i.e., its identifier). If the set has less than n variables, this function triggers an error.
Definition at line 227 of file variables.c. References Error(), Tvariables::n, and Tvariables::vs. Referenced by BoxFromVariables(), CSRemoveLCVars(), CSRemoveVarsWithCtRange(), CuikSystemMerge(), DummifyAndAddEquation(), GetCSVariable(), GetCSVarTopology(), InitMapping(), IsInSimple(), PointFromVariables(), PrintVariables(), SampleCuikSystemInBox(), SetCSVariableRange(), SimplifyCuikSystem(), and VariablesFromBox(). ◆ GetVariableID()
Returns the variable identifier (i.e., its position in the set) given a variable name.
Definition at line 239 of file variables.c. References FALSE, GetVariableName(), NO_UINT, TRUE, and Tvariables::vs. Referenced by AddVariable2CS(), CSRemoveLCVars(), CSRemoveVarsWithCtRange(), DummifyAndAddEquation(), GetCSVariableID(), GetVariableWithName(), InitMapping(), IsInSimple(), IsSystemVarInSimpCS(), and SimplifyCuikSystem(). ◆ GetVariablesTopology()
Gets an array with the topology of the variables in the set. The array is allocated inside the call and must be deallocated by the caller.
Definition at line 260 of file variables.c. References GetVariableTopology(), Tvariables::n, NEW, and Tvariables::vs. Referenced by GetCSTopology(), GetSimpCSTopology(), and UpdateCuikSystem(). ◆ GetVariableNames()
Gets a pointer to the name for all the variables in the set.
Definition at line 272 of file variables.c. References GetVariableName(), Tvariables::n, and Tvariables::vs. Referenced by AddSimplifiedJacobianEquations(), CopyCuikSystem(), CSRemoveLCVars(), CSRemoveVarsWithCtRange(), GetCSVariableNames(), PrintCuikSystem(), PrintCuikSystemWithSimplification(), PrintMapping(), SimplifyCuikSystem(), and UpdateCuikSystem(). ◆ VariableName()
Gets a pointer to the name if a particular variable.
Definition at line 280 of file variables.c. References GetVariableName(), and Tvariables::vs. Referenced by AddSimplifiedJacobianEquations(), AddVelocityEquations(), GetCSSystemVariableName(), and GetCSVariableName(). ◆ RemoveVariable()
Removes a variable from a set. After removing, the variable set is compacted, i.e., the gap of the remove variable is eliminated and this changes the variable indentifiers for the variables stored above the removed variable.
Definition at line 295 of file variables.c. References Tvariables::car, CARTESIAN_VAR, DeleteVariable(), Tvariables::dum, DUMMY_VAR, GetVariableType(), Tvariables::n, Tvariables::ndy, NON_DYNAMIC_VAR, Tvariables::sec, SECONDARY_VAR, Tvariables::sys, SYSTEM_VAR, Tvariables::vel, VELOCITY_VAR, and Tvariables::vs. Referenced by CSRemoveLCVars(), CSRemoveUnusedVars(), and CSRemoveVarsWithCtRange(). ◆ BoxFromVariables()
Creates a box from the ranges of a set of variables.
Definition at line 323 of file variables.c. References GetVariable(), GetVariableInterval(), InitBox(), NVariables(), and SetBoxInterval(). Referenced by GenerateInitialBox(), GenerateSimpInitialBox(), IncrementalSampleCuikSystemInBox(), MPI_SolveCuikSystem(), PostProcessBox(), RegenerateOriginalBox(), SimpleFromOriginal(), SimplifyCuikSystem(), and SolveCuikSystem(). ◆ PointFromVariables()
Creates a point from the center of the ranges of a set of variables.
Definition at line 334 of file variables.c. References GetVariable(), GetVariableInterval(), IntervalCenter(), NEW, and NVariables(). Referenced by RegenerateOriginalPoint(), and SimplePointFromOriginal(). ◆ VariablesFromBox()
Changes the ranges for all variables from the ranges given in a box. This is the function complementary to BoxFromVariables.
Definition at line 345 of file variables.c. References GetBoxInterval(), GetVariable(), NVariables(), and SetVariableInterval(). Referenced by IncrementalSampleCuikSystemInBox(). ◆ PrintVariables()
Prints a set of variables to an stream, that can be stdout. Variables are printed in a format that can be properly parsed by the .cuik file parser.
Definition at line 358 of file variables.c. References CARTESIAN_VAR, DUMMY_VAR, Error(), GetVariable(), GetVariableType(), Tvariables::n, NON_DYNAMIC_VAR, PrintVariable(), SECONDARY_VAR, SYSTEM_VAR, VELOCITY_VAR, and Tvariables::vs. Referenced by CSRemoveLCVars(), CSRemoveVarsWithCtRange(), PrintCuikSystem(), PrintCuikSystemWithSimplification(), and SimplifyCuikSystem(). ◆ DeleteVariables()
Deletes the Tvariables structure and frees the allocated memory.
Definition at line 400 of file variables.c. References DeleteVariable(), Tvariables::n, and Tvariables::vs. Referenced by DeleteCuikSystem(), DeleteMapping(), GenerateWorldEquations(), and UnUpdateCuikSystem(). |
Follow us!