pal.substmodel
public abstract class AbstractRateMatrix extends java.lang.Object implements RateMatrix, ExternalParameterListener
Parameterized.Null, Parameterized.ParameterizedBase, Parameterized.ParameterizedUser, Parameterized.Utils
Modifier and Type | Field and Description |
---|---|
protected FormattedOutput |
format |
Modifier | Constructor and Description |
---|---|
protected |
AbstractRateMatrix(int dim) |
Modifier and Type | Method and Description |
---|---|
void |
addPalObjectListener(PalObjectListener pol)
Add a PalObjectListener to be notified of changes to the model.
|
java.lang.Object |
clone() |
protected void |
fireParametersChangedEvent() |
protected void |
fireParametersChangedEvent(PalObjectEvent pe) |
DataType |
getDataType()
Get the data type of this rate matrix
|
int |
getDimension() |
double[] |
getEquilibriumFrequencies() |
double |
getEquilibriumFrequency(int i) |
protected double[] |
getFrequencies() |
abstract int |
getModelID()
get numerical code describing the model type
|
OrthogonalHints |
getOrthogonalHints() |
double |
getParameter(int parameter)
get model parameter
|
double[][] |
getRelativeRates() |
void |
getTransitionProbabilities(double[][] probabilityStore)
A utility method for speed, transfers trans prob information quickly
into store
|
double |
getTransitionProbability(int fromState,
int toState)
Returns the probability of going from one state to another
given the current distance
|
int |
getTypeID()
get numerical code describing the data type
|
void |
parameterChanged(ParameterEvent pe)
For the external parameter interface.
|
protected void |
printFrequencies(java.io.PrintWriter out) |
void |
rebuild() |
protected abstract void |
rebuildRateMatrix(double[][] rate,
double[] parameters) |
void |
removePalObjectListener(PalObjectListener pol) |
void |
scale(double scale) |
protected void |
setDataType(DataType dt) |
void |
setDistance(double distance)
Sets the distance (such as time/branch length) used when calculating
the probabilities.
|
void |
setDistanceTranspose(double distance)
Sets the distance (such as time/branch length) used when calculating
the probabilities.
|
protected void |
setFrequencies(double[] f) |
void |
setParameter(double value,
int parameter)
set model parameter
|
void |
setParameters(double[] parameters) |
double |
setParametersNoScale(double[] parameters) |
protected void |
updateMatrixExp() |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getUniqueName
getParameterName
getDefaultValue, getLowerLimit, getNumParameters, getUpperLimit, setParameterSE
protected FormattedOutput format
public int getTypeID()
getTypeID
in interface RateMatrix
public abstract int getModelID()
getModelID
in interface RateMatrix
public int getDimension()
getDimension
in interface RateMatrix
public double[] getEquilibriumFrequencies()
getEquilibriumFrequencies
in interface RateMatrix
public double getEquilibriumFrequency(int i)
getEquilibriumFrequency
in interface RateMatrix
public DataType getDataType()
RateMatrix
getDataType
in interface RateMatrix
protected final void setDataType(DataType dt)
public double[][] getRelativeRates()
getRelativeRates
in interface RateMatrix
public double getTransitionProbability(int fromState, int toState)
getTransitionProbability
in interface RateMatrix
fromState
- The state from which we are startingtoState
- The resulting statepublic final void rebuild()
public final void setDistance(double distance)
setDistance
in interface RateMatrix
public final void setDistanceTranspose(double distance)
setDistanceTranspose
in interface RateMatrix
public final void getTransitionProbabilities(double[][] probabilityStore)
getTransitionProbabilities
in interface RateMatrix
public void scale(double scale)
scale
in interface RateMatrix
protected void printFrequencies(java.io.PrintWriter out)
protected void setFrequencies(double[] f)
public double setParametersNoScale(double[] parameters)
setParametersNoScale
in interface RateMatrix
public void setParameters(double[] parameters)
public final void setParameter(double value, int parameter)
Parameterized
setParameter
in interface Parameterized
value
- parameter valueparameter
- parameter numberpublic final double getParameter(int parameter)
Parameterized
getParameter
in interface Parameterized
parameter
- parameter numberprotected abstract void rebuildRateMatrix(double[][] rate, double[] parameters)
public void addPalObjectListener(PalObjectListener pol)
RateMatrix
addPalObjectListener
in interface RateMatrix
public void removePalObjectListener(PalObjectListener pol)
removePalObjectListener
in interface RateMatrix
protected void fireParametersChangedEvent()
protected void fireParametersChangedEvent(PalObjectEvent pe)
protected void updateMatrixExp()
public void parameterChanged(ParameterEvent pe)
parameterChanged
in interface ExternalParameterListener
public java.lang.Object clone()
clone
in interface RateMatrix
clone
in class java.lang.Object
public OrthogonalHints getOrthogonalHints()
getOrthogonalHints
in interface RateMatrix
protected final double[] getFrequencies()