---
name: "hyantes"
section: "3"
platform: "linux"
package: "libhyantes-dev"
version: "1.3.0-1.1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/hyantes"
---

# hyantes(3)

core of hyantes

## NAME

/home/serge/sources/hyantes/src/hyantes.c -

core of hyantes

## SYNOPSIS

### Defines

\#define **POW2**(a)   ((a)\*(a))\
 \#define **AMORTIZED\_DISK**(pot, dst, res, range)   do{res=((pot)/(1+(dst)));}while (0)\
 \#define **SMOOTHING\_FUN**   AMORTIZED\_DISK\
 \#define **DISK**(pot, dst, res, range)   do{res=(pot);}while (0)\
 \#define **SMOOTHING\_FUN**   DISK\
 \#define **GAUSSIAN**(pot, dst, res, range)   do{res=(pot)\*(exp(-(M\_PI/(4.\*POW2(range)))\*POW2(dst)));} while (0)\
 \#define **SMOOTHING\_FUN**   GAUSSIAN\
 \#define **EXPONENTIAL**(pot, dst, res, range)   do{res=(pot)\*(exp(-(2./(range))\*(dst)));} while (0)\
 \#define **SMOOTHING\_FUN**   EXPONENTIAL\
 \#define **PARETO**(pot, dst, res, range)   do{data\_t tmp = POW2(dst); res=(pot)\*(1./(1+(2/(range)\*POW2(tmp))));} while (0)\
 \#define **SMOOTHING\_FUN**   PARETO\

### Functions

static void **do\_run** (**hs\_coord\_t** visu, data\_t lonStep, data\_t latStep, data\_t range, size\_t lonRange, size\_t latRange, size\_t nb, **hs\_potential\_t** plots\[latRange\]\[lonRange\], **hs\_potential\_t** the\_towns\[nb\], **hs\_config\_t** \*configuration)\
 *dispatch call to the right smoothing function*  static **hs\_potential\_t** \* **hs\_read\_towns** (FILE \*fd, size\_t \*len, **hs\_config\_t** \*config)\
 *reads a file containing towns and parse it*  void **hs\_display** (size\_t lonRange, size\_t latRange, **hs\_potential\_t** pt\[latRange\]\[lonRange\])\
 *displays the matrix of processed potentials*  **hs\_potential\_t** \* **hs\_smooth** (int \_resoLat, int \_resoLon, **hs\_coord\_t** visu, FILE \*pFileReference)\
 *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*  const char \*\* **hs\_list\_smoothing** (size\_t \*sz)\
 *list all available smoothing methods that can be configured using hs\_config*  unsigned long **hs\_status** ()\
 *observer of the execution of the computation*  **hs\_potential\_t** \* **hs\_smooth\_r** (int \_resoLat, int \_resoLon, **hs\_coord\_t** visu, FILE \*pFileReference, **hs\_config\_t** \*configuration)\
 *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*  **hs\_potential\_t** \* **hs\_smoothing** (int \_resoLat, int \_resoLon, const char \*function\_name, double function\_param, **hs\_coord\_t** visu, FILE \*pFileReference)\
 *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)*

### Variables

char const \*const **func\_names** \[\]\
 *static array containg function names. each function must also be listed in func\_ptrs in the same order*  **hs\_config\_t** **g\_config** = { NULL,0,0,0,500,0,0 }\

## Detailed Description

core of hyantes

**Author:**

Sebastien Martinez and Serge Guelton

**Date:**

2011-06-01

This file is part of hyantes.

hyantes is free software; you can redistribute it and/or modify it under the terms of the CeCILL-C License

You should have received a copy of the CeCILL-C License along with this program. If not, see \<http://www.cecill.info/licences\>.

Definition in file **hyantes.c**.

## Function Documentation

### void hs\_display (size\_tlonRange, size\_tlatRange, hs\_potential\_tpt\[latRange\]\[lonRange\])

displays the matrix of processed potentials **Parameters:**

*lonRange* the longitudinal resolution of the matrix \
 *latRange* the resolution of the matrix \
 *pt* the matrix of potential which is of size latRange by lonRange

