samples.h
Go to the documentation of this file.
1 #ifndef SAMPLESH
2 #define SAMPLESH
3 
4 #include "chart.h"
5 #include "parameters.h"
6 #include "link.h"
7 #include "filename.h"
8 
28 #define INIT_NUM_SAMPLES 100
29 
37 #define RRT_PATH_NODES 0
38 
39 
47 #define SMOOTH_RANDOM 0
48 
57 #define SMOOTH_GRADIENT 1
58 
59 
67 #define SMOOTH_SHORTCUT 2
68 
79 #define DEFAULT_CONNECT ConnectSamplesChart
80 
91 void InitSamples(unsigned int *ms,unsigned int *ns,double ***path);
92 
119 void SmoothSamples(Tparameters *pr,boolean parallel,int mode,
120  unsigned int maxIterations,
121  unsigned int ns,double **path,
122  unsigned int *sns,double ***spath,TAtlasBase *w);
123 
137 void ConcatSamples(unsigned int nvs,
138  unsigned int ns1,double **path1,
139  unsigned int ns2,double **path2,
140  unsigned int *ns,double ***path);
141 
157 void ReverseConcatSamples(unsigned int nvs,
158  unsigned int ns1,double **path1,
159  unsigned int ns2,double **path2,
160  unsigned int *ns,double ***path);
161 
170 void ReverseSamples(unsigned int ns,double **path);
171 
188 void AddSample2Samples(unsigned int nv,double *sample,
189  unsigned int nvs,boolean *systemVars,
190  unsigned int *ms,unsigned int *ns,double ***path);
191 
238 double ConnectSamplesChart(Tparameters *pr,unsigned int *tp,
239  Tbox *domain,
240  unsigned int m,unsigned int n,
241  double *s1,double *s2,
242  double md,boolean checkCollisions,
243  boolean *reached,boolean *collision,double *lastSample,
244  unsigned int *ns,double ***path,
245  TAtlasBase *w);
246 
286 double ConnectSamples(Tparameters *pr,unsigned int *tp,
287  Tbox *domain,
288  unsigned int m,unsigned int n,
289  double *s1,double *s2,
290  double md,boolean checkCollisions,
291  boolean *reached,boolean *collision,double *lastSample,
292  unsigned int *ns,double ***path,
293  TAtlasBase *w);
294 
313 unsigned int ReadOneSample(Tparameters *p,char *fname,unsigned int nvs,double **s);
314 
334 unsigned int ReadTwoSamples(Tparameters *p,char *fname,unsigned int nvs,double **s1,double **s2);
335 
348 void SaveSamples(char *fname,boolean smooth,unsigned int nvs,
349  unsigned int ns,double **path);
350 
366 void SaveSamplesN(char *fname,boolean smooth,unsigned int n,unsigned int nvs,
367  unsigned int ns,double **path);
380 /*boolean LoadSamples(char *fname,boolean smooth,unsigned int *nvs,
381  unsigned int *ns,double ***path);*/
382 
383 boolean LoadSamples(Tfilename fname,unsigned int *nvs,
384  unsigned int *ns,double ***path);
385 
386 
404 void PlotSamples(Tparameters *p,Tplot3d *p3d,
405  unsigned int xID,unsigned int yID,unsigned int zID,
406  unsigned int ns,double **path);
407 
416 void DeleteSamples(unsigned int ns,double **path);
417 
418 #endif
Data structure to hold the information about the name of a file.
Definition: filename.h:248
Definition of the Tfilename type and the associated functions.
double ConnectSamplesChart(Tparameters *pr, unsigned int *tp, Tbox *domain, unsigned int m, unsigned int n, double *s1, double *s2, double md, boolean checkCollisions, boolean *reached, boolean *collision, double *lastSample, unsigned int *ns, double ***path, TAtlasBase *w)
Determines the connection between two points on the manifold.
Definition: samples.c:172
void ReverseConcatSamples(unsigned int nvs, unsigned int ns1, double **path1, unsigned int ns2, double **path2, unsigned int *ns, double ***path)
Reverses and concats a path.
Definition: samples.c:1171
void SmoothSamples(Tparameters *pr, boolean parallel, int mode, unsigned int maxIterations, unsigned int ns, double **path, unsigned int *sns, double ***spath, TAtlasBase *w)
Path smoothing.
Definition: samples.c:1033
A 3D plot.
Definition: plot3d.h:54
void AddSample2Samples(unsigned int nv, double *sample, unsigned int nvs, boolean *systemVars, unsigned int *ms, unsigned int *ns, double ***path)
Adds a sample to a set of samples.
Definition: samples.c:150
unsigned int ReadTwoSamples(Tparameters *p, char *fname, unsigned int nvs, double **s1, double **s2)
Reads two samples from a file.
Definition: samples.c:1247
void PlotSamples(Tparameters *p, Tplot3d *p3d, unsigned int xID, unsigned int yID, unsigned int zID, unsigned int ns, double **path)
Plots a 3D projection of a path.
Definition: samples.c:1399
A table of parameters.
Type defining the equations on which the atlas is defined.
Definition: wcs.h:30
Definition of a local chart on a manifold.
A box.
Definition: box.h:83
void ReverseSamples(unsigned int ns, double **path)
Reverses a set of samples.
Definition: samples.c:1196
boolean LoadSamples(Tfilename fname, unsigned int *nvs, unsigned int *ns, double ***path)
Reads a set of samples from file.
Definition: samples.c:1352
void InitSamples(unsigned int *ms, unsigned int *ns, double ***path)
Initializes a set of samples.
Definition: samples.c:143
void SaveSamples(char *fname, boolean smooth, unsigned int nvs, unsigned int ns, double **path)
Saves a set of samples to a file.
Definition: samples.c:1318
double ConnectSamples(Tparameters *pr, unsigned int *tp, Tbox *domain, unsigned int m, unsigned int n, double *s1, double *s2, double md, boolean checkCollisions, boolean *reached, boolean *collision, double *lastSample, unsigned int *ns, double ***path, TAtlasBase *w)
Determines the connection between two points on the manifold.
Definition: samples.c:434
void SaveSamplesN(char *fname, boolean smooth, unsigned int n, unsigned int nvs, unsigned int ns, double **path)
Saves a set of samples to a file.
Definition: samples.c:1333
void DeleteSamples(unsigned int ns, double **path)
Deletes the space used by a set of samples.
Definition: samples.c:1495
Definition of the Tparameters type and the associated functions.
unsigned int ReadOneSample(Tparameters *p, char *fname, unsigned int nvs, double **s)
Reads one sample from a file.
Definition: samples.c:1216
void ConcatSamples(unsigned int nvs, unsigned int ns1, double **path1, unsigned int ns2, double **path2, unsigned int *ns, double ***path)
Concats two path.
Definition: samples.c:1150