openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
trace.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // openCARP is an open cardiac electrophysiology simulator.
3 //
4 // Copyright (C) 2020 openCARP project
5 //
6 // This program is licensed under the openCARP Academic Public License (APL)
7 // v1.0: You can use and redistribute it and/or modify it in non-commercial
8 // academic environments under the terms of APL as published by the openCARP
9 // project v1.0, or (at your option) any later version. Commercial use requires
10 // a commercial license (info@opencarp.org).
11 //
12 // This program is distributed without any warranty; see the openCARP APL for
13 // more details.
14 //
15 // You should have received a copy of the openCARP APL along with this program
16 // and can find it online: http://www.opencarp.org/license
17 // ----------------------------------------------------------------------------
18 
19 #ifndef TRACE_H
20 #define TRACE_H
21 
22 namespace limpet {
23 
25 struct trace {
26  int N;
27  double *t;
28  float *s;
29  double dur;
30  double dt;
31  bool eqdist;
32 };
33 
34 // trailing underscore added to avoid clash with bidomain.h
35 // Stimulation.c needs to be modified to make use of traces as used in here
37 
38  int read_trace(trace *tr, const char *name );
39  void free_trace(trace *tr);
40  void resample_trace(trace *tr, double dt );
41  void interp1(const double *x, const float *y, int N, double *xi, float *yi, int NI, double dxi, IpMeth_t);
42  double trace_duration(trace *tr, const char* f);
43 
44 } // namespace limpet
45 
46 #endif
47 
void free_trace(trace *tr)
Definition: trace.cc:76
int read_trace(trace *tr, const char *name)
Definition: trace.cc:43
void resample_trace(trace *tr, double dt)
Definition: trace.cc:115
double dur
duration
Definition: trace.h:29
double dt
sampling interval if equidistant samples
Definition: trace.h:30
bool eqdist
sampling intervals are equidistant
Definition: trace.h:31
double * t
time vector
Definition: trace.h:27
double trace_duration(trace *tr, const char *f)
Definition: trace.cc:147
float * s
samples
Definition: trace.h:28
enum limpet::ip_method IpMeth_t
int N
number of samples
Definition: trace.h:26
ip_method
Definition: trace.h:36
manage input, output, resampling of traces
Definition: trace.h:25
void interp1(const double *x, const float *y, int N, double *xi, float *yi, int NI, double dxi, IpMeth_t meth)
Definition: trace.cc:189