link to homepage

Institute for Neuroscience and Medicine

Navigation and service


API documentation

TPOI.h

Go to the documentation of this file.
00001 
00005 /*
00006  *  JEMRIS Copyright (C) 2007-2010  Tony Stöcker, Kaveh Vahedipour
00007  *                                  Forschungszentrum Jülich, Germany
00008  *
00009  *  This program is free software; you can redistribute it and/or modify
00010  *  it under the terms of the GNU General Public License as published by
00011  *  the Free Software Foundation; either version 2 of the License, or
00012  *  (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 Street, Fifth Floor, Boston, MA  02110-1301  USA
00022  */
00023 
00024 #ifndef TPOI_H_
00025 #define TPOI_H_
00026 
00027 #include <cstdlib>
00028 #include <vector>
00029 #include <iostream>
00030 using namespace std;
00031 
00032 #include "Declarations.h"
00033 
00034 //const double TIME_ERR_TOL = 1e-6; // Avoid CVODE warnings. Doesn't affect physics.
00035 
00037 
00038 class TPOI {
00039 
00040  public:
00041 
00043 
00044     struct set {
00045 
00046         double dtime;    
00047         double dphase;   
00055         set(double time, double phase) {
00056             dtime  = time;
00057             dphase = phase;
00058         }
00059 
00065         set(double time) {
00066                 dtime  = time;
00067                 dphase = -1.0;
00068         }
00069 
00070     };
00071 
00078     TPOI() {
00079 
00080         // Reset my data repository
00081         Reset();
00082 
00083     };
00084 
00085 
00089     void Reset () {
00090         // Set position back to first slot and values to zero
00091         m_time.clear();
00092         m_phase.clear();
00093     }
00094 
00100     ~TPOI() {
00101     };
00102 
00103 
00111     void operator += (const TPOI& tpoi);
00112 
00121     TPOI operator + (const TPOI& tpoi);
00122 
00129     void operator + (const set& data);
00130 
00136      int GetSize () const ;
00137 
00138 
00145      double GetTime  (int pos) {return m_time[pos];    };
00146 
00153      double GetPhase (int pos) {return m_phase[pos];   };
00154 
00158     void Sort ();
00159 
00163     void Purge ();
00164 
00165  private:
00166 
00167     vector<double> m_time;    
00168     vector<double> m_phase;   
00171 };
00172 
00173 #endif

Servicemeu

institutes

Scientific Technical Facilities