trans_seq.h File Reference

Detailed Description

Sequence (product) of homogeneous transforms including constant and variable terms. Used to defined matrix equations.

See Also
TTransSeq, trans_seq.c.

Definition in file trans_seq.h.

Data Structures

struct  TTrans
 A step in a transform sequence. More...
 
struct  TTransSeq
 A sequence of transforms. More...
 

Macros

#define TV   (RZ+1)
 Displacement along a vector. More...
 
#define PA   (TV+1)
 Point on a patch. More...
 
#define CT_TRANS   (PA+1)
 Constant transform. More...
 
#define dRX   (CT_TRANS+1)
 Derivative of a Rx transform. More...
 
#define dRY   (dRX+1)
 Derivative of a Ry transform. More...
 
#define dRZ   (dRY+1)
 Derivative of a Rz transform. More...
 
#define dPA_U   (dRZ+1)
 Derivative of a PA transform. More...
 
#define dPA_V   (dPA_U+1)
 Derivative of a PA transform. More...
 
#define ddRX   (dPA_V+1)
 Double derivative of a Rx transform. More...
 
#define ddRY   (ddRX+1)
 Double derivative of a Rx transform. More...
 
#define ddRZ   (ddRY+1)
 Double derivative of a Rx transform. More...
 
#define ddPA_UU   (ddRZ+1)
 Double derivative of a PA transform. More...
 
#define ddPA_UV   (ddPA_UU+1)
 Double derivative of a PA transform. More...
 
#define ddPA_VV   (ddPA_UV+1)
 Double derivative of a PA transform. More...
 
#define INIT_NUM_TERMS_TS   10
 Initial room for terms in a transform sequence. More...
 
#define IS_PATCH_TRANS(t)   ((t==PA)||(t==dPA_U)||(t==dPA_V)||(t==ddPA_UU)||(t==ddPA_UV)||(t==ddPA_VV))
 Checks if a transform is a parametrized patch (or derived). More...
 

Functions

void InitCtTrans (THTransform *ct, TTrans *t)
 Initializes a constant transform. More...
 
void InitVarTrans (unsigned int tp, int s, unsigned int v, TTrans *t)
 Initializes a variable transform. More...
 
void InitTVTrans (int s, unsigned int v, double *vect, TTrans *t)
 Initializes a TV transform. More...
 
void InitPatchTrans (unsigned int tp, int s, unsigned int u, unsigned int v, double **p, TTrans *t)
 Initializes a parametrized-patch transform. More...
 
void CopyTrans (TTrans *t_dst, TTrans *t_src)
 Constructor. More...
 
void TransInvert (TTrans *ti, TTrans *t)
 Invert a transform. More...
 
boolean TransHasVar (unsigned int v, TTrans *t)
 Identifies if a variable is involved in a given transform. More...
 
void EvaluateVectorsPATrans (double u, double v, double *x, double *y, double *h, TTrans *t)
 Computes the vectors defining a PA transform. More...
 
void EvaluateTrans (double v1, double v2, THTransform *a, TTrans *t)
 Evaluates a transform. More...
 
void EvaluatePATrans (double u, double v, THTransform *a, TTrans *t)
 Evaluates a PA transform. More...
 
void DeleteTrans (TTrans *t)
 Destructor. More...
 
void InitTransSeq (TTransSeq *ts)
 Constructor. More...
 
void CopyTransSeq (TTransSeq *ts_dst, TTransSeq *ts_src)
 Constructor. More...
 
void ResetTransSeq (TTransSeq *ts)
 Semi-destructor. More...
 
boolean IsEmptyTransSeq (TTransSeq *ts)
 Identify empty transform sequences. More...
 
boolean HasCtRotTransSeq (TTransSeq *ts)
 Checks if the tranform sequence includes contant rotations. More...
 
unsigned int TransSeqSize (TTransSeq *ts)
 Number of elements in the transform sequence. More...
 
TTransGetElementFromTransSeq (unsigned int i, TTransSeq *ts)
 Returns an element from a transform sequence. More...
 
void AddTrans2TransSeq (TTrans *t, TTransSeq *ts)
 Adds a transform to a transform sequence. More...
 
