The Gnome Chemistry Utils  0.14.0
isotope.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*
4  * Gnome Chemistry Utils
5  * isotope.h
6  *
7  * Copyright (C) 2005-2008 Jean Bréfort <jean.brefort@normalesup.org>
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License as
11  * published by the Free Software Foundation; either version 3 of the
12  * License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
22  * USA
23  */
24 
25 #ifndef GCU_ISOTOPE_H
26 #define GCU_ISOTOPE_H
27 
28 #include <gcu/chemistry.h>
29 #include <gcu/value.h>
30 #include <vector>
31 
33 namespace gcu
34 {
35 
39 class Isotope: public GcuIsotope
40 {
41 public:
46  Isotope ();
50  ~Isotope ();
51 };
52 
62 {
63 public:
68  IsotopicPattern ();
74  IsotopicPattern (int min, int max);
75  ~IsotopicPattern ();
76 
83  IsotopicPattern *Simplify (void);
95  IsotopicPattern *Square (void);
100  void Copy (IsotopicPattern& pattern);
101 
109  void SetValue (int A, double percent);
114  void Normalize ();
118  void Clear ();
122  void Ref () {ref_count++;}
127  void Unref ();
133  int GetMinMass () {return m_min;}
138  int GetMonoNuclNb () {return m_mono;}
143  SimpleValue const &GetMonoMass () {return m_mono_mass;}
151  void SetMonoMass (SimpleValue mass);
159  int GetValues (double **values);
160 
161 private:
162  int m_min, m_max, m_mono;
163  int ref_count;
164  std::vector < double > m_values;
165  SimpleValue m_mono_mass;
166  static double epsilon;
167 };
168 
169 }
170 #endif // GCU_ISOTOPE_H