00001 // -*- C++ -*- 00002 00003 /* 00004 * Gnome Chemistry Utils 00005 * isotope.h 00006 * 00007 * Copyright (C) 2005-2006 00008 * 00009 * Developed by Jean Bréfort <jean.brefort@normalesup.org> 00010 * 00011 * This program is free software; you can redistribute it and/or 00012 * modify it under the terms of the GNU General Public License as 00013 * published by the Free Software Foundation; either version 2 of the 00014 * License, or (at your option) any later version. 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU General Public License 00022 * along with this program; if not, write to the Free Software 00023 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 00024 * USA 00025 */ 00026 00027 #ifndef GCU_ISOTOPE_H 00028 #define GCU_ISOTOPE_H 00029 00030 #include <gcu/chemistry.h> 00031 #include <vector> 00032 00033 using namespace std; 00034 00035 namespace gcu 00036 { 00037 00041 class Isotope: public GcuIsotope 00042 { 00043 public: 00048 Isotope (); 00049 ~Isotope (); 00050 }; 00051 00060 class IsotopicPattern 00061 { 00062 public: 00067 IsotopicPattern (); 00073 IsotopicPattern (int min, int max); 00074 ~IsotopicPattern (); 00075 00082 IsotopicPattern *Simplify (void); 00088 IsotopicPattern *Multiply (IsotopicPattern& pattern); 00094 IsotopicPattern *Square (void); 00099 void Copy (IsotopicPattern& pattern); 00100 00108 void SetValue (int A, double percent); 00113 void Normalize (); 00117 void Clear (); 00121 void Ref () {ref_count++;} 00126 void Unref (); 00132 int GetMinMass () {return m_min;} 00137 int GetMonoNuclNb () {return m_mono;} 00142 double GetMonoMass () {return m_mono_mass;} 00150 void SetMonoMass (double mass); 00158 int GetValues (double **values); 00159 00160 private: 00161 int m_min, m_max, m_mono; 00162 int ref_count; 00163 vector<double> m_values; 00164 double m_mono_mass; 00165 static double epsilon; 00166 }; 00167 00168 } 00169 #endif // GCU_ISOTOPE_H