FLAME  devel
 All Classes Functions Variables Typedefs Enumerations Pages
vector.h
1 #ifndef FLAME_STATE_VECTOR_H
2 #define FLAME_STATE_VECTOR_H
3 
4 #include <ostream>
5 
6 #include <boost/numeric/ublas/vector.hpp>
7 #include <boost/numeric/ublas/storage.hpp>
8 
9 #include "../base.h"
10 
13 struct VectorState : public StateBase
14 {
15  enum {maxsize=6};
16  enum param_t {
17  PS_X, PS_PX, PS_Y, PS_PY, PS_S, PS_PS
18  };
19 
20  VectorState(const Config& c);
21  virtual ~VectorState();
22 
23  virtual void assign(const StateBase& other);
24 
25  typedef boost::numeric::ublas::vector<double,
26  boost::numeric::ublas::bounded_array<double, maxsize>
27  > value_t;
28 
29  virtual void show(std::ostream& strm) const;
30 
31  value_t state;
32 
33  virtual bool getArray(unsigned idx, ArrayInfo& Info);
34 
35  virtual VectorState* clone() const {
36  return new VectorState(*this, clone_tag());
37  }
38 
39 protected:
40  VectorState(const VectorState& o, clone_tag);
41 };
42 
43 #endif // FLAME_STATE_VECTOR_H
virtual void assign(const StateBase &other)
Definition: linear.cpp:95
Simulation state which include only a vector.
Definition: vector.h:13
The abstract base class for all simulation state objects.
Definition: base.h:28
Associative configuration container.
Definition: config.h:66
Used with StateBase::getArray() to describe a single parameter.
Definition: base.h:48
virtual VectorState * clone() const
Definition: vector.h:35
virtual bool getArray(unsigned idx, ArrayInfo &Info)
Introspect named parameter of the derived class.
Definition: linear.cpp:109
Used with clone ctor.
Definition: base.h:134