File: termgaps.cpp

package info (click to toggle)
libmuscle 3.7%2B4565-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,828 kB
  • ctags: 2,200
  • sloc: cpp: 27,959; makefile: 55; sh: 26
file content (39 lines) | stat: -rw-r--r-- 852 bytes parent folder | download | duplicates (5)
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
#include "libMUSCLE/muscle.h"
#include "libMUSCLE/profile.h"

namespace muscle {

void SetTermGaps(const ProfPos *Prof, unsigned uLength)
	{
	if (0 == uLength)
		return;

	ProfPos *First = (ProfPos *) Prof;
	ProfPos *Last = (ProfPos *) (Prof + uLength - 1);

	switch (g_TermGaps.get())
		{
	case TERMGAPS_Full:
		break;

	case TERMGAPS_Half:
	// -infinity check for lock left/right
		if (First->m_scoreGapOpen != MINUS_INFINITY)
			First->m_scoreGapOpen = 0;

		if (uLength > 1 && Last->m_scoreGapClose != MINUS_INFINITY)
			Last->m_scoreGapClose = 0;

	case TERMGAPS_Ext:
		if (First->m_scoreGapOpen != MINUS_INFINITY)
			First->m_scoreGapOpen *= -1;

		if (uLength > 1 && Last->m_scoreGapClose != MINUS_INFINITY)
			Last->m_scoreGapClose *= -1;
		break;

	default:
		Quit("Invalid g_TermGaps.get()");
		}
	}
}