Rosetta 3.5
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
core
sequence
ScoringScheme.cc
Go to the documentation of this file.
1
// -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2
// vi: set ts=2 noet:
3
//
4
// (c) Copyright Rosetta Commons Member Institutions.
5
// (c) This file is part of the Rosetta software suite and is made available under license.
6
// (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7
// (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8
// (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9
10
/// @file ScoringScheme.cc
11
/// @brief abstract base class for representing scoring schemes for alignments.
12
13
// Unit headers
14
#include <
core/sequence/ScoringScheme.fwd.hh
>
15
16
#include <
core/types.hh
>
17
#include <
core/sequence/Sequence.fwd.hh
>
18
#include <
core/sequence/ScoringScheme.hh
>
19
20
#include <utility/exit.hh>
21
#include <utility/io/izstream.fwd.hh>
22
#include <utility/file/FileName.fwd.hh>
23
#include <utility/pointer/ReferenceCount.hh>
24
25
// AUTO-REMOVED #include <iostream>
26
#include <string>
27
#include <complex>
28
29
namespace
core {
30
namespace
sequence {
31
32
/// @brief ctor
33
ScoringScheme::ScoringScheme
() {}
34
35
/// @brief dtor
36
ScoringScheme::~ScoringScheme
() {}
37
38
/// @brief Initialize from a file.
39
void
ScoringScheme::read_from_file
(
40
utility::file::FileName
const
&
/*fn*/
41
) {
42
unimplemented_method_error
(
"read_from_file"
);
43
}
44
45
void
ScoringScheme::read_data
( utility::io::izstream &
/*input*/
) {
46
unimplemented_method_error
(
"read_data"
);
47
}
48
49
/// @brief Gets the gap opening penalty.
50
Real
ScoringScheme::gap_open
()
const
{
51
return
gap_open_
;
52
}
53
54
/// @brief Gets the gap extension penalty.
55
Real
ScoringScheme::gap_extend
()
const
{
56
return
gap_extend_
;
57
}
58
59
/// @brief Sets the gap opening penalty.
60
void
ScoringScheme::gap_open
(
Real
const
gap_open ) {
61
gap_open_
=
gap_open
;
62
}
63
64
/// @brief Sets the gap extension penalty.
65
void
ScoringScheme::gap_extend
(
Real
const
gap_extend ) {
66
gap_extend_
=
gap_extend
;
67
}
68
69
/// @brief getters for type, which is a unique string name for this object.
70
std::string
ScoringScheme::type
()
const
{
71
return
type_
;
72
}
73
74
/// @brief getters for type, which is a unique string name for this object.
75
void
ScoringScheme::type
(
std::string
new_type ) {
76
type_
= new_type;
77
}
78
79
/// @brief Utility method for producing useful error messages and exiting
80
/// from program. Declared const which is funny, because exiting the program
81
/// certainly changes the state of this object! This might be replaced with
82
/// exception handling if we ever start using those.
83
void
ScoringScheme::unimplemented_method_error
(
84
std::string
const
& method_name
85
)
const
{
86
utility_exit_with_message(
87
"Called ScoringScheme::"
+ method_name +
" method from derived class "
+
88
type
() +
","
+
"ended up in ScoringScheme::"
+ method_name +
"\n"
89
);
90
}
91
92
bool
ScoringScheme::is_good
(
93
Real
const
& num
94
) {
95
static
Real
const
TOL(1e-5);
96
using
std::abs;
97
return
(
98
abs( num - 9999.000 ) > TOL && abs( num - 0 ) > TOL
99
);
100
}
101
102
}
// sequence
103
}
// core
Generated on Sat Jun 1 2013 11:40:22 for Rosetta 3.5 by
1.8.4