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