variables.c File Reference Detailed DescriptionImplementation of the functions operating on box Tvariables.
Definition in file variables.c.
Function Documentation
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, NEW, Tvariables::sec, Tvariables::sys, and Tvariables::vs. Referenced by InitCuikSystem().
Defines a set of variables from another set
Definition at line 40 of file variables.c. References Tvariables::car, CopyVariable(), Tvariables::dum, Tvariables::max_variables, Tvariables::n, NEW, Tvariables::sec, Tvariables::sys, and Tvariables::vs. Referenced by CopyCuikSystem(), CopyMapping(), CuikSystemMerge(), GetCSVariables(), InitMapping(), and SimplifyCuikSystem().
Returns the number of variables in a variable set.
Definition at line 69 of file variables.c. References Tvariables::n. Referenced by BoxFromVariables(), CSRemoveLCVars(), CSRemoveUnusedVars(), CSRemoveVarsWithCtRange(), CuikSystemMerge(), DummifyAndAddEquation(), ErrorInInequalities(), ErrorInSolution(), EvaluateEqMin(), GetCSNumNonDummyVariables(), GetCSNumVariables(), GetCSSystemVars(), IncrementalSampleCuikSystemInBox(), InitJacobian(), InitMapping(), PointFromVariables(), PointInSystemBox(), PrintCuikSystem(), PrintCuikSystemWithSimplification(), SampleCuikSystemInBox(), SimplifyCuikSystem(), UpdateCuikSystem(), and VariablesFromBox().
Returns the number of cartesian variables in a variable set.
Definition at line 77 of file variables.c. References Tvariables::car.
Returns the number of dummy variables in a variable set.
Definition at line 82 of file variables.c. References Tvariables::dum. Referenced by CuikNewtonInBox(), and GetCSNumNonDummyVariables().
Returns the number of system variables in a variable set.
Definition at line 90 of file variables.c. References Tvariables::sys. Referenced by GetCSNumSystemVariables(), and PrintCuikSystemWithSimplification().
Returns the number of secondary variables in a variable set.
Definition at line 98 of file variables.c. References Tvariables::sec. Referenced by GetCSNumSystemVariables(), and PrintCuikSystemWithSimplification().
Identifies system variables in a set.
Definition at line 103 of file variables.c. References GetVariableType(), SYSTEM_VAR, and Tvariables::vs. Referenced by CSRemoveLCVars(), GetCSSystemVars(), IncrementalSampleCuikSystemInBox(), IsSystemVarInSimpCS(), and UpdateCuikSystem().
Identifies secondary variables in a set.
Definition at line 108 of file variables.c. References GetVariableType(), SECONDARY_VAR, and Tvariables::vs. Referenced by GetCSSystemVars(), IsSystemVarInSimpCS(), and UpdateCuikSystem().
Identifies dummy variables in a set.
Definition at line 113 of file variables.c. References DUMMY_VAR, GetVariableType(), and Tvariables::vs. Referenced by PointInSystemBox(), RegenerateSolution(), and UpdateCuikSystem().
Identifies cartesian variables in a set.
Definition at line 118 of file variables.c. References CARTESIAN_VAR, GetVariableType(), and Tvariables::vs. Referenced by RegenerateSolution().
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 123 of file variables.c. References Error(), GetVariableType(), Tvariables::n, and Tvariables::vs. Referenced by CropEquation(), CropLinearConstraint(), CSRemoveUnusedVars(), SampleCuikSystemInBox(), and UpdateCuikSystem().
Adds a variable to the set.
Definition at line 138 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, NEW, Tvariables::sec, SECONDARY_VAR, Tvariables::sys, SYSTEM_VAR, and Tvariables::vs. Referenced by AddVariable2CS(), and DummifyAndAddEquation().
Returns a pointer to the variable information given the name of the variable to query.
Definition at line 175 of file variables.c. References GetVariableID(), NO_UINT, and Tvariables::vs. Referenced by AddVariable().
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 189 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().
Returns the variable identifier (i.e., its position in the set) given a variable name.
Definition at line 201 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().
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 222 of file variables.c. References GetVariableTopology(), Tvariables::n, NEW, and Tvariables::vs. Referenced by GetSimpCSTopology(), and UpdateCuikSystem().
Gets a pointer to the name for all the variables in the set.
Definition at line 234 of file variables.c. References GetVariableName(), Tvariables::n, and Tvariables::vs. Referenced by AddSimplifiedJacobianEquations(), CopyCuikSystem(), CSRemoveLCVars(), CSRemoveVarsWithCtRange(), GetCSVariableNames(), PrintCuikSystem(), PrintCuikSystemWithSimplification(), PrintMapping(), SimplifyCuikSystem(), and UpdateCuikSystem().
Gets a pointer to the name if a particular variable.
Definition at line 242 of file variables.c. References GetVariableName(), and Tvariables::vs. Referenced by AddSimplifiedJacobianEquations(), and GetCSVariableName().
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 257 of file variables.c. References Tvariables::car, CARTESIAN_VAR, DeleteVariable(), Tvariables::dum, DUMMY_VAR, GetVariableType(), Tvariables::n, Tvariables::sec, SECONDARY_VAR, Tvariables::sys, SYSTEM_VAR, and Tvariables::vs. Referenced by CSRemoveLCVars(), CSRemoveUnusedVars(), and CSRemoveVarsWithCtRange().
Creates a box from the ranges of a set of variables.
Definition at line 283 of file variables.c. References GetVariable(), GetVariableInterval(), InitBox(), NVariables(), and SetBoxInterval(). Referenced by CuikNewtonInBox(), GenerateInitialBox(), GenerateSimpInitialBox(), IncrementalSampleCuikSystemInBox(), MPI_SolveCuikSystem(), PostProcessBox(), RegenerateOriginalBox(), SimpleFromOriginal(), SimplifyCuikSystem(), and SolveCuikSystem().
Creates a point from the center of the ranges of a set of variables.
Definition at line 294 of file variables.c. References GetVariable(), GetVariableInterval(), IntervalCenter(), NEW, and NVariables(). Referenced by RegenerateOriginalPoint(), and SimplePointFromOriginal().
Changes the ranges for all variables from the ranges given in a box. This is the function complementary to BoxFromVariables.
Definition at line 305 of file variables.c. References GetBoxInterval(), GetVariable(), NVariables(), and SetVariableInterval(). Referenced by IncrementalSampleCuikSystemInBox().
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 318 of file variables.c. References CARTESIAN_VAR, DUMMY_VAR, Error(), GetVariable(), GetVariableType(), Tvariables::n, PrintVariable(), SECONDARY_VAR, SYSTEM_VAR, and Tvariables::vs. Referenced by CSRemoveLCVars(), CSRemoveVarsWithCtRange(), PrintCuikSystem(), PrintCuikSystemWithSimplification(), and SimplifyCuikSystem().
Deletes the Tvariables structure and frees the allocated memory.
Definition at line 354 of file variables.c. References DeleteVariable(), Tvariables::n, and Tvariables::vs. Referenced by DeleteCuikSystem(), DeleteMapping(), GenerateWorldEquations(), and UnUpdateCuikSystem(). |
Follow us!