C# Class CSMSL.Tolerance

Show file Open project: dbaileychess/CSMSL Class Usage Examples

Public Methods

Method Description
CalculatePrecursorMassError ( double theoreticalMass, double observedMass, int &nominalMassOffset, double &adjustedObservedMass, double difference = Constants.C13C12Difference, ToleranceUnit type = ToleranceUnit.PPM ) : Tolerance
FromDA ( double value, ToleranceType toleranceType = ToleranceType.PlusAndMinus ) : Tolerance
FromMMU ( double value, ToleranceType toleranceType = ToleranceType.PlusAndMinus ) : Tolerance
FromPPM ( double value, ToleranceType toleranceType = ToleranceType.PlusAndMinus ) : Tolerance
GetMaximumValue ( double mean ) : double

Gets the maximum value that is still within this tolerance

GetMinimumValue ( double mean ) : double

Gets the minimum value that is still within this tolerance

GetRange ( double mean ) : DoubleRange

Gets the range of values encompassed by this tolerance

GetTolerance ( double experimental, double theoretical, ToleranceUnit type ) : double
ToString ( ) : string
Tolerance ( ToleranceUnit unit, double value, ToleranceType type = ToleranceType.PlusAndMinus ) : System

Creates a new tolerance given a unit, value, and whether the tolerance is ±

Tolerance ( ToleranceUnit unit, double experimental, double theoretical, ToleranceType type = ToleranceType.PlusAndMinus ) : System

Creates a new tolerance given a unit, two points (one experimental and one theoretical), and whether the tolerance is ±

Tolerance ( string s ) : System

Calculates a tolerance from the string representation

i.e., "10 PPM", "-+10 PPM", "5 DA", "±10 MMU", etc...

Within ( double experimental, double theoretical ) : bool

Indicates if the two values provided are within this tolerance

Method Details

CalculatePrecursorMassError() public static method

public static CalculatePrecursorMassError ( double theoreticalMass, double observedMass, int &nominalMassOffset, double &adjustedObservedMass, double difference = Constants.C13C12Difference, ToleranceUnit type = ToleranceUnit.PPM ) : Tolerance
theoreticalMass double
observedMass double
nominalMassOffset int
adjustedObservedMass double
difference double
type ToleranceUnit
return Tolerance

FromDA() public static method

public static FromDA ( double value, ToleranceType toleranceType = ToleranceType.PlusAndMinus ) : Tolerance
value double
toleranceType ToleranceType
return Tolerance

FromMMU() public static method

public static FromMMU ( double value, ToleranceType toleranceType = ToleranceType.PlusAndMinus ) : Tolerance
value double
toleranceType ToleranceType
return Tolerance

FromPPM() public static method

public static FromPPM ( double value, ToleranceType toleranceType = ToleranceType.PlusAndMinus ) : Tolerance
value double
toleranceType ToleranceType
return Tolerance

GetMaximumValue() public method

Gets the maximum value that is still within this tolerance
public GetMaximumValue ( double mean ) : double
mean double
return double

GetMinimumValue() public method

Gets the minimum value that is still within this tolerance
public GetMinimumValue ( double mean ) : double
mean double
return double

GetRange() public method

Gets the range of values encompassed by this tolerance
public GetRange ( double mean ) : DoubleRange
mean double The mean value
return DoubleRange

GetTolerance() public static method

public static GetTolerance ( double experimental, double theoretical, ToleranceUnit type ) : double
experimental double
theoretical double
type ToleranceUnit
return double

ToString() public method

public ToString ( ) : string
return string

Tolerance() public method

Creates a new tolerance given a unit, value, and whether the tolerance is ±
public Tolerance ( ToleranceUnit unit, double value, ToleranceType type = ToleranceType.PlusAndMinus ) : System
unit ToleranceUnit The units for this tolerance
value double The numerical value of the tolerance
type ToleranceType Whether the tolerance is full or half width
return System

Tolerance() public method

Creates a new tolerance given a unit, two points (one experimental and one theoretical), and whether the tolerance is ±
public Tolerance ( ToleranceUnit unit, double experimental, double theoretical, ToleranceType type = ToleranceType.PlusAndMinus ) : System
unit ToleranceUnit The units for this tolerance
experimental double The experimental value
theoretical double The theoretical value
type ToleranceType Whether the tolerance is full or half width
return System

Tolerance() public method

Calculates a tolerance from the string representation

i.e., "10 PPM", "-+10 PPM", "5 DA", "±10 MMU", etc...

public Tolerance ( string s ) : System
s string
return System

Within() public method

Indicates if the two values provided are within this tolerance
public Within ( double experimental, double theoretical ) : bool
experimental double The experimental value
theoretical double The theoretical value
return bool