Definition at line 180 of file hyantes.c.

### const char\*\* hs\_list\_smoothing (size\_t \*sz)

list all available smoothing methods that can be configured using hs\_config **Parameters:**

*pointer* to the number of smoothing methods

**Returns:**

array of string constant of size \*sz. Memory is still owned by hyantes

Definition at line 219 of file hyantes.c.

References func\_names.

Referenced by vhs\_set\_r().

### static hs\_potential\_t\* hs\_read\_towns (FILE \*fd, size\_t \*len, hs\_config\_t \*config)` [static]`

reads a file containing towns and parse it **Parameters:**

*fd* file containg the towns \
 *len* pointer to the number of towns

**Returns:**

a vector of towns

Definition at line 120 of file hyantes.c.

References hs\_config\_t::herrno, hs\_potential::lat, and hs\_potential::lon.

Referenced by hs\_smooth\_r().

### hs\_potential\_t\* hs\_smooth (int\_resoLat, int\_resoLon, hs\_coord\_tvisu, FILE \*pFileReference)

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 **Parameters:**

*\_resoLat* number of latitude points computed \
 *\_resoLon* number of longitude points computed \
 *visu* visualization window \
 *pFileReference* file containg the data in the format latitude longitude potential latitude longitude potential ... latitude longitude potential where latitude and longitude are given in degrees

**Returns:**

an allocated array of size resoLat x resoLon containing a struct (lat, lon, pot) or NULL if an error occured

Definition at line 209 of file hyantes.c.

References hs\_smooth\_r().

### hs\_potential\_t\* hs\_smooth\_r (int\_resoLat, int\_resoLon, hs\_coord\_tvisu, FILE \*pFileReference, hs\_config\_t \*configuration)

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 **Parameters:**

*\_resoLat* number of latitude points computed \
 *\_resoLon* number of longitude points computed \
 *visu* visualization window \
 *pFileReference* file containg the data in the format latitude longitude potential latitude longitude potential ... latitude longitude potential where latitude and longitude are given in degrees \
 *configuration* configuration to use

**Returns:**

an allocated array of size resoLat x resoLon containing structs (lat, lon, pot) or NULL if an error occured

Definition at line 252 of file hyantes.c.

References do\_run(), hs\_config\_t::herrno, hs\_read\_towns(), hs\_coord::mLat, hs\_coord::MLat, hs\_coord::mLon, and hs\_coord::MLon.

Referenced by hs\_smooth(), and hs\_smoothing().

### hs\_potential\_t\* hs\_smoothing (int\_resoLat, int\_resoLon, const char \*function\_name, doublefunction\_param, hs\_coord\_tvisu, FILE \*pFileReference)

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) **Parameters:**

*\_resoLat* number of latitude points computed \
 *\_resoLon* number of longitude points computed \
 *function\_name* name of a smoothing method listed by hs\_list\_smoothing \
 *parameter* (in kilometers) of the smoothing method \
 *visu* visualization window \
 *file* containg the data in the format latitude longitude potential latitude longitude potential ... latitude longitude potential where latitude and longitude are given in degrees

**Returns:**

an allocated array of size resoLat x resoLon containing structs (lat, lon, pot)

Definition at line 302 of file hyantes.c.

References hs\_set\_r(), HS\_SMOOTH\_FUNC, and hs\_smooth\_r().

### unsigned long hs\_status ()

observer of the execution of the computation **Returns:**

number of computed input potential points from the beginning of the computation

Definition at line 228 of file hyantes.c.

References hs\_config\_t::status.

## Variable Documentation

### char const\* const func\_names\[\] Initial value:

```
 {
    'disk',
    'amortized_disk',
    'gaussian',
    'exponential',
    'pareto'
}
```

static array containg function names. each function must also be listed in func\_ptrs in the same order

Definition at line 29 of file hyantes.c.

Referenced by hs\_list\_smoothing(), and vhs\_set\_r().

## Author

Generated automatically by Doxygen for Hyantes from the source code.
