cuikdim.c
Go to the documentation of this file.
1 #include "filename.h"
2 #include "error.h"
3 #include "parameters.h"
4 #include "atlas.h"
5 #include "samples.h"
6 
7 
8 #include <stdio.h>
9 #include <math.h>
10 
95 int main(int argc, char **arg)
96 {
97  Tparameters parameters;
98  TAtlasBase world;
99  Tfilename fparam;
100  double *configuration;
101  unsigned int k;
102 
103  if (argc>1)
104  {
105  /* Init parameters */
106  CreateFileName(NULL,arg[1],NULL,PARAM_EXT,&fparam);
107  fprintf(stderr,"Reading parameters : %s\n",GetFileFullName(&fparam));
108  InitParametersFromFile(GetFileFullName(&fparam),&parameters);
109 
110  /* Read the world/cuik from file */
111  CS_WD_INIT(&parameters,arg[1],&world);
112 
113  /* Read start sample */
114  ReadOneSample(&parameters,arg[1],CS_WD_GET_NUM_SYSTEM_VARS(&world),&configuration);
115 
116  /* Estimate the dimesion of the solution manifold*/
117  k=CS_WD_MANIFOLD_DIMENSION(&parameters,configuration,&world);
118  fprintf(stderr,"N_DOF = %u\n",k);
119 
120  free(configuration);
121  DeleteFileName(&fparam);
122  DeleteParameters(&parameters);
123  CS_WD_DELETE(&world);
124  }
125  else
126  {
127  fprintf(stderr,"Use:\n");
128  fprintf(stderr," cuikdim <problem_name> \n");
129  fprintf(stderr," <problem_name> the input problem.\n");
130  }
131 
132  return(EXIT_SUCCESS);
133 }