Rosetta
Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
core::scoring::EMapVector Class Reference

A vector for storing energy data, initially all values are 0. More...

#include <EnergyMap.hh>

Public Types

using const_iterator = MemberType::const_iterator
 
using iterator = MemberType::iterator
 

Public Member Functions

 EMapVector ()
 default constructor, initializes the energies to 0 More...
 
const_iterator begin () const
 const-iterator to the begining of the vector of energies More...
 
const_iterator end () const
 const-iterator to the end of the vector of energies More...
 
iterator begin ()
 non-const-iterator to the begining of the vector of energies More...
 
iterator end ()
 non-const-iterator to the end of the vector of energies More...
 
Real get (ScoreType st) const
 Returns the value for ScoreType <st> More...
 
Real set (ScoreType st, Real val)
 Sets the value for ScoreType <st> to <val> More...
 
Realoperator[] (ScoreType st)
 [] operator for getting a non-const reference to the energy for a ScoreType More...
 
Real operator[] (ScoreType st) const
 [] operator for getting the value for a ScoreType More...
 
void zero (ScoreTypes const &l)
 Zero a subset of the positions, as in calibrating a scale. More...
 
void zero ()
 Set every value to zero. More...
 
void clear ()
 Set every value to zero. More...
 
Real dot (EMapVector const &src) const
 Returns the dot product of this object with EMapVector <src> More...
 
Real dot (EMapVector const &src, ScoreTypes const &l) const
 dot product of two EMapVectors over a subset of the score types More...
 
EMapVectoroperator+= (EMapVector const &src)
 += operator, for summing energies More...
 
EMapVectoroperator-= (EMapVector const &src)
 -= operator, for subtracting energies More...
 
EMapVectoroperator*= (Real scalar)
 *= operator, for performing multiplication of a vector by a scalar More...
 
EMapVectoroperator*= (EMapVector const &src)
 *= operator, for performing element-by-element multiplication of two vectors More...
 
EMapVector operator* (Real scalar) const
 
  • operator, for performing multiplication of a vector by a scalar
More...
 
EMapVector operator* (EMapVector const &src) const
 
  • operator, for performing element-by-element multiplication of two vectors
More...
 
bool operator== (EMapVector const &src) const
 == operator for comparing two energy maps element by element More...
 
bool operator!= (EMapVector const &src) const
 != operator for comparing two energy maps element by element More...
 
void print () const
 print the contents of an emap vector to standard out More...
 
void accumulate (EMapVector const &src, ScoreTypes const &l)
 accumulate a subset of the positions More...
 
void accumulate (EMapVector const &src, ScoreTypes const &l, Real const wt)
 accumulate a subset of the positions with a common weight factor More...
 
Real sum () const
 Returns the sum of this vector. More...
 
Real norm_squared (ScoreTypes const &l) const
 accumulate the squared values of a subset of the positions More...
 
bool is_finite () const
 Check that there aren't any non-finite (inf, NaN) entries. More...
 
void show_nonzero (std::ostream &out) const
 Prints the non-zero positions of the energy map. More...
 
std::string show_nonzero () const
 convert the non-zero positions of the energy map to a string More...
 
void show_if_nonzero_weight (std::ostream &out, EMapVector const &weights) const
 write the energies in this energy map to the output stream for those score types that have non-zero values in the "weights" energy map. More...
 
void show_weighted (std::ostream &out, EMapVector const &weights) const
 write the weighted energies in this energy map to the output stream for those score types that have non-zero values in the "weights" energy map. More...
 
std::string weighted_string_of (EMapVector const &weights) const
 convert the weighted energies in this energy map to a string for those score types that have non-zero values in the "weights" energy map. More...
 

Private Types

using MemberType = std::array< Real, n_score_types >
 

Private Attributes

MemberType map_
 Grant access to private data to the TwoBodyEMapVector. More...
 

Detailed Description

A vector for storing energy data, initially all values are 0.

Note
: several methods using EMapVector objects add in values, be sure to use the zero method between uses

Common Methods: EMapVector.zero

Member Typedef Documentation

◆ const_iterator

using core::scoring::EMapVector::const_iterator = MemberType::const_iterator

