C# Класс CSMSL.Chemistry.ChemicalFormulaGenerator

A chemical formula generator for constructing all possible chemical formulas within a mass range given restraints on the total number of isotopes.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddConstraint ( ChemicalFormula minimumChemicalFormula, ChemicalFormula maximumChemicalFormula ) : void
AddConstraint ( Isotope isotope, Range range ) : void
AddConstraint ( Isotope isotope, int min, int max ) : void
AllFormulas ( ) : IEnumerable

Generate all formulas regardless of mass between the min and max formula

ChemicalFormulaGenerator ( ) : System

Create a empty generator, which will produce no formulas unless a constraint is added

ChemicalFormulaGenerator ( ChemicalFormula maximumChemicalFormula ) : System

Creates a generator with a maximum chemical formula allowed

ChemicalFormulaGenerator ( ChemicalFormula minimumChemicalFormula, ChemicalFormula maximumChemicalFormula ) : System

Creates a generator with a maximum chemical formula allowed

ClearConstraints ( ) : void
FromMass ( IRange massRange, int maxNumberOfResults = int.MaxValue, bool sort = true ) : IEnumerable
FromMass ( double lowMass, double highMass, int maxNumberOfResults = int.MaxValue, bool sort = true ) : IEnumerable
RemoveConstraint ( Isotope isotope ) : void

Приватные методы

Метод Описание
GenerateFormulaHelper ( double lowMass, double highMass, double masses, int max, int index, int currentFormula, List formulas ) : void

Описание методов

AddConstraint() публичный Метод

public AddConstraint ( ChemicalFormula minimumChemicalFormula, ChemicalFormula maximumChemicalFormula ) : void
minimumChemicalFormula ChemicalFormula
maximumChemicalFormula ChemicalFormula
Результат void

AddConstraint() публичный Метод

public AddConstraint ( Isotope isotope, Range range ) : void
isotope Isotope
range Range
Результат void

AddConstraint() публичный Метод

public AddConstraint ( Isotope isotope, int min, int max ) : void
isotope Isotope
min int
max int
Результат void

AllFormulas() публичный Метод

Generate all formulas regardless of mass between the min and max formula
public AllFormulas ( ) : IEnumerable
Результат IEnumerable

ChemicalFormulaGenerator() публичный Метод

Create a empty generator, which will produce no formulas unless a constraint is added
public ChemicalFormulaGenerator ( ) : System
Результат System

ChemicalFormulaGenerator() публичный Метод

Creates a generator with a maximum chemical formula allowed
public ChemicalFormulaGenerator ( ChemicalFormula maximumChemicalFormula ) : System
maximumChemicalFormula ChemicalFormula The maximum chemical formula to generate
Результат System

ChemicalFormulaGenerator() публичный Метод

Creates a generator with a maximum chemical formula allowed
public ChemicalFormulaGenerator ( ChemicalFormula minimumChemicalFormula, ChemicalFormula maximumChemicalFormula ) : System
minimumChemicalFormula ChemicalFormula
maximumChemicalFormula ChemicalFormula The maximum chemical formula to generate
Результат System

ClearConstraints() публичный Метод

public ClearConstraints ( ) : void
Результат void

FromMass() публичный Метод

public FromMass ( IRange massRange, int maxNumberOfResults = int.MaxValue, bool sort = true ) : IEnumerable
massRange IRange
maxNumberOfResults int
sort bool
Результат IEnumerable

FromMass() публичный Метод

public FromMass ( double lowMass, double highMass, int maxNumberOfResults = int.MaxValue, bool sort = true ) : IEnumerable
lowMass double
highMass double
maxNumberOfResults int
sort bool
Результат IEnumerable

RemoveConstraint() публичный Метод

public RemoveConstraint ( Isotope isotope ) : void
isotope Isotope
Результат void