cp.h File Reference

Detailed Description

Module to critial points, i.e., recursion points for the silhouette algorithm.

See Also
cp.c, Tcp.

Definition in file cp.h.

Data Structures

struct  Tcp
 Critical point structure. More...
 

Macros

#define BOUNDED_LAMBDAS   1
 Whether or not to bound the range for the lambdas. More...
 
#define RANDOM_PLANES   0
 Whether or not to use randomly generated projection planes. More...
 

Functions

void NewCP (unsigned int l, Tbox *b, Tcp *cp)
 Constructor. More...
 
unsigned int GetCPlevel (Tcp *cp)
 Gets the creation level of a critical point. More...
 
TboxGetCPFixedRanges (Tcp *cp)
 Gets the collection of fixed ranges for a critical point. More...
 
void DealWithCP (FILE *f_out, unsigned int n, Tparameters *p, TCuikSystem *cs, Tlist *cps, Tcp *cp)
 Processes a critical point. More...
 
void DeleteCP (Tcp *cp)
 Destructor. More...
 

Macro Definition Documentation

#define BOUNDED_LAMBDAS   1

Set this constant to 1 (TRUE) if you want have bounded ranges for the new variables (the lambdas) appearing when defining the equation systems to find silhouettes and critical points.

At this point this should be always 1 as the unbounded version is not working fine.
To be removed when we identify the correct, most useful variant.

Definition at line 24 of file cp.h.

#define RANDOM_PLANES   0

Set this constant to 1 (TRUE) if you want have use randomly generated projection planes when defining the silhouette/critical points equation systems.

At this point this should be always 1 as the non-random version is not working fine (projection planes should be in general position).
To be removed when we identify the correct, most useful variant.

Definition at line 36 of file cp.h.

Function Documentation

void NewCP ( unsigned int  l,
Tbox b,
Tcp cp 
)

Defines a new critical point.

Parameters
lThe recursion level at which the critical point is created.
bThe box with the already fixed ranges
cpThe Tcp structure to create.

Definition at line 278 of file cp.c.

References CopyBox(), Tcp::fixedRanges, GetBoxInterval(), IntervalCenter(), Tcp::level, and NewInterval().

Referenced by DealWithCP(), and main().

unsigned int GetCPlevel ( Tcp cp)

Gets the creation level of a critical point.

Parameters
cpThe critical point to query.
Returns
The recursion level at which the critical point was created.

Definition at line 299 of file cp.c.

References Tcp::level.

Tbox* GetCPFixedRanges ( Tcp cp)

Gets the collection of fixed ranges for a critical point.

Returns
A box with the fixed ranges to create the critical point.

Definition at line 304 of file cp.c.

References Tcp::fixedRanges.

void DealWithCP ( FILE *  f_out,
unsigned int  n,
Tparameters p,
TCuikSystem cs,
Tlist cps,
Tcp cp 
)

A critical point is a recursion point for the silhouette algorithm, i.e., a point where the range for one variable is fixed and the silhouette algorithms is launched in a sub-space with one degree of freedom less than the original space

The process of the critical point is the following

  • Given the ranges fixed and not fixed stored in the Tcp structure, we generate a TCuikSystem whose solution is a silhouette traced at this critical point.
  • We solve the TCuikSystem and add the resulting silhouette to the solution file f_out. Boxes in this file corresponding to a given silhouette are identified with a prefix in the for "SL n" with n the number of the silhouette.
  • If the resulting silhouette is just a point, we are in the end case of the recursion and nothing else need to be done.
  • If the resulting silhouette is a proper one-dimensional curbe, we generate a TCuikSystem whose solutions are critical points on the silhouette previously defined.
  • We solve the TCuikSystem to get the new critical points.
  • For each one of the solutions, we store them in the output file (f_out) and we generate a Tcp structure and we add it to the list of critical points pending to be processed (cps).

This is just a brute-force approach to the silhouette algorithm and the result is not very efficient. Many refinements are possible to speed up the execution. We will introduce them as time is available, but this is not a priority right now.

Parameters
f_outFile where to store the silhouettes and critical points.
n
pThe set of parameters to use when solving the cuiksystem generated in this function.
csThe cuiksystem whose solution space we want to characterize using the silhouette algorithm.
cpsThe list of critical points pending to be processed.
cpThe critical point to be processed (typically extracted from cps by the caller)

Definition at line 309 of file cp.c.

References AddLastElement(), Advance(), ChangeParameter(), CT_N_DOF, CT_N_SOLUTIONS, DeleteCuikSystem(), DeleteListOfBoxes(), EndOfList(), FALSE, First(), GenerateProjectionPlanes(), GetCSNumVariables(), GetCurrent(), GetParameter(), GetSCpSystem(), InitIterator(), InitListOfBoxes(), Tcp::level, ListOfBoxesCluster(), NEW, NewCP(), PrintCuikSystemWithSimplification(), PrintListOfBoxes(), SolveCuikSystem(), and TRUE.

Referenced by main().

void DeleteCP ( Tcp cp)

Deletes the information stored in the critical point and frees the allocated memory space.

Definition at line 388 of file cp.c.

References DeleteBox(), and Tcp::fixedRanges.

Referenced by main().