.TH "/home/serge/sources/hyantes/src/hyantes.c" 3 "Sun May 20 2012" "Hyantes" \" \-*- nroff \-*- .ad l .nh .SH NAME /home/serge/sources/hyantes/src/hyantes.c \- .PP core of hyantes .SH SYNOPSIS .br .PP .SS "Defines" .in +1c .ti -1.c .RI "#define \fBPOW2\fP(a) ((a)*(a))" .br .ti -1.c .RI "#define \fBAMORTIZED_DISK\fP(pot, dst, res, range) do{res=((pot)/(1+(dst)));}while (0)" .br .ti -1.c .RI "#define \fBSMOOTHING_FUN\fP AMORTIZED_DISK" .br .ti -1.c .RI "#define \fBDISK\fP(pot, dst, res, range) do{res=(pot);}while (0)" .br .ti -1.c .RI "#define \fBSMOOTHING_FUN\fP DISK" .br .ti -1.c .RI "#define \fBGAUSSIAN\fP(pot, dst, res, range) do{res=(pot)*(exp(-(M_PI/(4\&.*POW2(range)))*POW2(dst)));} while (0)" .br .ti -1.c .RI "#define \fBSMOOTHING_FUN\fP GAUSSIAN" .br .ti -1.c .RI "#define \fBEXPONENTIAL\fP(pot, dst, res, range) do{res=(pot)*(exp(-(2\&./(range))*(dst)));} while (0)" .br .ti -1.c .RI "#define \fBSMOOTHING_FUN\fP EXPONENTIAL" .br .ti -1.c .RI "#define \fBPARETO\fP(pot, dst, res, range) do{data_t tmp = POW2(dst); res=(pot)*(1\&./(1+(2/(range)*POW2(tmp))));} while (0)" .br .ti -1.c .RI "#define \fBSMOOTHING_FUN\fP PARETO" .br .in -1.c .SS "Functions" .in +1c .ti -1.c .RI "static void \fBdo_run\fP (\fBhs_coord_t\fP visu, data_t lonStep, data_t latStep, data_t range, size_t lonRange, size_t latRange, size_t nb, \fBhs_potential_t\fP plots[latRange][lonRange], \fBhs_potential_t\fP the_towns[nb], \fBhs_config_t\fP *configuration)" .br .RI "\fIdispatch call to the right smoothing function \fP" .ti -1.c .RI "static \fBhs_potential_t\fP * \fBhs_read_towns\fP (FILE *fd, size_t *len, \fBhs_config_t\fP *config)" .br .RI "\fIreads a file containing towns and parse it \fP" .ti -1.c .RI "void \fBhs_display\fP (size_t lonRange, size_t latRange, \fBhs_potential_t\fP pt[latRange][lonRange])" .br .RI "\fIdisplays the matrix of processed potentials \fP" .ti -1.c .RI "\fBhs_potential_t\fP * \fBhs_smooth\fP (int _resoLat, int _resoLon, \fBhs_coord_t\fP visu, FILE *pFileReference)" .br .RI "\fIperforms the smoothing of target area inside visu, using potentials from pFileReference the smoothing is performed using smoothing method given by hs_set(HS_SMOOTH_FUNC, \&.\&.\&. ) the resolution of the output matrix will be resoLat x resoLon \fP" .ti -1.c .RI "const char ** \fBhs_list_smoothing\fP (size_t *sz)" .br .RI "\fIlist all available smoothing methods that can be configured using hs_config \fP" .ti -1.c .RI "unsigned long \fBhs_status\fP ()" .br .RI "\fIobserver of the execution of the computation \fP" .ti -1.c .RI "\fBhs_potential_t\fP * \fBhs_smooth_r\fP (int _resoLat, int _resoLon, \fBhs_coord_t\fP visu, FILE *pFileReference, \fBhs_config_t\fP *configuration)" .br .RI "\fIperforms the smoothing of target area inside visu, using potentials from pFileReference and using given hs_config the smoothing is performed using smoothing method acording to the configuration given in the arguments the resolution of the output matrix will be resoLat x resoLon \fP" .ti -1.c .RI "\fBhs_potential_t\fP * \fBhs_smoothing\fP (int _resoLat, int _resoLon, const char *function_name, double function_param, \fBhs_coord_t\fP visu, FILE *pFileReference)" .br .RI "\fIperform the smoothing of target area inside visu, using potentials from pFileReference the smoothing is performed using function_name smoothing method, with a radius of function_param the resolution of the output matrix will be resoLat x resoLon (obsolete function, use hs_smmoth_r instead) \fP" .in -1.c .SS "Variables" .in +1c .ti -1.c .RI "char const *const \fBfunc_names\fP []" .br .RI "\fIstatic array containg function names\&. each function must also be listed in func_ptrs in the same order \fP" .ti -1.c .RI "\fBhs_config_t\fP \fBg_config\fP = { NULL,0,0,0,500,0,0 }" .br .in -1.c .SH "Detailed Description" .PP core of hyantes \fBAuthor:\fP .RS 4 Sebastien Martinez and Serge Guelton .RE .PP \fBDate:\fP .RS 4 2011-06-01 .RE .PP This file is part of hyantes\&. .PP hyantes is free software; you can redistribute it and/or modify it under the terms of the CeCILL-C License .PP You should have received a copy of the CeCILL-C License along with this program\&. If not, see \&. .PP Definition in file \fBhyantes\&.c\fP\&. .SH "Function Documentation" .PP .SS "void \fBhs_display\fP (size_tlonRange, size_tlatRange, \fBhs_potential_t\fPpt[latRange][lonRange])" .PP displays the matrix of processed potentials \fBParameters:\fP .RS 4 \fIlonRange\fP the longitudinal resolution of the matrix .br \fIlatRange\fP the resolution of the matrix .br \fIpt\fP the matrix of potential which is of size latRange by lonRange .RE .PP .PP Definition at line 180 of file hyantes\&.c\&. .SS "const char** \fBhs_list_smoothing\fP (size_t *sz)" .PP list all available smoothing methods that can be configured using hs_config \fBParameters:\fP .RS 4 \fIpointer\fP to the number of smoothing methods .RE .PP \fBReturns:\fP .RS 4 array of string constant of size *sz\&. Memory is still owned by hyantes .RE .PP .PP Definition at line 219 of file hyantes\&.c\&. .PP References func_names\&. .PP Referenced by vhs_set_r()\&. .SS "static \fBhs_potential_t\fP* \fBhs_read_towns\fP (FILE *fd, size_t *len, \fBhs_config_t\fP *config)\fC [static]\fP" .PP reads a file containing towns and parse it \fBParameters:\fP .RS 4 \fIfd\fP file containg the towns .br \fIlen\fP pointer to the number of towns .RE .PP \fBReturns:\fP .RS 4 a vector of towns .RE .PP .PP Definition at line 120 of file hyantes\&.c\&. .PP References hs_config_t::herrno, hs_potential::lat, and hs_potential::lon\&. .PP Referenced by hs_smooth_r()\&. .SS "\fBhs_potential_t\fP* \fBhs_smooth\fP (int_resoLat, int_resoLon, \fBhs_coord_t\fPvisu, FILE *pFileReference)" .PP performs the smoothing of target area inside visu, using potentials from pFileReference the smoothing is performed using smoothing method given by hs_set(HS_SMOOTH_FUNC, \&.\&.\&. ) the resolution of the output matrix will be resoLat x resoLon \fBParameters:\fP .RS 4 \fI_resoLat\fP number of latitude points computed .br \fI_resoLon\fP number of longitude points computed .br \fIvisu\fP visualization window .br \fIpFileReference\fP file containg the data in the format latitude longitude potential latitude longitude potential \&.\&.\&. latitude longitude potential where latitude and longitude are given in degrees .RE .PP \fBReturns:\fP .RS 4 an allocated array of size resoLat x resoLon containing a struct (lat, lon, pot) or NULL if an error occured .RE .PP .PP Definition at line 209 of file hyantes\&.c\&. .PP References hs_smooth_r()\&. .SS "\fBhs_potential_t\fP* \fBhs_smooth_r\fP (int_resoLat, int_resoLon, \fBhs_coord_t\fPvisu, FILE *pFileReference, \fBhs_config_t\fP *configuration)" .PP performs the smoothing of target area inside visu, using potentials from pFileReference and using given hs_config the smoothing is performed using smoothing method acording to the configuration given in the arguments the resolution of the output matrix will be resoLat x resoLon \fBParameters:\fP .RS 4 \fI_resoLat\fP number of latitude points computed .br \fI_resoLon\fP number of longitude points computed .br \fIvisu\fP visualization window .br \fIpFileReference\fP file containg the data in the format latitude longitude potential latitude longitude potential \&.\&.\&. latitude longitude potential where latitude and longitude are given in degrees .br \fIconfiguration\fP configuration to use .RE .PP \fBReturns:\fP .RS 4 an allocated array of size resoLat x resoLon containing structs (lat, lon, pot) or NULL if an error occured .RE .PP .PP Definition at line 252 of file hyantes\&.c\&. .PP References do_run(), hs_config_t::herrno, hs_read_towns(), hs_coord::mLat, hs_coord::MLat, hs_coord::mLon, and hs_coord::MLon\&. .PP Referenced by hs_smooth(), and hs_smoothing()\&. .SS "\fBhs_potential_t\fP* \fBhs_smoothing\fP (int_resoLat, int_resoLon, const char *function_name, doublefunction_param, \fBhs_coord_t\fPvisu, FILE *pFileReference)" .PP perform the smoothing of target area inside visu, using potentials from pFileReference the smoothing is performed using function_name smoothing method, with a radius of function_param the resolution of the output matrix will be resoLat x resoLon (obsolete function, use hs_smmoth_r instead) \fBParameters:\fP .RS 4 \fI_resoLat\fP number of latitude points computed .br \fI_resoLon\fP number of longitude points computed .br \fIfunction_name\fP name of a smoothing method listed by hs_list_smoothing .br \fIparameter\fP (in kilometers) of the smoothing method .br \fIvisu\fP visualization window .br \fIfile\fP containg the data in the format latitude longitude potential latitude longitude potential \&.\&.\&. latitude longitude potential where latitude and longitude are given in degrees .RE .PP \fBReturns:\fP .RS 4 an allocated array of size resoLat x resoLon containing structs (lat, lon, pot) .RE .PP .PP Definition at line 302 of file hyantes\&.c\&. .PP References hs_set_r(), HS_SMOOTH_FUNC, and hs_smooth_r()\&. .SS "unsigned long \fBhs_status\fP ()" .PP observer of the execution of the computation \fBReturns:\fP .RS 4 number of computed input potential points from the beginning of the computation .RE .PP .PP Definition at line 228 of file hyantes\&.c\&. .PP References hs_config_t::status\&. .SH "Variable Documentation" .PP .SS "char const* const \fBfunc_names\fP[]"\fBInitial value:\fP .PP .nf { 'disk', 'amortized_disk', 'gaussian', 'exponential', 'pareto' } .fi .PP static array containg function names\&. each function must also be listed in func_ptrs in the same order .PP Definition at line 29 of file hyantes\&.c\&. .PP Referenced by hs_list_smoothing(), and vhs_set_r()\&. .SH "Author" .PP Generated automatically by Doxygen for Hyantes from the source code\&.