mesquite.categ.lib
Class MCategoricalAdjustable

java.lang.Object
  extended by mesquite.lib.characters.MCharactersStates
      extended by mesquite.categ.lib.MCategoricalStates
          extended by mesquite.categ.lib.MCategoricalDistribution
              extended by mesquite.categ.lib.MCategoricalAdjustable
All Implemented Interfaces:
Annotatable, MAdjustableDistribution, MCharactersDistribution, MCharactersStatesHolder, Listable, Renamable
Direct Known Subclasses:
MCategoricalHistory, MDNAAdjustable, MProteinAdjustable

public class MCategoricalAdjustable
extends MCategoricalDistribution
implements MAdjustableDistribution

A class for an array of categorical character states for many characters, at each of the taxa or nodes.


Field Summary
 
Fields inherited from class mesquite.categ.lib.MCategoricalStates
extraFrequencies, frequencies
 
Fields inherited from class mesquite.lib.characters.MCharactersStates
data, totalCreated
 
Constructor Summary
MCategoricalAdjustable()
           
MCategoricalAdjustable(Taxa taxa)
           
MCategoricalAdjustable(Taxa taxa, int numChars, int numTaxa)
           
 
Method Summary
 void deassignStates()
          assign missing data (unassigned) to all characters and nodes
 java.lang.String getAnnotation()
           
 CharacterDistribution getCharacterDistribution(int ic)
          return CharacterDistribution object for character ic
 int getNumChars()
           
 int getNumTaxa()
          returns number of terminal taxa for which MCharactersStates is defined
 long getState(int ic, int N)
          returns state set of character ic at node
 CharacterData makeCharacterData(CharMatrixManager manager, Taxa taxa)
          return CharacterData filled with same values as this matrix
 void setAnnotation(java.lang.String s, boolean notify)
           
 void setCharacterState(CharacterState s, int ic, int it)
          sets the character state of character ic and taxon it to that in the passed CharacterState
 void setParentData(CharacterData cd)
          sets the parent CharacterData from which this CharacterDistribution is derived or related
 void setSize(int numChars, int numTaxa)
          Set the size of the matrix
 void setState(int ic, int N, long d)
          set state set of character ic at node to d
 void tradeStatesBetweenTaxa(int ic, int it, int it2)
          trades the states of character ic between taxa it and it2.
 void transferFrom(int ic, CharacterDistribution s)
          obtain states of character ic from passed CharacterDistribution object
 
Methods inherited from class mesquite.categ.lib.MCategoricalDistribution
adjustHistorySize, getStateRaw, makeBlankAdjustable
 
Methods inherited from class mesquite.categ.lib.MCategoricalStates
copyExtraFrequencies, copyFrequencies, disposeExtraFrequencies, disposeFrequencies, extraFrequenciesExist, frequenciesExist, getAllStates, getCharacterDataClass, getCharacterState, getDataTypeName, getExtraFrequencies, getExtraFrequency, getFrequencies, getFrequency, getNumExtraFreqCateg, getNumFreqCateg, getStateClass, setExtraFrequencies, setExtraFrequencies, setFrequencies, setFrequencies
 
Methods inherited from class mesquite.lib.characters.MCharactersStates
checkIllegalNode, getBasisTree, getName, getNumNodes, getParentData, getTaxa, isCurrentlyIncluded, matrixToString, setBasisTree, setName, setTaxa
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface mesquite.lib.characters.MAdjustableDistribution
setTaxa
 
Methods inherited from interface mesquite.lib.characters.MCharactersDistribution
adjustHistorySize, getBasisTree, makeBlankAdjustable, setBasisTree
 
Methods inherited from interface mesquite.lib.characters.MCharactersStatesHolder
getCharacterDataClass, getCharacterState, getDataTypeName, getNumNodes, getParentData, getStateClass, getTaxa, isCurrentlyIncluded
 
Methods inherited from interface mesquite.lib.Listable
getName
 
Methods inherited from interface mesquite.lib.Renamable
setName
 

Constructor Detail

MCategoricalAdjustable

public MCategoricalAdjustable(Taxa taxa,
                              int numChars,
                              int numTaxa)

MCategoricalAdjustable

public MCategoricalAdjustable(Taxa taxa)

MCategoricalAdjustable

public MCategoricalAdjustable()
Method Detail

setAnnotation

public void setAnnotation(java.lang.String s,
                          boolean notify)
Specified by:
setAnnotation in interface Annotatable

getAnnotation

public java.lang.String getAnnotation()
Specified by:
getAnnotation in interface Annotatable

setParentData

public void setParentData(CharacterData cd)
sets the parent CharacterData from which this CharacterDistribution is derived or related

Specified by:
setParentData in interface MAdjustableDistribution

setSize

public void setSize(int numChars,
                    int numTaxa)
Description copied from interface: MAdjustableDistribution
Set the size of the matrix

Specified by:
setSize in interface MAdjustableDistribution

deassignStates

public void deassignStates()
assign missing data (unassigned) to all characters and nodes

Specified by:
deassignStates in interface MAdjustableDistribution

getState

public long getState(int ic,
                     int N)
returns state set of character ic at node

Specified by:
getState in class MCategoricalStates

setState

public void setState(int ic,
                     int N,
                     long d)
set state set of character ic at node to d


setCharacterState

public void setCharacterState(CharacterState s,
                              int ic,
                              int it)
sets the character state of character ic and taxon it to that in the passed CharacterState

Specified by:
setCharacterState in interface MAdjustableDistribution

tradeStatesBetweenTaxa

public void tradeStatesBetweenTaxa(int ic,
                                   int it,
                                   int it2)
trades the states of character ic between taxa it and it2. Used for reshuffling.

Specified by:
tradeStatesBetweenTaxa in interface MAdjustableDistribution

transferFrom

public void transferFrom(int ic,
                         CharacterDistribution s)
obtain states of character ic from passed CharacterDistribution object

Specified by:
transferFrom in interface MAdjustableDistribution

getCharacterDistribution

public CharacterDistribution getCharacterDistribution(int ic)
return CharacterDistribution object for character ic

Specified by:
getCharacterDistribution in interface MCharactersDistribution

makeCharacterData

public CharacterData makeCharacterData(CharMatrixManager manager,
                                       Taxa taxa)
return CharacterData filled with same values as this matrix

Specified by:
makeCharacterData in interface MCharactersDistribution
Overrides:
makeCharacterData in class MCategoricalDistribution

getNumTaxa

public int getNumTaxa()
Description copied from interface: MCharactersStatesHolder
returns number of terminal taxa for which MCharactersStates is defined

Specified by:
getNumTaxa in interface MCharactersStatesHolder

getNumChars

public int getNumChars()
Specified by:
getNumChars in interface MCharactersStatesHolder