Institut de Robòtica i Informàtica Industrial
KRD Group

The CuikSuite Project

variable.h File Reference

Definition of the Tvariable type and the associated functions. More...

#include "interval.h"

Go to the source code of this file.

Data Structures

struct  Tvariable
 Data associated with each variable in the problem. More...

Defines

#define SYSTEM_VAR   1
 One of the possible type of variables.
#define SECONDARY_VAR   2
 One of the possible type of variables.
#define DUMMY_VAR   4
 One of the possible type of variables.
#define CARTESIAN_VAR   8
 One of the possible type of variables.
#define NOTYPE_VAR   16
 One of the possible type of variables.

Functions

void NewVariable (unsigned int type, char *name, Tvariable *v)
 Constructor.
void CopyVariable (Tvariable *v_dst, Tvariable *v_src)
 Copy constructor.
unsigned int GetVariableType (Tvariable *v)
 Gets the variable type.
char * GetVariableName (Tvariable *v)
 Gets the variable name.
void SetVariableInterval (Tinterval *i, Tvariable *v)
 Sets the new range for the variable.
TintervalGetVariableInterval (Tvariable *v)
 Gets the range of valid values for the variable.
void PrintVariableName (FILE *f, Tvariable *v)
 Prints the name of a variable.
void PrintVariable (FILE *f, Tvariable *v)
 Prints a variable.
void DeleteVariable (Tvariable *v)
 Destructor.

Detailed Description

Definition of the Tvariable type and the associated functions.

See also:
Tvariable, variable.c.

Definition in file variable.h.


Define Documentation

#define SYSTEM_VAR   1

One of the possible type of variables. System variables are those defining the motion of the mechanism at hand.

See also:
TCuikSystem

Definition at line 24 of file variable.h.

Referenced by AddVariable(), CSRemoveUnusedVars(), GenerateJointEquations(), GenerateJointRangeEquations(), GenerateLinkRot(), IsSystemVariable(), MaxKinematicReduction(), PrintVariables(), RemoveVariable(), and SampleCuikSystemInBox().

#define SECONDARY_VAR   2

One of the possible type of variables. Secondary vars are system variables that are not necessary to completely determine the configuration of the mechanisms. For instance, the variables for sph-sph joints (i.e, the director vector for the cylinder defined in the joint) can be determined from the pose of the connected links. The variables associated with ranges (vectors, cosinus,...) are also secondary variables.

In practice, secondary vars are not used for bisection and are not taken into account when computing the size/volume for a given box.

See also:
TCuikSystem

Definition at line 44 of file variable.h.

Referenced by AddVariable(), GenerateEquationsFromBranch(), GenerateJointEquations(), GenerateJointRangeEquations(), IsSecondaryVariable(), PrintVariables(), and RemoveVariable().

#define DUMMY_VAR   4

One of the possible type of variables. Dummy variables are variables that appear in the linearization process.

See also:
TCuikSystem, DUMMY_EQ

Definition at line 53 of file variable.h.

Referenced by AddVariable(), CSRemoveUnusedVars(), DummifyAndAddEquation(), GenerateJointEquations(), IsDummyVariable(), MaxReduction(), MPI_TreatBox(), PrintVariables(), RemoveVariable(), SampleCuikSystemInBox(), and SolveCuikSystem().

#define CARTESIAN_VAR   8

One of the possible type of variables. Cartesian variables are those given coordinates for points in the mechanism structure.

See also:
TCuikSystem, COORD_EQ

Definition at line 62 of file variable.h.

Referenced by AddVariable(), IsCartesianVariable(), PrintVariables(), and RemoveVariable().

#define NOTYPE_VAR   16

Used for equations with non-assigned role yet.

Definition at line 68 of file variable.h.


Function Documentation

void NewVariable ( unsigned int  type,
char *  name,
Tvariable v 
)

Creates a new variable.

Parameters:
type Type for the new variable.
name Name for the new variable.
v The variable to create.

Definition at line 21 of file variable.c.

References INF, Tvariable::is, Tvariable::name, NEW, NewInterval(), and Tvariable::type.

Referenced by DummifyAndAddEquation(), GenerateEquationsFromBranch(), GenerateJointEquations(), GenerateJointRangeEquations(), and GenerateLinkRot().

Here is the call graph for this function:

Here is the caller graph for this function:

void CopyVariable ( Tvariable v_dst,
Tvariable v_src 
)

Creates a new variable from another one.

Parameters:
v_dst The variable to create.
v_src The variable from where to copy.

Definition at line 32 of file variable.c.

References CopyInterval(), Tvariable::is, Tvariable::name, NEW, and Tvariable::type.

Referenced by AddVariable(), CopyVariables(), and GetCSVariable().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int GetVariableType ( Tvariable v  ) 

Gets the variable type.

Parameters:
v The variable to query.
Returns:
The variable type.

Definition at line 42 of file variable.c.

References Tvariable::type.

Referenced by AddVariable(), GetVariableTypeN(), IsCartesianVariable(), IsDummyVariable(), IsSecondaryVariable(), IsSystemVariable(), PrintVariables(), and RemoveVariable().

Here is the caller graph for this function:

char* GetVariableName ( Tvariable v  ) 

Gets the variable name.

Parameters:
v The variable to query.
Returns:
The a pointer to the variable name.

Definition at line 47 of file variable.c.

References Tvariable::name.

Referenced by AddVariable(), AddVariable2CS(), CSRemoveLCVars(), CSRemoveVarsWithCtRange(), DummifyAndAddEquation(), GetVariableID(), GetVariableNames(), InitMapping(), and SimplifyCuikSystem().

Here is the caller graph for this function:

void SetVariableInterval ( Tinterval i,
Tvariable v 
)

Sets the new range for the variable.

Parameters:
i The new range for the variable.
v The variable to query.

Definition at line 52 of file variable.c.

References CopyInterval(), and Tvariable::is.

Referenced by DummifyAndAddEquation(), GenerateEquationsFromBranch(), GenerateJointEquations(), GenerateJointRangeEquations(), GenerateLinkRot(), SampleCuikSystemInBox(), SetCSVariableRange(), and SimplifyCuikSystem().

Here is the call graph for this function:

Here is the caller graph for this function:

Tinterval* GetVariableInterval ( Tvariable v  ) 

Gets the range of valid values for the variable.

Parameters:
v The variable to query.
Returns:
A pointer to the range of valid values for the variable.

Definition at line 57 of file variable.c.

References Tvariable::is.

Referenced by BoxFromVariables(), and DummifyAndAddEquation().

Here is the caller graph for this function:

void PrintVariableName ( FILE *  f,
Tvariable v 
)

Prints the name of a variable to a stream that can be stdout.

Parameters:
f The file where to print.
v The variable to print.
void PrintVariable ( FILE *  f,
Tvariable v 
)

Prints a variable (name plus valid range) to a stream that can be stdout.

Parameters:
f The file where to print.
v The variable to print.

Definition at line 62 of file variable.c.

References Tvariable::is, Tvariable::name, PRINT_VARIABLE_NAME, and PrintInterval().

Referenced by PrintVariables().

Here is the call graph for this function:

Here is the caller graph for this function:

void DeleteVariable ( Tvariable v  ) 

Deletes the Tvariable structure and frees the allocated memory.

Parameters:
v The variable to delete.

Definition at line 70 of file variable.c.

References Tvariable::name.

Referenced by DeleteVariables(), DummifyAndAddEquation(), GenerateEquationsFromBranch(), GenerateJointEquations(), GenerateJointRangeEquations(), GenerateLinkRot(), and RemoveVariable().

Here is the caller graph for this function: