00001 // -*- C++ -*- 00002 00003 /* 00004 * Gnome Chemistry Utils 00005 * isotope.h 00006 * 00007 * Copyright (C) 2005-2007 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 00032 namespace gcu 00033 { 00034 00038 class Isotope: public GcuIsotope 00039 { 00040 public: 00045 Isotope (); 00046 ~Isotope (); 00047 }; 00048 00057 class IsotopicPattern 00058 { 00059 public: 00064 IsotopicPattern (); 00070 IsotopicPattern (int min, int max); 00071 ~IsotopicPattern (); 00072 00079 IsotopicPattern *Simplify (void); 00085 IsotopicPattern *Multiply (IsotopicPattern& pattern); 00091 IsotopicPattern *Square (void); 00096 void Copy (IsotopicPattern& pattern); 00097 00105 void SetValue (int A, double percent); 00110 void Normalize (); 00114 void Clear (); 00118 void Ref () {ref_count++;} 00123 void Unref (); 00129 int GetMinMass () {return m_min;} 00134 int GetMonoNuclNb () {return m_mono;} 00139 SimpleValue const &GetMonoMass () {return m_mono_mass;} 00147 void SetMonoMass (SimpleValue mass); 00155 int GetValues (double **values); 00156 00157 private: 00158 int m_min, m_max, m_mono; 00159 int ref_count; 00160 std::vector<double> m_values; 00161 SimpleValue m_mono_mass; 00162 static double epsilon; 00163 }; 00164 00165 } 00166 #endif // GCU_ISOTOPE_H