FLAME  devel
 All Classes Functions Variables Typedefs Enumerations Pages
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | List of all members
VectorState Struct Reference

Simulation state which include only a vector. More...

#include <vector.h>

Inheritance diagram for VectorState:
Inheritance graph
[legend]
Collaboration diagram for VectorState:
Collaboration graph
[legend]

Public Types

enum  { maxsize =6 }
 
enum  param_t {
  PS_X, PS_PX, PS_Y, PS_PY,
  PS_S, PS_PS
}
 
typedef
boost::numeric::ublas::vector
< double,
boost::numeric::ublas::bounded_array
< double, maxsize > > 
value_t
 

Public Member Functions

 VectorState (const Config &c)
 
virtual void assign (const StateBase &other)
 
virtual void show (std::ostream &strm) const
 
virtual bool getArray (unsigned idx, ArrayInfo &Info)
 Introspect named parameter of the derived class. More...
 
virtual VectorStateclone () const
 
- Public Member Functions inherited from StateBase
virtual void show (std::ostream &, int level=0) const
 

Public Attributes

value_t state
 
- Public Attributes inherited from StateBase
size_t next_elem
 
double pos
 absolute longitudinal position at end of Element
 

Protected Member Functions

 VectorState (const VectorState &o, clone_tag)
 
- Protected Member Functions inherited from StateBase
 StateBase (const Config &c)
 
 StateBase (const StateBase &c, clone_tag)
 For use in clone()
 

Detailed Description

Simulation state which include only a vector.

Definition at line 13 of file vector.h.

Member Function Documentation

void VectorState::assign ( const StateBase other)
virtual

virtual equivalent to operator=() Should only be used with another State originating from the same Machine from Machine::allocState() or clone().

Implements StateBase.

Definition at line 95 of file linear.cpp.

virtual VectorState* VectorState::clone ( ) const
inlinevirtual

Allocate a new instance which is a copy of this one. Caller is responsible to delete the returned pointer

Implements StateBase.

Definition at line 35 of file vector.h.

bool VectorState::getArray ( unsigned  index,
ArrayInfo Info 
)
virtual

Introspect named parameter of the derived class.

Parameters
idxThe index of the parameter
Infomailbox to be filled with information about this paramter
Returns
true if 'idx' is valid and Info was filled in, otherwise false

To introspect call this with index increasing from zero until false is returned.

Sub-classes are required to maintain a fixed number of parameters. The same ArrayInfo::name should alwaysbe returned for a given index. Similarly ArrayInfo::ndim and ArrayInfo.type should not change.

ArrayInfo::ptr, ArrayInfo::dim, ArrayInfo::stride are allowed to change when the state is passed to Machine::propagate().

Therefore, if getArray() for an instance has returned true for some index, then a caller may assume that all future calls to getArray() for this instance will also return true. However, the caller must still re-call getArray() in future as the storage and sizes may have changed.

Reimplemented from StateBase.

Definition at line 109 of file linear.cpp.


The documentation for this struct was generated from the following files: