41 #ifndef _FREQUENCIESSET_H_ 42 #define _FREQUENCIESSET_H_ 44 #include "../StateMap.h" 47 #include <Bpp/Numeric/Parametrizable.h> 48 #include <Bpp/Numeric/AbstractParametrizable.h> 49 #include <Bpp/Numeric/VectorTools.h> 50 #include <Bpp/Numeric/Prob/Simplex.h> 53 #include <Bpp/Seq/Alphabet/Alphabet.h> 63 public virtual Parametrizable
66 #ifndef NO_VIRTUAL_COV 98 virtual void setFrequencies(
const std::vector<double>& frequencies) = 0;
109 virtual std::string
getName()
const = 0;
127 public AbstractParametrizable
137 AbstractParametrizable(prefix),
140 freq_(stateMap->getNumberOfModelStates()),
144 #ifndef NO_VIRTUAL_COV 152 AbstractParametrizable(af),
161 AbstractParametrizable::operator=(af);
196 for (
size_t i = 0; i <
freq_.size(); i++)
234 FullFrequenciesSet(
StateMap* stateMap,
bool allowNullFreqs =
false,
unsigned short method = 1,
const std::string& name =
"Full.");
235 FullFrequenciesSet(
StateMap* stateMap,
const std::vector<double>& initFreqs,
bool allowNullFreqs =
false,
unsigned short method = 1,
const std::string& name =
"Full.");
297 freqSet_->matchParametersValues(pl);
324 FixedFrequenciesSet(
StateMap* stateMap,
const std::vector<double>& initFreqs,
const std::string& name =
"Fixed")
throw (Exception);
346 #endif // _FREQUENCIESSET_H_ FullFrequenciesSet * clone() const
MarkovModulatedFrequenciesSet(FrequenciesSet *freqSet, const std::vector< double > &rateFreqs)
FrequenciesSet useful for homogeneous and stationary models.
FixedFrequenciesSet(StateMap *stateMap, const std::vector< double > &initFreqs, const std::string &name="Fixed")
Construction with user-defined frequencies on the states of the model.
virtual const Alphabet * getAlphabet() const =0
const double & getFreq_(size_t i) const
unsigned short getMethod() const
virtual void setFrequencies(const std::vector< double > &frequencies)=0
Set the parameters in order to match a given set of frequencies.
void setFrequencies(const std::vector< double > &frequencies)
Set the parameters in order to match a given set of frequencies.
void setFrequencies_(const std::vector< double > &frequencies)
void setFrequencies(const std::vector< double > &frequencies)
Set the parameters in order to match a given set of frequencies.
AbstractFrequenciesSet(StateMap *stateMap, const std::string &prefix, const std::string &name)
virtual const std::vector< double > getFrequencies() const =0
static IntervalConstraint FREQUENCE_CONSTRAINT_MILLI
void setNamespace(const std::string &nameSpace)
FullFrequenciesSet(StateMap *stateMap, bool allowNullFreqs=false, unsigned short method=1, const std::string &name="Full.")
Construction with uniform frequencies on the states of the alphabet.
FrequenciesSet * clone() const =0
MarkovModulatedFrequenciesSet & operator=(const MarkovModulatedFrequenciesSet &mmfs)
Parametrize a set of state frequencies.
const std::map< int, double > getAlphabetStatesFrequencies() const
FrequenciesSet to be used with a Markov-modulated substitution model.
static IntervalConstraint FREQUENCE_CONSTRAINT_SMALL
virtual size_t getNumberOfFrequencies() const =0
AbstractFrequenciesSet(const AbstractFrequenciesSet &af)
A generic FrequenciesSet allowing for the estimation of all frequencies.
virtual std::string getName() const =0
void fireParameterChanged(const ParameterList &pl)
const Alphabet * getAlphabet() const
FixedFrequenciesSet * clone() const
MarkovModulatedFrequenciesSet(const MarkovModulatedFrequenciesSet &mmfs)
size_t getNumberOfFrequencies() const
std::vector< double > & getFrequencies_()
const StateMap & getStateMap() const
double & getFreq_(size_t i)
MarkovModulatedFrequenciesSet * clone() const
virtual const std::map< int, double > getAlphabetStatesFrequencies() const =0
Simplex sFreq_
Simplex to handle the probabilities and the parameters.
std::auto_ptr< StateMap > stateMap_
std::vector< double > rateFreqs_
void setFrequencies(const std::vector< double > &frequencies)
Set the parameters in order to match a given set of frequencies.
void setFrequenciesFromAlphabetStatesFrequencies(const std::map< int, double > &frequencies)
Set the Frequencies from the one of the map which keys match with a letter of the Alphabet...
virtual void setFrequenciesFromAlphabetStatesFrequencies(const std::map< int, double > &frequencies)=0
Set the Frequencies from the one of the map which keys match with a letter of the Alphabet...
std::vector< double > freq_
void fireParameterChanged(const ParameterList ¶meters)
const std::vector< double > getFrequencies() const
virtual ~MarkovModulatedFrequenciesSet()
virtual const StateMap & getStateMap() const =0
Map the states of a given alphabet which have a model state.
FrequenciesSet * freqSet_
std::string getName() const
AbstractFrequenciesSet & operator=(const AbstractFrequenciesSet &af)
const Alphabet * alphabet_
const FrequenciesSet & getStatesFrequenciesSet() const
void fireParameterChanged(const ParameterList ¶meters)
Basic implementation of the FrequenciesSet interface.
AbstractFrequenciesSet * clone() const =0