Go to the documentation of this file.
63 int main( int argc, char **arg)
74 unsigned int *forceVars;
88 fprintf(stderr, "Reading parameter file : %s\n", GetFileFullName(&fparam));
95 Error( "The input world does not include any force variable");
101 Error( "The file with the solution boxes can not be opened");
109 Error( "Too large force index");
120 fprintf(stderr, "Writing force to file : %s\n", GetFileFullName(&fforces));
137 NEW(force,nb, double);
143 fprintf(stderr, "Writing forces file : %s\n", GetFileFullName(&fforces));
147 Error( "The file for the forces can not be opened");
157 Error( "Box size missmatch");
197 fprintf(stdout, " Wrong number of parameters.\n");
198 fprintf(stdout, " Use:\n");
199 fprintf(stdout, " cuikworldforces <world>.world <solutions>.sol [num force [mode]]\n");
200 fprintf(stdout, " Where:\n");
201 fprintf(stdout, " <world>: File describing the problem\n");
202 fprintf(stdout, " <solutions>: Solutions for which to extract the forces.\n");
203 fprintf(stdout, " [num force]: Optional. The element in which we are intersted\n");
204 fprintf(stdout, " In this case the output is a cost file and the force\n");
205 fprintf(stdout, " is scaled to [0,1], as required for plotting.\n");
206 fprintf(stdout, " [mode]: Optional and only if num_force is given. Exponential used when\n");
207 fprintf(stdout, " scaling the values to the [0,1] range. This is used to exaggerate\n");
208 fprintf(stdout, " the values around 0 or around 1 depending of whether this parameter\n");
209 fprintf(stdout, " is negative of possitive. The larger the absolute value, the larger the\n");
210 fprintf(stdout, " exageration.\n");
211 fprintf(stdout, " File extensions are not required\n");
214 return(EXIT_SUCCESS);
Tinterval * GetBoxInterval(unsigned int n, Tbox *b) Returns a pointer to one of the intervals defining the box.
unsigned int WorldForceVarsIndices(Tparameters *p, unsigned int **iv, Tworld *w) Creates an array with the indices of the force variables.
#define NEW(_var, _n, _type) Allocates memory space.
Data structure to hold the information about the name of a file.
#define FORCES_EXT File extension for files including forces.
#define COST_EXT File extension for arrays of costs.
void Error(const char *s) General error function.
#define PARAM_EXT File extension for parameter files.
All the necessary information to generate equations for mechanisms.
Definition of the Tworld type and the associated functions.
void DeleteWorld(Tworld *w) Destructor.
unsigned int GetBoxNIntervals(Tbox *b) Box dimensionality.
void SaveVector(FILE *f, unsigned int n, double *v) Saves a vector.
Error and warning functions.
void DeleteFileName(Tfilename *fn) Destructor.
int ReadBox(FILE *f, Tbox *b) Reads a box from a file.
void CreateFileName(char *path, char *name, char *suffix, char *ext, Tfilename *fn) Constructor.
void InitParametersFromFile(char *file, Tparameters *p) Constructor from a file.
void Vector2Range(double l, double u, double mode, unsigned int m, double *v) Scales a vector to a given range.
char * GetFileFullName(Tfilename *fn) Gets the file full name (paht+name+extension).
#define SOL_EXT File extension for solution files.
boolean InitWorldFromFile(Tparameters *p, boolean error, char *fn, Tworld *w) Constructor.
double IntervalCenter(Tinterval *i) Gets the interval center.
void DeleteParameters(Tparameters *p) Destructor.
void DeleteBox(void *b) Destructor.
int main(int argc, char **arg) Main body of the cuikworldforces application.
|
Follow us!