◆ iterator

using core::scoring::EMapVector::iterator = MemberType::iterator

◆ MemberType

Constructor & Destructor Documentation

◆ EMapVector()

core::scoring::EMapVector::EMapVector ( )
inline

default constructor, initializes the energies to 0

References clear().

Member Function Documentation

◆ accumulate() [1/2]

void core::scoring::EMapVector::accumulate ( EMapVector const &  src,
ScoreTypes const &  l 
)
inline

◆ accumulate() [2/2]

void core::scoring::EMapVector::accumulate ( EMapVector const &  src,
ScoreTypes const &  l,
Real const  wt 
)
inline

accumulate a subset of the positions with a common weight factor

References operator[]().

◆ begin() [1/2]

iterator core::scoring::EMapVector::begin ( )
inline

non-const-iterator to the begining of the vector of energies

References map_.

◆ begin() [2/2]

const_iterator core::scoring::EMapVector::begin ( ) const
inline

◆ clear()

void core::scoring::EMapVector::clear ( )
inline

◆ dot() [1/2]

Real core::scoring::EMapVector::dot ( EMapVector const &  src) const
inline

Returns the dot product of this object with EMapVector <src>

Note
: useful for multiplying weights with scores

example(s): we = scorefxn.weights() emap.dot(we) See also: EMapVector ScoreFunction ScoreFunction.weights create_score_function

References map_, core::scoring::n_score_types, and protocols::analysis::total.

Referenced by core::scoring::Energies::accumulate_residue_total_energy(), protocols::protein_interface_design::movers::DockWithHotspotMover::apply(), protocols::flexpack::rotamer_set::FlexbbRotamerSet::bump_check(), protocols::nmr::bump_check(), core::pack::rotamer_set::bump_check(), core::pack::rotamers::SingleResidueRotamerLibrary::bump_check(), core::pack::rotamer_set::RotamerSet_::bump_check(), core::simple_metrics::metrics::InteractionEnergyMetric::calculate(), protocols::pack_daemon::PackDaemon::calculate_background_energies(), core::pack::compare_mingraph_and_energy_graph(), core::pack::compare_simple_inteaction_graph_alt_state_and_energy_graph(), protocols::simple_filters::ResidueSetChainEnergyFilter::compute(), protocols::sasa_scores::compute_avge_scores(), protocols::coupled_moves::CoupledMovesProtocol::compute_ligand_score_bonus(), core::pack::rotamer_set::RotamerSet_::compute_one_and_two_body_energies(), core::pack::rotamer_set::RotamerSet_::compute_one_body_energies(), core::pack::rotamer_set::symmetry::SymmetricRotamerSet_::compute_one_body_energies(), core::pack::interaction_graph::SymmOnTheFlyNode::compute_rotamer_pair_energy(), protocols::match::downstream::ScoringSecMatchRPE::eval_cd_2b_residues(), core::energy_methods::PairEnergy::evaluate_rotamer_background_energies(), core::scoring::methods::TwoBodyEnergy::evaluate_rotamer_background_energies(), core::scoring::methods::ShortRangeTwoBodyEnergy::evaluate_rotamer_background_energies(), core::scoring::methods::TwoBodyEnergy::evaluate_rotamer_intrares_energies(), core::pack::guidance_scoreterms::approximate_buried_unsat_penalty::ApproximateBuriedUnsatPenalty::evaluate_rotamer_intrares_energies(), core::scoring::methods::TwoBodyEnergy::evaluate_rotamer_pair_energies(), core::scoring::methods::ShortRangeTwoBodyEnergy::evaluate_rotamer_pair_energies(), protocols::hotspot_hashing::HotspotStubSet::evaluate_stub_self_energy_(), protocols::ligand_docking::ga_ligand_dock::GridScorer::get_1b_energy(), protocols::ligand_docking::ga_ligand_dock::GridScorer::get_2b_energy(), core::pack::rotamer_set::RotamerSets::get_bb_bbE(), protocols::toolbox::rotamer_set_operations::AddGood2BPairEnergyRotamers::get_res_res_score(), core::pack::rotamer_set::RotamerSets::get_sc_bbE(), protocols::score_filters::ScoreCutoffFilter::get_score(), core::scoring::ScoreFunction::get_sub_score(), protocols::hbnet::hbnet_one_body_energies(), protocols::hbnet::hbnet_symm_one_body_energies(), core::pack::scmin::CartSCMinMultifunc::operator()(), core::pack::scmin::SCMinMultifunc::operator()(), core::optimization::SingleResidueMultifunc::operator()(), core::scoring::ScoreFunction::operator()(), core::scoring::DockingScoreFunction::operator()(), core::scoring::MinScoreScoreFunction::operator()(), core::pack::interaction_graph::LinearMemNode::project_deltaE_for_substitution(), core::pose::metrics::simple_calculators::InterfaceDeltaEnergeticsCalculator::recompute(), core::energy_methods::SplitUnfoldedTwoBodyEnergy::residue_energy(), core::energy_methods::UnfoldedStateEnergy::residue_energy(), protocols::ligand_docking::ga_ligand_dock::GridScorer::score(), core::scoring::constraints::Constraint::score(), protocols::pose_metric_calculators::SemiExplicitWaterUnsatisfiedPolarsCalculator::semiexpl_water_hbgeom_score(), core::scoring::ScoreFunction::weighted_sum(), protocols::pose_metric_calculators::EnergiesData::weighted_total(), and protocols::pose_metric_calculators::EnergiesData::weighted_total_no_master().

