-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathECGSignal.cpp
50 lines (38 loc) · 995 Bytes
/
ECGSignal.cpp
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
#include "ECGSignal.h"
WrappedVector::WrappedVector (gsl_vector * _signal)
: signal(_signal)
{}
WrappedVector::~WrappedVector ()
{
if (signal) gsl_vector_free (signal);
}
double WrappedVector::get(size_t it)
{
return gsl_vector_get(signal, it);
}
void WrappedVector::set(size_t it, double value)
{
gsl_vector_set(signal, it, value);
}
WrappedVectorInt::WrappedVectorInt( gsl_vector_int * _signal /*= NULL*/ )
: signal(_signal)
{}
WrappedVectorInt::~WrappedVectorInt()
{
if (signal) gsl_vector_int_free (signal);
}
int WrappedVectorInt::get(size_t it)
{
return gsl_vector_int_get(signal, it);
}
void WrappedVectorInt::set(size_t it, int value)
{
gsl_vector_int_set(signal, it, value);
}
void ECGSignal::setSize(size_t n)
{
channel_one = ECGSignalChannel(new WrappedVector);
channel_one->signal = gsl_vector_alloc(n);
channel_two = ECGSignalChannel(new WrappedVector);
channel_two->signal = gsl_vector_alloc(n);
}