C++QEDElements  2.100.2 (v2 Milestone 10 Development branch)
a framework for simulating open quantum dynamics – generic elements
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Modules Pages
ParticleInitialCondition.h
1 // Copyright András Vukics 2006–2014. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.txt)
2 // -*- C++ -*-
3 #ifndef CPPQEDELEMENTS_UTILS_PARTICLEINITIALCONDITION_H_INCLUDED
4 #define CPPQEDELEMENTS_UTILS_PARTICLEINITIALCONDITION_H_INCLUDED
5 
6 #include<boost/tuple/tuple_io.hpp>
7 
8 
9 namespace particle {
10 
12 {
13 public:
14  typedef boost::tuple<double,double,double,bool> Impl;
15 
16  InitialCondition(double x0, double k0, double sig, bool isItInK=false) : impl_(x0,k0,sig,isItInK) {}
17 
18  double getX0 () const {return impl_.get<0>();}
19  double getK0 () const {return impl_.get<1>();}
20  double getSig() const {return impl_.get<2>();}
21  bool isInK () const {return impl_.get<3>();}
22 
23  const Impl& get() const {return impl_;}
24 
25  Impl& get() {return const_cast<Impl&>(static_cast<const InitialCondition&>(*this).get());}
26 
27 private:
28  const Impl impl_;
29 
30 };
31 
32 
33 inline std::ostream& operator<<(std::ostream& os, const InitialCondition& ic) {return os<<ic.get();}
34 inline std::istream& operator>>(std::istream& is, InitialCondition& ic) {return is>>ic.get();}
35 
36 
37 
38 } // particle
39 
40 
41 #endif // CPPQEDELEMENTS_UTILS_PARTICLEINITIALCONDITION_H_INCLUDED
std::ostream & operator<<(std::ostream &, Method)
std::istream & operator>>(std::istream &, Method &)