◆ dot() [2/2]

Real core::scoring::EMapVector::dot ( EMapVector const &  src,
ScoreTypes const &  l 
) const
inline

dot product of two EMapVectors over a subset of the score types

References operator[](), and protocols::analysis::total.

◆ end() [1/2]

iterator core::scoring::EMapVector::end ( )
inline

non-const-iterator to the end of the vector of energies

References map_.

◆ end() [2/2]

const_iterator core::scoring::EMapVector::end ( ) const
inline

◆ get()

Real core::scoring::EMapVector::get ( ScoreType  st) const
inline

◆ is_finite()

bool core::scoring::EMapVector::is_finite ( ) const
inline

◆ norm_squared()

Real core::scoring::EMapVector::norm_squared ( ScoreTypes const &  l) const
inline

accumulate the squared values of a subset of the positions

References protocols::analysis::total, and protocols::hybridization::val.

◆ operator!=()

bool core::scoring::EMapVector::operator!= ( EMapVector const &  src) const
inline

!= operator for comparing two energy maps element by element

References map_.

◆ operator*() [1/2]

EMapVector core::scoring::EMapVector::operator* ( EMapVector const &  src) const
inline

  • operator, for performing element-by-element multiplication of two vectors

◆ operator*() [2/2]

EMapVector core::scoring::EMapVector::operator* ( Real  scalar) const
inline

  • operator, for performing multiplication of a vector by a scalar

◆ operator*=() [1/2]

EMapVector& core::scoring::EMapVector::operator*= ( EMapVector const &  src)
inline

*= operator, for performing element-by-element multiplication of two vectors

References map_, and core::scoring::n_score_types.

◆ operator*=() [2/2]

EMapVector& core::scoring::EMapVector::operator*= ( Real  scalar)
inline

*= operator, for performing multiplication of a vector by a scalar

References map_.

◆ operator+=()

EMapVector& core::scoring::EMapVector::operator+= ( EMapVector const &  src)
inline

+= operator, for summing energies

References map_, and core::scoring::n_score_types.

◆ operator-=()

EMapVector& core::scoring::EMapVector::operator-= ( EMapVector const &  src)
inline

-= operator, for subtracting energies

References map_, and core::scoring::n_score_types.

◆ operator==()

bool core::scoring::EMapVector::operator== ( EMapVector const &  src) const
inline

== operator for comparing two energy maps element by element

References map_.

◆ operator[]() [1/2]

Real& core::scoring::EMapVector::operator[] ( ScoreType  st)
inline

[] operator for getting a non-const reference to the energy for a ScoreType

References map_, and core::scoring::n_score_types.

Referenced by accumulate(), dot(), and zero().

◆ operator[]() [2/2]

