4 #ifndef ENERGY_NUCLEO_H 5 #define ENERGY_NUCLEO_H 10 #include "Nucleotide.h" 18 typedef std::pair<faif::dna::Nucleotide, faif::dna::Nucleotide>
Complementary;
22 bool operator()(
const Complementary& a,
const Complementary& b)
const {
23 if(a.first == b.first )
24 return a.second.get() < b.second.get();
26 return a.first.get() < b.first.get();
31 static const EnergyValue DEFAULT_NUCLEO_ENERGY = -1000;
41 explicit EnergyNucleo(EnergyValue defaultEnergy) : defaultEnergy_(defaultEnergy) {}
47 EnergyMap::const_iterator it = data_.find(
Complementary(a,b) );
48 if( it != data_.end() )
51 return defaultEnergy_;
56 data_.insert( EnergyMap::value_type(
Complementary(a,b), val ) );
59 typedef std::map<Complementary, EnergyValue, lessComplementary > EnergyMap;
63 const EnergyValue defaultEnergy_;
86 #endif //ENERGY_NUCLEO EnergyNucleo(EnergyValue defaultEnergy)
Definition: EnergyNucleo.h:41
Definition: EnergyNucleo.h:21
EnergyNucleo(const EnergyNucleo &energy)
Definition: EnergyNucleo.h:43
void addPair(const faif::dna::Nucleotide &a, const faif::dna::Nucleotide &b, const EnergyValue &val)
stores the pair and its energy
Definition: EnergyNucleo.h:55
the DNA nucleotide
Definition: Nucleotide.h:21
std::pair< faif::dna::Nucleotide, faif::dna::Nucleotide > Complementary
Definition: EnergyNucleo.h:18
int EnergyValue
Definition: EnergyNucleo.h:15
EnergyNucleo createDefaultEnergy(EnergyValue defaultEnergy=DEFAULT_NUCLEO_ENERGY)
Definition: EnergyNucleo.h:71
the maps between pair of nucleotides and its energy
Definition: EnergyNucleo.h:37
EnergyValue getEnergy(const faif::dna::Nucleotide &a, const faif::dna::Nucleotide &b) const
return the energy of given pair
Definition: EnergyNucleo.h:46