pal.substmodel
Class GeneralPoissonRateMatrix

java.lang.Object
  extended by pal.substmodel.GeneralPoissonRateMatrix
All Implemented Interfaces:
java.io.Serializable, NeoRateMatrix

public class GeneralPoissonRateMatrix
extends java.lang.Object
implements NeoRateMatrix

A general rate matrix class for JC69/F81 style rate matrices (but for all data types)

Version:
$Id: GeneralPoissonRateMatrix.java,v 1.3 2004/08/15 03:00:37 matt Exp $
Author:
Matthew Goode
See Also:
Serialized Form

Constructor Summary
GeneralPoissonRateMatrix(int dimension)
           
 
Method Summary
 void createRelativeRates(double[][] rateStore, double[] rateParameters, int startIndex)
          Create the relative rates array
 void getDefaultRateParameters(double[] store, int startIndex)
           
 int getDimension()
           
 int getNumberOfRateParameters()
           
 double getRateParameterLowerBound(int parameter)
           
 double getRateParameterUpperBound(int parameter)
           
 java.lang.String getUniqueName()
           
 boolean isDataTypeCompatible(DataType dt)
          Check the compatibility of a data type to be used with the rate matrix
 boolean isReversible()
          Is the relative rate matrix described by this rate matrix meant to represent a reversible process? If true only the upper part of the rate matrix needs to be filled in (eg in matrix[i][j], for all where j > i );
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneralPoissonRateMatrix

public GeneralPoissonRateMatrix(int dimension)
Method Detail

getUniqueName

public java.lang.String getUniqueName()
Specified by:
getUniqueName in interface NeoRateMatrix
Returns:
a short unique human-readable identifier for this rate matrix.

isReversible

public boolean isReversible()
Description copied from interface: NeoRateMatrix
Is the relative rate matrix described by this rate matrix meant to represent a reversible process? If true only the upper part of the rate matrix needs to be filled in (eg in matrix[i][j], for all where j > i );

Specified by:
isReversible in interface NeoRateMatrix
Returns:
true (doesn't really matter)

getDimension

public int getDimension()
Specified by:
getDimension in interface NeoRateMatrix
Returns:
the dimension of this rate matrix. (as for construction)

isDataTypeCompatible

public boolean isDataTypeCompatible(DataType dt)
Check the compatibility of a data type to be used with the rate matrix

Specified by:
isDataTypeCompatible in interface NeoRateMatrix
Parameters:
dt - the data type to test
Returns:
true if data type state count is equal to dimension

createRelativeRates

public void createRelativeRates(double[][] rateStore,
                                double[] rateParameters,
                                int startIndex)
Description copied from interface: NeoRateMatrix
Create the relative rates array

Specified by:
createRelativeRates in interface NeoRateMatrix
Parameters:
rateStore - The place where the relative rates are stored (should be assumed to be large enough - based on dimension)
rateParameters - The parameters to be used to construct the rate store
startIndex - The index into the rateParameters to start reading parameters

getNumberOfRateParameters

public int getNumberOfRateParameters()
Specified by:
getNumberOfRateParameters in interface NeoRateMatrix

getRateParameterLowerBound

public double getRateParameterLowerBound(int parameter)
Specified by:
getRateParameterLowerBound in interface NeoRateMatrix

getRateParameterUpperBound

public double getRateParameterUpperBound(int parameter)
Specified by:
getRateParameterUpperBound in interface NeoRateMatrix

getDefaultRateParameters

public void getDefaultRateParameters(double[] store,
                                     int startIndex)
Specified by:
getDefaultRateParameters in interface NeoRateMatrix