void AddCtTrans2TransSeq (THTransform *t, TTransSeq *ts)
 Adds a constant transform to the sequence. More...
 
void AddVarTrans2TransSeq (unsigned int t, int s, unsigned int v, TTransSeq *ts)
 Adds a variable transform to the sequence. More...
 
void AddDispTrans2TransSeq (int s, unsigned int v, double *vect, TTransSeq *ts)
 Adds a displacement transform to the sequence. More...
 
void AddPatchTrans2TransSeq (unsigned int t, int s, unsigned int u, unsigned int v, double **p, TTransSeq *ts)
 Adds a Parametrized-Patch transform to a transform sequence. More...
 
boolean VarIncludedinTransSeq (unsigned int v, TTransSeq *ts)
 Determines if the sequence includes a given variable. More...
 
void UpdateUsedDOF (unsigned int *dof, TTransSeq *ts)
 Determines the dof used in a transform sequence. More...
 
void ShiftVariablesInTransSeq (unsigned int nv, TTransSeq *ts)
 Adjust variable indices after removing a variable. More...
 
boolean FixVarInTransSeq (unsigned int nv, double v, THTransform *ctt, TTransSeq *ts)
 Set a variable to a constant value. More...
 
void ReplaceVarInTransSeq (unsigned int nv, unsigned int nvNew, TTransSeq *ts)
 Replaces a variable. More...
 
void SimplifyTransSeq (TTransSeq *ts)
 Reduces the complexity of the tranform sequence. More...
 
void DeriveTransSeq (unsigned int v, unsigned int *n, TTransSeq ***tsd, TTransSeq *ts)
 Derive a sequence of transforms. More...
 
void EvaluateTransSeq (double *v, THTransform *r, TTransSeq *ts)
 Evaluates the transform sequence. More...
 
void PrintTransSeq (FILE *f, char **varNames, TTransSeq *ts)
 Prints a transform sequence to a file. More...
 
void DeleteTransSeq (TTransSeq *ts)
 Destructor. More...
 

Macro Definition Documentation

#define TV   (RZ+1)

Displacement along a vector. The vector is stored in the form of a constant transform.

Definition at line 24 of file trans_seq.h.

Referenced by AddVarTrans2TransSeq(), DeriveTransSeq(), EvaluateTrans(), EvaluateTransSeq(), InitTVTrans(), InitVarTrans(), PrintTransSeq(), and UpdateUsedDOF().

#define PA   (TV+1)

Point on a patch given by two parameters. This defines a parametrized transform.

Definition at line 31 of file trans_seq.h.

Referenced by DeriveTransSeq(), EvaluateTrans(), EvaluateTransSeq(), FixVarInTransSeq(), GetJointTransSeq(), InitPatchTrans(), PrintTransSeq(), and UpdateUsedDOF().

#define CT_TRANS   (PA+1)
#define dRX   (CT_TRANS+1)

Derivative of a Rx transform.

Definition at line 44 of file trans_seq.h.

Referenced by DeriveTransSeq(), EvaluateTrans(), EvaluateTransSeq(), PrintTransSeq(), and UpdateUsedDOF().

#define dRY   (dRX+1)

Derivative of a Rx transform.

Definition at line 50 of file trans_seq.h.

Referenced by DeriveTransSeq(), EvaluateTrans(), EvaluateTransSeq(), PrintTransSeq(), and UpdateUsedDOF().

#define dRZ   (dRY+1)

Derivative of a Rx transform.

Definition at line 56 of file trans_seq.h.

Referenced by DeriveTransSeq(), EvaluateTrans(), EvaluateTransSeq(), PrintTransSeq(), and UpdateUsedDOF().

#define dPA_U   (dRZ+1)

Derivative of a PA transform with respect to the first parameter.

Definition at line 63 of file trans_seq.h.

Referenced by DeriveTransSeq(), EvaluateTrans(), EvaluateTransSeq(), FixVarInTransSeq(), PrintTransSeq(), and UpdateUsedDOF().

#define dPA_V   (dPA_U+1)

Derivative of a PA transform with respect to the second parameter.

Definition at line 70 of file trans_seq.h.

