-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKernel.h
51 lines (45 loc) · 1.03 KB
/
Kernel.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
#ifndef KERNEL_H
#define KERNEL_H
/// Abstract Kernel class
class Kernel {
public:
/**
* Return weight at OFFSET amino acids away from the boundary
* @param offset Distance from the boundary (in amino acids).
* Offset coordinates are zero-based
* @return kernel weight
*/
virtual double getWeight(int offset) = 0;
/**
* Set scoring window width
*/
virtual void setWidth(int width);
/**
* Sum of all kernel weights within a window, are under kernel
*/
virtual double weightSum();
virtual ~Kernel() {}
protected:
int width;
};
/// Box Kernel
class BoxKernel : public Kernel {
public:
double getWeight(int offset);
};
/// Triangular Kernel
class TriangularKernel : public Kernel {
public:
double getWeight(int offset);
};
/// Parabolic Kernel
class ParabolicKernel : public Kernel {
public:
double getWeight(int offset);
};
/// Triweight Kernel
class TriweightKernel : public Kernel {
public:
double getWeight(int offset);
};
#endif /* KERNEL_H */