-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_inputs.h
52 lines (48 loc) · 1.71 KB
/
ext_inputs.h
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
#ifndef _EXT_INPUTS_H
#define _EXT_INPUTS_H 1
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <gsl/gsl_math.h>
#include "utils.h"
/* A list containing the properties of
* the external stimulation pulses */
struct pulse {
double time_onset;
double duration;
double theta;
double Imax;
double concentration;
double *precomputed_value;
_Bool switched_on; /* this switch avoids redundant checks */
struct pulse *next; /* next in the list */
};
/* 2D version. Pulses are assumed to be isotropic */
struct pulse_2D {
double time_onset;
double duration;
double theta1;
double theta2;
double Imax;
double concentration;
double *precomputed_value;
_Bool switched_on; /* this switch avoids redundant checks */
struct pulse_2D *next; /* next in the list */
};
/* ext_inputs.c */
struct pulse *new_pulse(int N, double t, double d, double q, double input,
double m);
struct pulse_2D *new_pulse_2D(int N1, int N2, double t, double d, double q1,
double q2, double input, double m);
double *precompute_vector_pulses(int N, struct pulse *plse);
double *precompute_vector_pulses_2D(int N1, int N2, struct pulse_2D *plse);
struct pulse *append_pulse(struct pulse *plse, struct pulse *newplse);
struct pulse_2D *append_pulse_2D(struct pulse_2D *plse,
struct pulse_2D *newplse);
void print_pulses(struct pulse *plse);
void print_pulses_2D(struct pulse_2D *plse);
double max_amplitude_pulse(struct pulse *plse);
double max_amplitude_pulse_2D(struct pulse_2D *plse);
void free_extinputs(struct pulse *plse);
void free_extinputs_2D(struct pulse_2D *plse);
#endif