Referenced by DeriveTransSeq(), EvaluateTrans(), EvaluateTransSeq(), FixVarInTransSeq(), PrintTransSeq(), and UpdateUsedDOF().

#define ddRX   (dPA_V+1)

Double derivative of a Rx transform.

Definition at line 76 of file trans_seq.h.

Referenced by DeriveTransSeq(), EvaluateTrans(), EvaluateTransSeq(), PrintTransSeq(), and UpdateUsedDOF().

#define ddRY   (ddRX+1)

Double derivative of a Ry transform.

Definition at line 82 of file trans_seq.h.

Referenced by DeriveTransSeq(), EvaluateTrans(), EvaluateTransSeq(), PrintTransSeq(), and UpdateUsedDOF().

#define ddRZ   (ddRY+1)

Double derivative of a Rz transform.

Definition at line 88 of file trans_seq.h.

Referenced by DeriveTransSeq(), EvaluateTrans(), EvaluateTransSeq(), PrintTransSeq(), and UpdateUsedDOF().

#define ddPA_UU   (ddRZ+1)

Double derivative of a PA transform with respect to the first parameter.

Definition at line 95 of file trans_seq.h.

Referenced by DeriveTransSeq(), EvaluateTrans(), EvaluateTransSeq(), FixVarInTransSeq(), PrintTransSeq(), and UpdateUsedDOF().

#define ddPA_UV   (ddPA_UU+1)

Derivative of a PA transform with respect to the first parameter and then with respect to the second

Definition at line 102 of file trans_seq.h.

Referenced by DeriveTransSeq(), EvaluateTrans(), EvaluateTransSeq(), FixVarInTransSeq(), PrintTransSeq(), and UpdateUsedDOF().

#define ddPA_VV   (ddPA_UV+1)

Double derivative of a PA transform with respect to the second parameter.

Definition at line 109 of file trans_seq.h.

Referenced by DeriveTransSeq(), EvaluateTrans(), EvaluateTransSeq(), FixVarInTransSeq(), PrintTransSeq(), and UpdateUsedDOF().

#define INIT_NUM_TERMS_TS   10

Initial room for terms in a transform sequence. It will be enlarged if necessary.

See Also
TTransSeq

Definition at line 117 of file trans_seq.h.

Referenced by InitTransSeq().

#define IS_PATCH_TRANS (   t)    ((t==PA)||(t==dPA_U)||(t==dPA_V)||(t==ddPA_UU)||(t==ddPA_UV)||(t==ddPA_VV))

Checks if a transform is a parametrized patch or a derived transform.

Parameters
tThe type of transform to check.

Definition at line 126 of file trans_seq.h.

Referenced by AddVarTrans2TransSeq(), EvaluateVectorsPATrans(), InitPatchTrans(), and InitVarTrans().

Function Documentation

void InitCtTrans ( THTransform ct,
TTrans t 
)

Initializes a constant transform.

Parameters
ctThe constant transform.
tThe transform to initialize.

Definition at line 21 of file trans_seq.c.

References TTrans::ct, CT_TRANS, HTransformCopy(), NEW, NO_UINT, TTrans::p, TTrans::s, TTrans::t, TTrans::u, TTrans::v, TTrans::val, and TTrans::vect.

Referenced by AddCtTrans2TransSeq().

void InitVarTrans ( unsigned int  tp,
int  s,
unsigned int  v,
TTrans t 
)

Initializes a variable transform (all variable transforms but those of type TV or PA).

Parameters
tpThe type of transform.
sThe sign of the transform (-1 to invert the transform).
vThe variable involved in the transform.
tThe transform to initialize.

Definition at line 34 of file trans_seq.c.

References TTrans::ct, CT_TRANS, Error(), IS_PATCH_TRANS, NO_UINT, TTrans::p, TTrans::s, TTrans::t, TV, TTrans::u, TTrans::v, TTrans::val, and TTrans::vect.

Referenced by AddVarTrans2TransSeq().

void InitTVTrans ( int  s,
unsigned int  v,
double *  vect,
TTrans t 
)

Initializes a TV transform: a displacement along a vector scaled by a variable.

