File: termgaps.cpp

package info (click to toggle)
muscle 3.60-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,384 kB
  • ctags: 2,079
  • sloc: cpp: 26,452; xml: 185; makefile: 101
file content (36 lines) | stat: -rw-r--r-- 794 bytes parent folder | download | duplicates (13)
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
#include "muscle.h"
#include "profile.h"

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

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

	switch (g_TermGaps)
		{
	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");
		}
	}