File: legion_interface.h

package info (click to toggle)
python-pyclustering 0.10.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 11,128 kB
  • sloc: cpp: 38,888; python: 24,311; sh: 384; makefile: 105
file content (118 lines) | stat: -rwxr-xr-x 4,477 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*!

@authors Andrei Novikov (pyclustering@yandex.ru)
@date 2014-2020
@copyright BSD-3-Clause

*/

#pragma once


#include <pyclustering/interface/pyclustering_package.hpp>

#include <pyclustering/definitions.hpp>


/**
 *
 * @brief   Create instance of LEGION (local excitatory global inhibitory oscillatory network).
 * @details Caller should destroy returned instance using 'legion_destroy' when it is not required anymore.
 *
 * @param[in] p_size: Number of oscillators in the network.
 * @param[in] p_connection_type: Type of connection between oscillators in the network.
 * @param[in] p_parameters: Parameters of the network that are defined by structure 'legion_parameters'.
 *
 * @return  Returns pointer to LEGION instance.
 *
 */
extern "C" DECLARATION void * legion_create(const unsigned int p_size, const unsigned int p_connection_type, const void * const p_parameters);

/**
 *
 * @brief   Destroy 'legion_network'.
 *
 * @param[in] p_network_pointer: Pointer to instance of LEGION.
 *
 */
extern "C" DECLARATION void legion_destroy(const void * p_network_pointer);

/**
 *
 * @brief   Performs static simulation of LEGION oscillatory network.
 * @details Returned output dynamic of the network should be destoyed by 'legion_dynamic_destroy'.
 *
 * @param[in] p_network_pointer: Pointer to instance of LEGION.
 * @param[in] p_steps: Number steps of simulations during simulation.
 * @param[in] p_time: Time of simulation.
 * @param[in] p_solver: Method that is used for differential equation.
 * @param[in] p_collect_dynamic: If true - returns whole dynamic of oscillatory network, otherwise returns only last values of dynamics.
 * @param[in] p_stimulus: Stimulus for oscillators, number of stimulus should be equal to number of oscillators,
 *             example of stimulus for 5 oscillators [0, 0, 1, 1, 0], value of stimulus is defined by parameter 'I'.
 *
 * @return Pointer to dynamic of oscillatory network.
 *
 */
extern "C" DECLARATION void * legion_simulate(const void * p_network_pointer, 
                                              const unsigned int p_steps, 
                                              const double p_time, 
                                              const unsigned int p_solver, 
                                              const bool p_collect_dynamic, 
                                              const pyclustering_package * const p_stimulus);

/**
 *
 * @brief   Returns size of the oscillatory network (LEGION) that is defined by amount of oscillators.
 *
 * @param[in] p_network_pointer: Pointer to instance of LEGION.
 *
 */
extern "C" DECLARATION std::size_t legion_get_size(const void * p_network_pointer);

/**
 *
 * @brief   Destroy instance of output dynamic of LEGION.
 *
 * @param[in] p_dynamic_pointer: Pointer to instance of LEGION.
 *
 */
extern "C" DECLARATION void legion_dynamic_destroy(const void * p_dynamic_pointer);

/**
 *
 * @brief   Returns output dynamic (amplitude of the excitatory component) of each oscillator during simulation process that corresponds to time points.
 * @details Returned package should deallocated by 'free_pyclustering_package'.
 *
 * @param[in] p_dynamic_pointer: Pointer to output dynamic.
 *
 */
extern "C" DECLARATION pyclustering_package * legion_dynamic_get_output(const void * p_dynamic_pointer);

/**
 *
 * @brief   Returns output dynamic (amplitude of the inhibitory component) of each oscillator during simulation process that corresponds to time points.
 * @details Returned package should deallocated by 'free_pyclustering_package'.
 *
 * @param[in] p_dynamic_pointer: Pointer to output dynamic.
 *
 */
extern "C" DECLARATION pyclustering_package * legion_dynamic_get_inhibitory_output(const void * p_dynamic_pointer);

/**
 *
 * @brief   Returns time points of simulation process that corresponds to amplitude.
 * @details Returned package should deallocated by 'free_pyclustering_package'.
 *
 * @param[in] p_dynamic_pointer: Pointer to output dynamic.
 *
 */
extern "C" DECLARATION pyclustering_package * legion_dynamic_get_time(const void * p_dynamic_pointer);

/**
 *
 * @brief   Returns length of dynamic that is defined by amount of time-points of simulation process.
 *
 * @param[in] p_dynamic_pointer: Pointer to output dynamic.
 *
 */
extern "C" DECLARATION std::size_t legion_dynamic_get_size(const void * p_dynamic_pointer);