Parameters
sThe sign of the transform (-1 to invert the transform).
vThe variable involved in the transform.
vectVector giving the displacement direction.
tThe transform to initialize.

Definition at line 48 of file trans_seq.c.

References TTrans::ct, NEW, NO_UINT, TTrans::p, TTrans::s, TTrans::t, TV, TTrans::u, TTrans::v, TTrans::val, and TTrans::vect.

Referenced by AddDispTrans2TransSeq().

void InitPatchTrans ( unsigned int  tp,
int  s,
unsigned int  u,
unsigned int  v,
double **  p,
TTrans t 
)

Initializes a parametrized-patch transform.

Note that the given points are NOT the vertices defining the patch but some combinations of them

  • p_0
  • p_1-p_0
  • p_2-p_0
  • p_0-p_1-p_2+p_3
Parameters
tpSubtype of PA transform (PA,dPA_U,dPA_V,ddPA_UU,d2PA_UV,ddPA_VV).
sThe sign of the transform (-1 to invert the transform).
uThe first variable (parametre) of the parametrized-patch transform.
vThe second variable (parametre) of the parametrized-patch transform.
pThe 4 auxiliary points defining the patch. If we define a PA transform these are the four points defining its extremes. Otherwise, these are points derived from those original points.
tThe transform to initialize.

Definition at line 61 of file trans_seq.c.

References AccumulateVector(), CrossProduct(), TTrans::ct, DifferenceVector(), Error(), IS_PATCH_TRANS, NEW, TTrans::p, PA, TTrans::s, TTrans::t, TTrans::u, TTrans::v, TTrans::val, and TTrans::vect.

Referenced by AddPatchTrans2TransSeq().

void CopyTrans ( TTrans t_dst,
TTrans t_src 
)

Initializes a transform form another transform.

Definition at line 103 of file trans_seq.c.

References TTrans::ct, HTransformCopy(), NEW, TTrans::p, TTrans::s, TTrans::t, TTrans::u, TTrans::v, TTrans::val, and TTrans::vect.

Referenced by AddTrans2TransSeq(), CopyTransSeq(), and TransInvert().

void TransInvert ( TTrans ti,
TTrans t 
)

Invert a transform.

Parameters
tiThe resulting inverted transform.
tThe transform to invert.

Definition at line 141 of file trans_seq.c.

References CopyTrans(), TTrans::ct, CT_TRANS, HTransformInverse(), TTrans::s, and TTrans::t.

Referenced by AddTransSeq2MEquation().

boolean TransHasVar ( unsigned int  v,
TTrans t 
)

Checks if a variable is involved in a given transform.

Parameters
vThe variable to check.
tThe transform to query.
Returns
TRUE if the variable is involved in the transform.

Definition at line 150 of file trans_seq.c.

References TTrans::u, and TTrans::v.

Referenced by DeriveTransSeq(), ShiftVariablesInTransSeq(), and VarIncludedinTransSeq().

void EvaluateVectorsPATrans ( double  u,
double  v,
double *  x,
double *  y,
double *  h,
TTrans t 
)

Computes the basic, unnormalized vectors defining a PA transform. This can be applied to PA transforms and to their derivatives (dPA_U, dPA_V, ddPA_UU, ddPA_UV, and ddPA_VV) BUT in all cases it returns the vector for the original PA

Parameters
uValue for the 1st parameter.
vValue for the 2nd parameter.
xOutput vector with the non-normalized 1st column of the transform.
yOutput vector with the non-normalized 2nd column of the transform.
hOutput vector with the 4th column of the transform (translation).
tThe PA-like transform to evaluate.

Definition at line 155 of file trans_seq.c.

References Error(), IS_PATCH_TRANS, TTrans::p, SumVectorScale(), and TTrans::t.

Referenced by EvaluatePATrans(), and EvaluateTrans().

void EvaluateTrans ( double  v1,
double  v2,
THTransform a,
TTrans t 
)

Computes the homogeneous transform corresponding to a given variable transform given values for the involved variables.

If used on a constant transform, the constant matrix is returned.

Parameters
v1Value of the first variable of the transform.
v2Value of the second variable of the transform. Only used in PA-like transforms.
aThe output homgeneous transform.
tThe transform to evaluate.

