TreeNode 1.5.2
A library to manipulate phylogenetic trees
Loading...
Searching...
No Matches
PhyloTree.SequenceSimulation.ImmutableRateMatrix Class Reference

Represents a rate matrix whose values cannot be changed after initialisation. More...

Inheritance diagram for PhyloTree.SequenceSimulation.ImmutableRateMatrix:

Public Member Functions

 ImmutableRateMatrix (ReadOnlySpan< char > states, double[,] rates)
 Creates a new ImmutableRateMatrix with the specified states and rates . More...
 
 ImmutableRateMatrix (ReadOnlySpan< char > states, double[,] rates, double[] equilibriumFrequencies)
 Creates a new ImmutableRateMatrix with the specified states and rates . More...
 

Properties

override ImmutableArray< char > States [get]
 Gets the states for the character to which the rate matrix applies. More...
 
override ImmutableArray< double > EquilibriumFrequencies [get]
 Gets the equilibrium frequences of the rate matrix. More...
 
override double this[int from, int to] [get]
 Gets the rate of going from state number from to state number to . If from == to , the negative sum of the elements on the row is returned. More...
 
override double this[char from, char to] [get]
 Gets the rate of going from state from to state to . If from == to , the negative sum of the elements on the row is returned. More...
 
- Properties inherited from PhyloTree.SequenceSimulation.RateMatrix
abstract ImmutableArray< char > States [get]
 Gets the states for the character to which the rate matrix applies. More...
 
abstract ImmutableArray< double > EquilibriumFrequencies [get]
 Gets the equilibrium frequences of the rate matrix. More...
 
abstract double this[int from, int to] [get]
 Gets the rate of going from state number from to state number to . If from == to , the negative sum of the elements on the row is returned. More...
 
abstract double this[char from, char to] [get]
 Gets the rate of going from state from to state to . If from == to , the negative sum of the elements on the row is returned. More...
 

Detailed Description

Represents a rate matrix whose values cannot be changed after initialisation.

Definition at line 371 of file RateMatix.cs.

Constructor & Destructor Documentation

◆ ImmutableRateMatrix() [1/2]

PhyloTree.SequenceSimulation.ImmutableRateMatrix.ImmutableRateMatrix ( ReadOnlySpan< char >  states,
double  rates[,] 
)

Creates a new ImmutableRateMatrix with the specified states and rates .

Parameters
statesThe possible states of the character described by the ImmutableRateMatrix.
ratesA 2D double> array containing the rates used to initialise the matrix. The number of rows and columns in the array must be equal to the number of states. Diagonal entries are ignored.
Exceptions
ArgumentExceptionThrown if the number of rows or columns of the rates matrix does not correspond to the number of states .

Definition at line 458 of file RateMatix.cs.

◆ ImmutableRateMatrix() [2/2]

PhyloTree.SequenceSimulation.ImmutableRateMatrix.ImmutableRateMatrix ( ReadOnlySpan< char >  states,
double  rates[,],
double[]  equilibriumFrequencies 
)

Creates a new ImmutableRateMatrix with the specified states and rates .

Parameters
statesThe possible states of the character described by the ImmutableRateMatrix.
ratesA 2D double> array containing the rates used to initialise the matrix. The number of rows and columns in the array must be equal to the number of states. Diagonal entries are ignored.
equilibriumFrequenciesEquilibrium frequencies for the rate matrix. These are not checked, so they better be correct!
Exceptions
ArgumentExceptionThrown if the number of rows or columns of the rates matrix, or the number of equilibrium frequencies, does not correspond to the number of states .

Using this constructor is faster than the ImmutableRateMatrix(ReadOnlySpan<char>, double[,]) constructor, as equilbrium frequencies are not computed. This is especially useful for pre-baked rate matrices.

Definition at line 511 of file RateMatix.cs.

Property Documentation

◆ EquilibriumFrequencies

override ImmutableArray<double> PhyloTree.SequenceSimulation.ImmutableRateMatrix.EquilibriumFrequencies
get

Gets the equilibrium frequences of the rate matrix.

Definition at line 381 of file RateMatix.cs.

◆ States

override ImmutableArray<char> PhyloTree.SequenceSimulation.ImmutableRateMatrix.States
get

Gets the states for the character to which the rate matrix applies.

Definition at line 376 of file RateMatix.cs.

◆ this[char from, char to]

override double PhyloTree.SequenceSimulation.ImmutableRateMatrix.this[char from, char to]
get

Gets the rate of going from state from to state to . If from == to , the negative sum of the elements on the row is returned.

Parameters
fromThe row state.
toThe column state.
Returns
The rate of going from state from to state to .
Exceptions
ArgumentOutOfRangeExceptionThrown if the state is not part of the rate matrix.

Definition at line 429 of file RateMatix.cs.

◆ this[int from, int to]

override double PhyloTree.SequenceSimulation.ImmutableRateMatrix.this[int from, int to]
get

Gets the rate of going from state number from to state number to . If from == to , the negative sum of the elements on the row is returned.

Parameters
fromThe row number.
toThe column number.
Returns
The rate of going from state number from to state number to .
Exceptions
ArgumentOutOfRangeExceptionThrown if the state index is < 0 or greater than the number of states in the rate matrix.

Definition at line 397 of file RateMatix.cs.


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