mesquite.cont.lib
Class MContinuousAdjustable

java.lang.Object
  extended by mesquite.lib.characters.MCharactersStates
      extended by mesquite.cont.lib.MContinuousStates
          extended by mesquite.cont.lib.MContinuousDistribution
              extended by mesquite.cont.lib.MContinuousAdjustable
All Implemented Interfaces:
ItemContainer, Annotatable, MAdjustableDistribution, MCharactersDistribution, MCharactersStatesHolder, Listable, Renamable
Direct Known Subclasses:
MContinuousHistory

public class MContinuousAdjustable
extends MContinuousDistribution
implements MAdjustableDistribution

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


Field Summary
protected  Double2DArray firstMatrix
           
protected  java.util.Vector matrices
           
 
Fields inherited from class mesquite.lib.characters.MCharactersStates
data
 
Constructor Summary
MContinuousAdjustable()
           
MContinuousAdjustable(Taxa taxa)
           
MContinuousAdjustable(Taxa taxa, int numChars, int numTaxa)
           
 
Method Summary
 Double2DArray addItem(NameReference nr)
           
 Double2DArray addItem(java.lang.String name)
           
 void deassignStates()
          assign missing data (unassigned) to all of the characters
 Double2DArray establishItem(NameReference nr)
          Make an item with the passed name.
 Double2DArray establishItem(java.lang.String name)
           
 java.lang.String getAnnotation()
           
 CharacterDistribution getCharacterDistribution(int ic)
          return CharacterDistribution object for character ic
 Double2DArray getItem(int index)
           
 java.lang.String getItemName(int index)
           
 int getItemNumber(NameReference nr)
           
 int getNumberOfItems()
           
 int getNumChars()
           
 int getNumNodes()
          returns number of nodes for which MCharactersStates is defined (either terminal taxa, if MCharactersDistribution, or all nodes in tree, if MCharactersHistory)
 int getNumTaxa()
          returns number of terminal taxa for which MCharactersStates is defined
 double getState(int ic, int N)
          returns state of character ic in taxon/node it
 double getState(int ic, int N, int item)
          returns state of item item of character ic in taxon/node it
 void removeItem(int item)
          Removes item.
 void setAnnotation(java.lang.String s, boolean notify)
           
 void setCharacterState(CharacterState cs, int ic, int it)
          sets the state of character ic in taxon it from CharacterState cs.
 void setItemReference(int index, NameReference nr)
          Sets the name reference for the item number "index".
 void setItemsAs(ItemContainer iCont)
           
 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, double d)
           
 void setState(int ic, int N, int item, double d)
           
 void setStates(Double2DArray matrix)
           
 void setStates(java.util.Vector matrices)
           
 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 the states of character ic from the given CharacterDistribution
 
Methods inherited from class mesquite.cont.lib.MContinuousDistribution
adjustHistorySize, makeBlankAdjustable, makeCharacterData
 
Methods inherited from class mesquite.cont.lib.MContinuousStates
allCombinable, allCombinable, getCharacterDataClass, getCharacterState, getDataTypeName, getID, getItemReference, getItemReference, getMatrix, getNumItems, getStateClass, toString, userQueryItem
 
Methods inherited from class mesquite.lib.characters.MCharactersStates
checkIllegalNode, getBasisTree, getName, getParentData, getTaxa, isCurrentlyIncluded, matrixToString, setBasisTree, setName, setTaxa
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface mesquite.lib.characters.MAdjustableDistribution
setTaxa
 
Methods inherited from interface mesquite.lib.characters.MCharactersDistribution
adjustHistorySize, getBasisTree, makeBlankAdjustable, makeCharacterData, setBasisTree
 
Methods inherited from interface mesquite.lib.characters.MCharactersStatesHolder
getCharacterDataClass, getCharacterState, getDataTypeName, getParentData, getStateClass, getTaxa, isCurrentlyIncluded
 
Methods inherited from interface mesquite.lib.Listable
getName
 
