# gcu::IsotopicPattern Class Reference

`#include <gcu/isotope.h>`

List of all members.

## Public Member Functions
| IsotopicPattern ()
| IsotopicPattern (int min, int max)
IsotopicPattern * | Simplify (void)
IsotopicPattern * | Multiply (IsotopicPattern &pattern)
IsotopicPattern * | Square (void)
void | Copy (IsotopicPattern &pattern)
void | SetValue (int A, double percent)
void | Normalize ()
void | Clear ()
void | Ref ()
void | Unref ()
int | GetMinMass ()
int | GetMonoNuclNb ()
double | GetMonoMass ()
void | SetMonoMass (double mass)
int | GetValues (double **values)

## Detailed Description

Objects of this class represent the isotopic pattern corresponding to a chemical formula.
The formalism used is similar to polynoms algebra, since calculate the isotopic pattern of the reunion of two fragments is equivalent to a polynomial multiplication.

Definition at line 58 of file isotope.h.

## Constructor & Destructor Documentation

gcu::IsotopicPattern::IsotopicPattern | ( |  | ) |

Default constructor. Initialize members to nul values. The IsotopicPattern is given an initial reference count of 1.

gcu::IsotopicPattern::IsotopicPattern | ( | int | min,
|  | int | max |
| ) |  |  |

Sets the minimum and maximum mass numbers of the pattern, and reserves memory to store the abundances of the mass fragments. The IsotopicPattern is given an initial reference count of 1.

## Member Function Documentation

IsotopicPattern* gcu::IsotopicPattern::Simplify | ( | void |  | ) |

This method creates a copy of the original object with abundances normalized as a percentage of the largest value, and removes very small values to save time in subsequent calculations.

Returns:
  the resulting object.

IsotopicPattern* gcu::IsotopicPattern::Multiply | ( | IsotopicPattern & | pattern | ) |

Effects a polynomial multiplication to calculate the pattern correponding to the reunion of the two fragments.

Returns:
  the result of the multiplication.

IsotopicPattern* gcu::IsotopicPattern::Square | ( | void |  | ) |

Squares the original pattern to get the pattern corresponding to twice the original formula.

Returns:
  the result of the multiplication.

void gcu::IsotopicPattern::Copy | ( | IsotopicPattern & | pattern | ) |

Parameters:

  | pattern,: | the isotopic pattern to be copied. Set the values of the isotopic pattern so that it becomes identical to pattern.

void gcu::IsotopicPattern::SetValue | ( | int | A,
|  | double | percent |
| ) |  |  |

Parameters:

  | A,: | the mass number of the isotope.
  | percent,: | the abundance of the isotope.

This method is used when building an Isotopic Pattern from raw data. IsotopicPattern::SetMonoMass should be called when data for each isotope have been entered.

void gcu::IsotopicPattern::Normalize | ( |  | ) |

Effects the same multiplication on all abundances so that the largest becomes 100.

void gcu::IsotopicPattern::Clear | ( |  | ) |

Clears the contents of an isotopic pattern for reuse.

void gcu::IsotopicPattern::Ref | ( |  | ) | `[inline]`

Increments the reference count of the pattern.

Definition at line 119 of file isotope.h.

void gcu::IsotopicPattern::Unref | ( |  | ) |

Decrements the reference count of the pattern. If the reference count becomes 0, the object is destroyed.

int gcu::IsotopicPattern::GetMinMass | ( |  | ) | `[inline]`

Returns:
  the mass (actually the nucleons number) of the fragment with the lowest mass. This might not be the real minimu, since fragments with very low abundance are discarded during the evaluation.

Definition at line 130 of file isotope.h.

int gcu::IsotopicPattern::GetMonoNuclNb | ( |  | ) | `[inline]`

Returns:
  the nucleons number of the fragment made with most abundant isotopes of each element.

Definition at line 135 of file isotope.h.

double gcu::IsotopicPattern::GetMonoMass | ( |  | ) | `[inline]`

Returns:
  the mass of the fragment made with most abundant isotopes of each element.

Definition at line 140 of file isotope.h.

void gcu::IsotopicPattern::SetMonoMass | ( | double | mass | ) |

Parameters:

  | mass,: | the mass of the most abundant isotope.

This method is used when building an Isotopic Pattern from raw data. To enter the data for each isotope, use IsotopicPattern::SetValue. It has no effect if the current monoisotopic mass is not nul.

int gcu::IsotopicPattern::GetValues | ( | double ** | values | ) |

Parameters:

  | values,: | where to store the pointer to the abundances of the various mass fragments as a percentage of the most abundant one. The pointer should be freed with g_free when not anymore nedded.

Returns:
  the number of values in the array.

The documentation for this class was generated from the following file:

- isotope.h