Definition at line 174 of file trans_seq.c.

References AccumulateVector(), AXIS_H, AXIS_X, AXIS_Y, AXIS_Z, CrossProduct(), TTrans::ct, CT_TRANS, ddPA_UU, ddPA_UV, ddPA_VV, ddRX, ddRY, ddRZ, DotProduct(), dPA_U, dPA_V, dRX, dRY, dRZ, Error(), EvaluatePATrans(), EvaluateVectorsPATrans(), HTransformApplyRot(), HTransformCopy(), HTransformFromVectors(), HTransformRx(), HTransformRx2(), HTransformRy(), HTransformRy2(), HTransformRz(), HTransformRz2(), HTransformSetElement(), HTransformTranspose(), HTransformTx(), HTransformTxyz(), HTransformTy(), HTransformTz(), Norm(), TTrans::p, PA, RX, RY, RZ, TTrans::s, ScaleVector2(), SumVectorScale(), TTrans::t, TV, TX, TY, TZ, and TTrans::vect.

Referenced by EvaluateTransSeq(), and FixVarInTransSeq().

void EvaluatePATrans ( double  u,
double  v,
THTransform a,
TTrans t 
)

Evaluates a PA transform. This can be applied to PA transforms and to their derivatives (dPA_U, dPA_V, ddPA_UU, ddPA_UV, and ddPA_VV) BUT in all cases it returns the evaluation of the original PA