Methods inherited from interface mesquite.lib.Renamable
setName
 

Field Detail

firstMatrix

protected Double2DArray firstMatrix

matrices

protected java.util.Vector matrices
Constructor Detail

MContinuousAdjustable

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

MContinuousAdjustable

public MContinuousAdjustable(Taxa taxa)

MContinuousAdjustable

public MContinuousAdjustable()
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

addItem

public Double2DArray addItem(NameReference nr)

addItem

public Double2DArray addItem(java.lang.String name)

establishItem

public Double2DArray establishItem(java.lang.String name)

establishItem

public Double2DArray establishItem(NameReference nr)
Make an item with the passed name. If the an item already made is not yet named, then this will simply use this item and give it a new name. Otherwise, a new matrix is made for a new item, and the name is attached to it.


getNumberOfItems

public int getNumberOfItems()
Specified by:
getNumberOfItems in class MContinuousStates

getItem

public Double2DArray getItem(int index)
Specified by:
getItem in class MContinuousDistribution

getItemName

public java.lang.String getItemName(int index)
Specified by:
getItemName in interface ItemContainer
Specified by:
getItemName in class MContinuousStates

getItemNumber

public int getItemNumber(NameReference nr)
Specified by:
getItemNumber in interface ItemContainer
Specified by:
getItemNumber in class MContinuousStates

setItemsAs

public void setItemsAs(ItemContainer iCont)

removeItem

public void removeItem(int item)
Removes item.


setItemReference

public void setItemReference(int index,
                             NameReference nr)
Sets the name reference for the item number "index".


deassignStates

public void deassignStates()
Description copied from interface: MAdjustableDistribution
assign missing data (unassigned) to all of the characters

Specified by:
deassignStates in interface MAdjustableDistribution

transferFrom

public void transferFrom(int ic,
                         CharacterDistribution s)
obtain the states of character ic from the given CharacterDistribution

Specified by:
transferFrom in interface MAdjustableDistribution

getState

public double getState(int ic,
                       int N,
                       int item)
Description copied from class: MContinuousStates
returns state of item item of character ic in taxon/node it

Specified by:
getState in class MContinuousStates

setStates

public void setStates(java.util.Vector matrices)

setStates

public void setStates(Double2DArray matrix)

setState

public void setState(int ic,
                     int N,
                     int item,
                     double d)

getState

public double getState(int ic,
                       int N)
Description copied from class: MContinuousStates
returns state of character ic in taxon/node it

Specified by:
getState in class MContinuousStates

setState

public void setState(int ic,
                     int N,
                     double d)

setCharacterState

public void setCharacterState(CharacterState cs,
                              int ic,
                              int it)
sets the state of character ic in taxon it from CharacterState cs. If incoming CharacterState has more items or items with names not seen in this ContinuousData, then new items are created in the ContinuousData

Specified by:
setCharacterState in interface MAdjustableDistribution

tradeStatesBetweenTaxa

public void tradeStatesBetweenTaxa(int ic,
                                   int it,
                                   int it2)
Description copied from interface: MAdjustableDistribution
trades the states of character ic between taxa it and it2. Used for reshuffling.

Specified by:
tradeStatesBetweenTaxa in interface MAdjustableDistribution

getCharacterDistribution

public CharacterDistribution getCharacterDistribution(int ic)
Description copied from interface: MCharactersDistribution
return CharacterDistribution object for character ic

Specified by:
getCharacterDistribution in interface MCharactersDistribution
Specified by:
getCharacterDistribution in class MContinuousDistribution

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

getNumNodes

public int getNumNodes()
Description copied from interface: MCharactersStatesHolder
returns number of nodes for which MCharactersStates is defined (either terminal taxa, if MCharactersDistribution, or all nodes in tree, if MCharactersHistory)

Specified by:
getNumNodes in interface MCharactersStatesHolder
Overrides:
getNumNodes in class MCharactersStates

getNumChars

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