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
scoring
EnergyMap.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 core/scoring/EnergyMap.cc
11
/// @brief Vector of scores implementation
12
/// @author Andrew Leaver-Fay (aleaverfay@gmail.com)
13
14
15
// Unit Headers
16
#include <
core/scoring/EnergyMap.hh
>
17
18
// Package Headers
19
#include <
core/scoring/ScoreType.hh
>
20
21
#include <ObjexxFCL/format.hh>
22
23
#include <utility/vector1.hh>
24
25
26
27
namespace
core {
28
namespace
scoring {
29
30
void
31
EMapVector::print
()
const
32
{
33
std::cout <<
"( "
;
34
for
(
int
ii = 0; ii <
n_score_types
; ++ii ) {
35
if
( ii != 0 ) std::cout <<
", "
;
36
std::cout <<
name_from_score_type
(
ScoreType
( ii + 1 ) ) <<
"="
<<
map_
[ ii ];
37
if
( ii % 3 == 2 && ii != n_score_types ) std::cout << std::endl;
38
}
39
std::cout <<
")"
<< std::endl;
40
}
41
42
43
void
44
EMapVector::show_if_nonzero_weight
( std::ostream & out,
EMapVector
const
& weights )
const
45
{
46
for
(
int
ii = 1; ii <=
n_score_types
; ++ii ) {
47
if
( weights[
ScoreType
(ii) ] != 0.0 ) {
48
Real
const
val(
operator
[](
ScoreType
(ii) ) );
49
out <<
' '
<<
ScoreType
(ii) <<
": "
<< ObjexxFCL::fmt::F(9,3,val);
50
}
51
}
52
}
53
54
55
void
56
EMapVector::show_weighted
( std::ostream & out,
EMapVector
const
& weights )
const
57
{
58
for
(
int
ii = 1; ii <=
n_score_types
; ++ii ) {
59
Real
const
weight( weights[
ScoreType
(ii) ] );
60
if
( weight != 0.0 ) {
61
Real
const
val(
operator
[](
ScoreType
(ii) ) );
62
out <<
' '
<<
ScoreType
(ii) <<
": "
<< ObjexxFCL::fmt::F(9,3, weight * val );
63
}
64
}
65
}
66
67
68
std::string
69
EMapVector::weighted_string_of
(
EMapVector
const
& weights )
const
70
{
71
std::ostringstream os;
72
show_weighted
( os, weights );
73
return
os.str();
74
}
75
76
77
78
}
// scoring
79
}
// core
Generated on Sat Jun 1 2013 11:36:45 for Rosetta 3.5 by
1.8.4