Parameters
uValue for the 1st parameter.
vValue for the 2nd parameter.
aThe resulting transform (inverted if the transform is "negative".
tThe PA-like transform to evaluate.
See Also
EvaluateVectorsPATrans.

Definition at line 406 of file trans_seq.c.

References CrossProduct(), EvaluateVectorsPATrans(), HTransformFromVectors(), HTransformInverse(), Normalize(), and TTrans::s.

Referenced by EvaluateTrans().

void DeleteTrans ( TTrans t)

Releases the memory used in a transform.

Parameters
tThe transform to delete.

Definition at line 421 of file trans_seq.c.

References TTrans::ct, HTransformDelete(), TTrans::p, and TTrans::vect.

Referenced by AddCtTrans2TransSeq(), AddTrans2TransSeq(), AddTransSeq2MEquation(), FixVarInTransSeq(), ResetTransSeq(), and SimplifyTransSeq().

void InitTransSeq ( TTransSeq ts)

Initializes an empty sequence of transforms.

Parameters
tsThe transform sequence to initilize.

Definition at line 450 of file trans_seq.c.

References INIT_NUM_TERMS_TS, TTransSeq::m, TTransSeq::n, NEW, and TTransSeq::t.

Referenced by DeriveTransSeq(), GetJointTransSeq(), GetLinkTransSeq(), and InitMEquation().

void CopyTransSeq ( TTransSeq ts_dst,
TTransSeq ts_src 
)

Copy constructor.

Parameters
ts_dstThe sequence to initialize.
ts_srcthe sequence from where to copy.

Definition at line 457 of file trans_seq.c.

References CopyTrans(), TTransSeq::m, TTransSeq::n, NEW, and TTransSeq::t.

Referenced by CopyMEquation().

void ResetTransSeq ( TTransSeq ts)

Resets a sequence of transforms. Removes all the elements but does not release memory.

Parameters
tsThe transform sequence to reset.

Definition at line 472 of file trans_seq.c.

References DeleteTrans(), TTransSeq::n, and TTransSeq::t.

Referenced by DeleteTransSeq(), and ResetMEquation().

boolean IsEmptyTransSeq ( TTransSeq ts)

Identifies empty transform sequences.

Parameters
tsThe transforms sequence to check.

Definition at line 484 of file trans_seq.c.

References TTransSeq::n.

boolean HasCtRotTransSeq ( TTransSeq ts)

Determines if the transform sequence includes a rotation among its constants elements.

Transform sequences without constant rotations are typicaly used in planar manipulators. We want to detect them in order to avoid considering redundant equations.

Parameters
tsThe transforms sequence to check.
Returns
TRUE if the sequence includes at least one constnat rotation.

Definition at line 489 of file trans_seq.c.

References TTrans::ct, CT_TRANS, FALSE, HTransformIsTranslation(), TTrans::t, and TTransSeq::t.

Referenced by RecomputeScalarEquations().

unsigned int TransSeqSize ( TTransSeq ts)

Number of elements in the transform sequence.

Parameters
tsThe transform sequence to query.
Returns
Number of elements in the transform sequence.

Definition at line 501 of file trans_seq.c.

References TTransSeq::n.

Referenced by AddTransSeq2MEquation(), and MEquationSize().

TTrans* GetElementFromTransSeq ( unsigned int  i,
TTransSeq ts 
)

Returns an element from a transform sequence.

Parameters
iThe index of the transform to retrive.
tsThe transform sequence to query.
Returns
A pointer to the trans structure. Be careful with the use of this pointer.

Definition at line 506 of file trans_seq.c.

References Error(), TTransSeq::n, and TTransSeq::t.

Referenced by AddTransSeq2MEquation().

void AddTrans2TransSeq ( TTrans t,
TTransSeq ts 
)

Adds a transform to a transform sequence.

t The transform to add. ts The sequence where to add the transform.

Definition at line 514 of file trans_seq.c.

References AddCtTrans2TransSeq(), CopyTrans(), TTrans::ct, CT_TRANS, DeleteTrans(), HTransformDelete(), HTransformInverse(), HTransformIsIdentity(), TTransSeq::m, MEM_DUP, TTransSeq::n, NEW, TTrans::s, TTrans::t, and TTransSeq::t.

Referenced by AddTransSeq2MEquation(), and DeriveTransSeq().

void AddCtTrans2TransSeq ( THTransform t,
TTransSeq ts 
)

Adds a constant transform at the end of a transform sequence.

Note that identity transforms or matrices that result in identity transforms when added at the end of the sequence are skipped.

Parameters
tThe transform to add.
tsThe transform sequence to enlarge.

Definition at line 550 of file trans_seq.c.

References TTrans::ct, CT_TRANS, DeleteTrans(), HTransformIsIdentity(), HTransformProduct(), InitCtTrans(), TTransSeq::m, MEM_DUP, TTransSeq::n, NEW, TTrans::t, and TTransSeq::t.

Referenced by AddCtTrans2MEquation(), AddTrans2TransSeq(), DeriveTransSeq(), FixVarInTransSeq(), GetJointTransSeq(), and InitMEquation().

void AddVarTrans2TransSeq ( unsigned int  t,
int  s,
unsigned int  v,
TTransSeq ts 
)

Adds a variable transform at the end of a transform sequence.

Parameters
tType of transform.
sThe sign of the variable.
vVariable involved in the transform.
tsThe transform sequence to enlarge.

Definition at line 578 of file trans_seq.c.

References TTrans::ct, CT_TRANS, Error(), HTransformIsIdentity(), InitVarTrans(), IS_PATCH_TRANS, TTransSeq::m, MEM_DUP, TTransSeq::n, NEW, TTrans::t, TTransSeq::t, and TV.

Referenced by AddVarTrans2MEquation(), DeriveTransSeq(), GetJointTransSeq(), and GetLinkTransSeq().

void AddDispTrans2TransSeq ( int  s,
unsigned int  v,
double *  vect,
TTransSeq ts 
)

Adds a variable scaled displacement along a vector.

Parameters
sThe sign of the variable.
vVariable involved in the transform.
vectVector defining the displacement. Used only for Tv Transforms.
tsThe transform sequence to enlarge.

Definition at line 601 of file trans_seq.c.

References TTrans::ct, CT_TRANS, HTransformIsIdentity(), InitTVTrans(), TTransSeq::m, MEM_DUP, TTransSeq::n, NEW, TTrans::t, and TTransSeq::t.

Referenced by AddDispTrans2MEquation(), and GetJointTransSeq().

void AddPatchTrans2TransSeq ( unsigned int  t,
int  s,
unsigned int  u,
unsigned int  v,
double **  p,
TTransSeq ts 
)

Adds a Parametrized-Patch transform to a transform sequence.

Parameters
tSubtype of PA transform (PA,dPA_U,dPA_V,ddPA_UU,d2PA_UV,ddPA_VV).
sThe sign of the transform (-1 means to invert the transform).
uFirst variable (parameter) involved in the transform.
vSecond variable (parameter) involved in the transform.
pThe four points defining the patch.
tsThe transform sequence to enlarge.

Definition at line 615 of file trans_seq.c.

References TTrans::ct, CT_TRANS, HTransformIsIdentity(), InitPatchTrans(), TTransSeq::m, MEM_DUP, TTransSeq::n, NEW, TTrans::t, and TTransSeq::t.

Referenced by AddPatchTrans2MEquation(), DeriveTransSeq(), and GetJointTransSeq().

boolean VarIncludedinTransSeq ( unsigned int  v,
TTransSeq ts 
)

Determines if the sequence includes a given variable. Used in the derivation of transform sequence.

Parameters
vThe variable identifier.
tsThe transform sequence to check.

Definition at line 630 of file trans_seq.c.

References FALSE, TTransSeq::t, and TransHasVar().

Referenced by VarIncludedinMEquation().

void UpdateUsedDOF ( unsigned int *  dof,
TTransSeq ts 
)

Determines the dof used in a transform sequence. This is done by adding the transforms used in each degree of freedom into a given array.

Parameters
dof6-dim array where we add the types of dof used in the transform sequence.
tsThe transform sequence to analyze.

Definition at line 645 of file trans_seq.c.

References CT_TRANS, ddPA_UU, ddPA_UV, ddPA_VV, ddRX, ddRY, ddRZ, dPA_U, dPA_V, dRX, dRY, dRZ, Error(), TTransSeq::n, PA, RX, RY, RZ, TTrans::t, TTransSeq::t, TV, TX, TY, and TZ.

Referenced by HasRotations(), and RecomputeScalarEquations().

void ShiftVariablesInTransSeq ( unsigned int  nv,
TTransSeq ts 
)

After removing a variable not used in the system we have to shift down the indices of the variables with larger index than the removed one.

This triggers an error if the variable is actually in use in the transform sequence.

Parameters
nvThe removed variable.
tsThe transform sequence to update.

Definition at line 705 of file trans_seq.c.

References Error(), TTransSeq::n, NO_UINT, TTransSeq::t, TransHasVar(), TTrans::u, and TTrans::v.

Referenced by FixVarInTransSeq(), ReplaceVarInTransSeq(), and ShiftVariablesInMEquation().

boolean FixVarInTransSeq ( unsigned int  nv,
double  v,
THTransform ctt,
TTransSeq ts 
)

Replaces a variable by a constant value. Used when simplifying problems.

Parameters
nvThe identifier of the variable to replace.
vThe value to use.
cttThe transform when the transformation sequence becomes constant (output 1 or 2).
tsThe transform sequence to modify.
Returns
TRUE if the transform became constant.

Definition at line 723 of file trans_seq.c.

References AddCtTrans2TransSeq(), TTrans::ct, CT_TRANS, ddPA_UU, ddPA_UV, ddPA_VV, DeleteTrans(), dPA_U, dPA_V, EvaluateTrans(), FALSE, HTransformCopy(), HTransformDelete(), HTransformIdentity(), HTransformIsIdentity(), TTransSeq::m, TTransSeq::n, NEW, NO_UINT, PA, ShiftVariablesInTransSeq(), TTrans::t, TTransSeq::t, TRUE, TTrans::u, TTrans::v, and TTrans::val.

Referenced by FixVarInMEquation().

void ReplaceVarInTransSeq ( unsigned int  nv,
unsigned int  nvNew,
TTransSeq ts 
)

Replaces a variable by another variable. Used when simplifying problems.

Parameters
nvThe identifier of the variable to replace.
nvNewThe identifier of the new variable.
tsThe transform sequence to modify.

Definition at line 831 of file trans_seq.c.

References TTransSeq::n, ShiftVariablesInTransSeq(), TTransSeq::t, TTrans::u, and TTrans::v.

Referenced by ReplaceVarInMEquation().

void SimplifyTransSeq ( TTransSeq ts)

Accumulates the constant transform at the end of the sequence with the first one (if this is also constant). This produces no change in the expression if the transform sequence is equal to the identity. otherwise the change is dramatic and the simplification is not valid.

This is only used from SimplifyMEquation. Do not use in another context.

Parameters
tsThe transform sequence to simplify.

Definition at line 846 of file trans_seq.c.

References TTrans::ct, CT_TRANS, DeleteTrans(), HTransformIsIdentity(), HTransformProduct(), TTransSeq::n, TTrans::t, and TTransSeq::t.

Referenced by SimplifyMEquation().

void DeriveTransSeq ( unsigned int  v,
unsigned int *  n,
TTransSeq ***  tsd,
TTransSeq ts 
)

Derive a sequence of transforms with respect to a given variable

If a given sequence includes the same variable more than once, the output can be a set of transform sequences.

Parameters
vThe derivation variable
nNumber of transform sequences returned
tsdThe derived sequences (initialized internally. not initialized if the variable is not used in the given sequence).
tsthe sequence to derive.

Definition at line 868 of file trans_seq.c.

References AddCtTrans2TransSeq(), AddPatchTrans2TransSeq(), AddTrans2TransSeq(), AddVarTrans2TransSeq(), AXIS_H, AXIS_X, AXIS_Y, AXIS_Z, ddPA_UU, ddPA_UV, ddPA_VV, ddRX, ddRY, ddRZ, dPA_U, dPA_V, dRX, dRY, dRZ, Error(), HTransformDelete(), HTransformSetElement(), HTransformZero(), InitTransSeq(), TTransSeq::n, NEW, TTrans::p, PA, RX, RY, RZ, TTrans::s, TTrans::t, TTransSeq::t, TransHasVar(), TV, TX, TY, TZ, TTrans::u, TTrans::v, and TTrans::vect.

Referenced by DeriveMEquation().

void EvaluateTransSeq ( double *  v,
THTransform r,
TTransSeq ts 
)

Evaluates the transform sequence given some values for the variables.

Parameters
vThe variable values.
rThe resulting transform.
tsThe transform sequence to evaluate.

Definition at line 997 of file trans_seq.c.

References TTrans::ct, CT_TRANS, ddPA_UU, ddPA_UV, ddPA_VV, ddRX, ddRY, ddRZ, dPA_U, dPA_V, dRX, dRY, dRZ, Error(), EvaluateTrans(), HTransformAcumRot(), HTransformAcumTrans(), HTransformDelete(), HTransformIdentity(), HTransformProduct(), TTransSeq::n, NO_UINT, PA, RX, RY, RZ, TTrans::s, TTrans::t, TTransSeq::t, TV, TX, TY, TZ, TTrans::u, TTrans::v, TTrans::val, and TTrans::vect.

Referenced by EvaluateMEquation(), and EvaluateMEquationXVectors().

void PrintTransSeq ( FILE *  f,
char **  varNames,
TTransSeq ts 
)

Prints a transform sequence to a file.

Parameters
fThe file.
varNamesThe variable names, if available (otherwise set thie to NULL).
tsThe transform sequence to print.

Definition at line 1074 of file trans_seq.c.

References AccumulateVector(), TTrans::ct, CT_TRANS, ddPA_UU, ddPA_UV, ddPA_VV, ddRX, ddRY, ddRZ, DIM_SP, dPA_U, dPA_V, dRX, dRY, dRZ, Error(), HTransformGetElement(), HTransformIsIdentity(), TTransSeq::n, NO_UINT, TTrans::p, PA, PRINT_VARIABLE_NAME, PrintReal(), RX, RY, RZ, TTrans::s, SumVector(), TTrans::t, TTransSeq::t, TV, TX, TY, TZ, TTrans::u, TTrans::v, TTrans::val, and TTrans::vect.

Referenced by PrintMEquation().

void DeleteTransSeq ( TTransSeq ts)

Deleltes a transform sequence.

Parameters
tsThe transform sequence to delete.

Definition at line 1288 of file trans_seq.c.

References ResetTransSeq(), and TTransSeq::t.

Referenced by DeleteMEquation(), FixVarInMEquation(), and GenerateMEquationFromBranch().