Class PolyatomicSubstitutionFilter
java.lang.Object
_global.tri.oxidationstates.ion.filters.PolyatomicSubstitutionFilter
- All Implemented Interfaces:
matsci.util.arrays.ArrayIndexer.Filter
public class PolyatomicSubstitutionFilter
extends Object
implements matsci.util.arrays.ArrayIndexer.Filter
This filter is used to consider possible combinations of polyatomic ions that can be created from
an atomic composition. It screens out any combinations of polyatomic ions that can't be formed given
the atomic composition (assuming an integer number of polyatomic ions per formula unit).
-
Constructor Summary
ConstructorsConstructorDescriptionPolyatomicSubstitutionFilter(double[] maxCountsByAtomicNumber, IonFactory.IonType[] polyatomicIonTypes) Initialize the filter -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRemainingElementsForLastSeenState(HashMap<String, Double> polyatomicIonComposition) Given a composition map representing the polyatomic ion composition, adds the composition of monatomic ions according to the last state seen by this filter.intgetBranchIndex(int[] currentState)
-
Constructor Details
-
PolyatomicSubstitutionFilter
public PolyatomicSubstitutionFilter(double[] maxCountsByAtomicNumber, IonFactory.IonType[] polyatomicIonTypes) Initialize the filter- Parameters:
maxCountsByAtomicNumber- The indices of this array correspond to atomic numbers, and the values should correspond to the number of atoms of that type per formula unit. The formula unit does not need to be fully reduced.polyatomicIonTypes- The various types of polyatomic ion types that could be formed using the atoms in this system. The order of the polyatomic ions should correspond to the state being evaluated, so state[i] is the number of polyatomic ions of type polyatomicIonTypes[i].
-
-
Method Details
-
getBranchIndex
public int getBranchIndex(int[] currentState) - Specified by:
getBranchIndexin interfacematsci.util.arrays.ArrayIndexer.Filter
-
addRemainingElementsForLastSeenState
Given a composition map representing the polyatomic ion composition, adds the composition of monatomic ions according to the last state seen by this filter.- Parameters:
polyatomicIonComposition- A map in which the keys are the ion type IDs for polyatomic ions and the values are amounts. The elemental amounts will be added to this map.
-