Real core::scoring::EMapVector::operator[] ( ScoreType  st) const
inline

[] operator for getting the value for a ScoreType

References map_, and core::scoring::n_score_types.

◆ print()

void core::scoring::EMapVector::print ( ) const

print the contents of an emap vector to standard out

References map_, core::scoring::n_score_types, and core::scoring::name_from_score_type().

◆ set()

Real core::scoring::EMapVector::set ( ScoreType  st,
Real  val 
)
inline

◆ show_if_nonzero_weight()

void core::scoring::EMapVector::show_if_nonzero_weight ( std::ostream &  out,
EMapVector const &  weights 
) const

◆ show_nonzero() [1/2]

std::string core::scoring::EMapVector::show_nonzero ( ) const

convert the non-zero positions of the energy map to a string

◆ show_nonzero() [2/2]

void core::scoring::EMapVector::show_nonzero ( std::ostream &  out) const

◆ show_weighted()

void core::scoring::EMapVector::show_weighted ( std::ostream &  out,
EMapVector const &  weights 
) const

◆ sum()

Real core::scoring::EMapVector::sum ( ) const
inline

◆ weighted_string_of()

std::string core::scoring::EMapVector::weighted_string_of ( EMapVector const &  weights) const

◆ zero() [1/2]

void core::scoring::EMapVector::zero ( )
inline

Set every value to zero.

example(s): emap.zero() See also: EMapVector EMapVector.get EMapVector.set ScoreFunction create_score_function

References clear().

◆ zero() [2/2]

void core::scoring::EMapVector::zero ( ScoreTypes const &  l)
inline

Zero a subset of the positions, as in calibrating a scale.

References operator[]().

Referenced by core::scoring::ScoreFunction::asym_eval_onebody_energies(), core::scoring::ScoreFunction::asym_eval_twobody_neighbor_energies(), core::scoring::Energies::clear(), core::pack::rotamer_set::RotamerSet_::compute_one_body_energy_maps(), core::pack::interaction_graph::SymmOnTheFlyNode::compute_rotamer_pair_energy(), core::scoring::eval_weighted_res_onebody_energies_for_minnode(), core::scoring::eval_weighted_res_pair_energy_for_minedge(), core::scoring::methods::TwoBodyEnergy::evaluate_rotamer_background_energies(), core::scoring::methods::ShortRangeTwoBodyEnergy::evaluate_rotamer_background_energies(), core::scoring::methods::TwoBodyEnergy::evaluate_rotamer_background_energy_maps(), core::scoring::methods::ShortRangeTwoBodyEnergy::evaluate_rotamer_background_energy_maps(), core::scoring::methods::TwoBodyEnergy::evaluate_rotamer_intrares_energies(), core::scoring::methods::TwoBodyEnergy::evaluate_rotamer_intrares_energy_maps(), core::scoring::methods::TwoBodyEnergy::evaluate_rotamer_pair_energies(), core::scoring::methods::ShortRangeTwoBodyEnergy::evaluate_rotamer_pair_energies(), protocols::optimize_weights::IterativeOptEDriver::free_weights_and_refEs_from_vars(), protocols::protein_interface_design::hbonded(), protocols::protein_interface_design::hbonded_atom(), protocols::features::ResidueScoresFeatures::insert_two_body_long_range_residue_score_rows(), core::pack::interaction_graph::LinearMemNode::project_deltaE_for_substitution(), core::scoring::constraints::AmbiguousConstraint::score(), core::scoring::Energies::scoring_begin(), core::scoring::ScoreFunction::sym_eval_onebody_energies(), and core::scoring::ScoreFunction::sym_eval_twobody_neighbor_energies().

Member Data Documentation

◆ map_

MemberType core::scoring::EMapVector::map_
private

Grant access to private data to the TwoBodyEMapVector.

EMapVector is an array. EMapVector[score_type] = value. Can be used for storing either energy or weight for each score_type.

Referenced by begin(), clear(), dot(), end(), is_finite(), operator!=(), operator*=(), operator+=(), operator-=(), operator==(), operator[](), print(), and sum().


The documentation for this class was generated from the following files: