|
BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
Representation of arrays used in tokens. More...
#include <array.h>

Public Member Functions | |
| Array () | |
| Default Constructor. | |
| Array (Symtab *) | |
| Constructor from symbol. | |
| double | Product (Array *a) |
| Scalar vector product. | |
| const std::vector< std::string > & | GetSymbols () const |
| Access. | |
| std::list< std::string > | GetSymbolsList () const |
| const std::vector< double > & | GetData () const |
| std::list< double > | GetDataList () const |
| void | Clear () |
| Clear data. | |
| void | Print () |
| Print data. | |
| template<template< typename, typename > class Container> | |
| void | Copy (Container< std::string, std::allocator< std::string > > &cpy) |
| Copy STL string containers into symbols. | |
| template<typename T , template< typename, typename > class Container> | |
| void | Copy (Container< T, std::allocator< T > > &cpy) |
| Copy STL numerical containers into data. | |
| template<template< typename, typename > class Container> | |
| void | set_vector (Container< std::string, std::allocator< std::string > > &dst) const |
| Copy symbols into STL string containers. | |
| template<typename T , template< typename, typename > class Container> | |
| void | set_vector (Container< T, std::allocator< T > > &dst) const |
| Copy data into STL numerical containers. | |
Static Public Member Functions | |
| static Array * | Add (Array *a1, Array *a2) |
| Constructor from adding 2 double arrays. | |
| static Array * | Subtract (Array *a1, Array *a2) |
| Constructor from subtracting 2 double arrays. | |
| static Array * | Add (Array *a, double d) |
| Constructor from adding an array. | |
| static Array * | Subtract (Array *a, double d) |
| Constructor from subtracting an array. | |
| static Array * | Multiply (Array *a, double d) |
| Constructor from multiplying an array. | |
| static Array * | Divide (Array *a, double d) |
| Constructor from dividing an array. | |
Private Member Functions | |
| Array (unsigned int n) | |
| Helper constructor method, creates data array with size n. | |
Private Attributes | |
| std::vector< std::string > | symbols |
| Representation of string array. | |
| std::vector< double > | data |
| Representation of double array. | |
Friends | |
| class | Symtab |
| Symtabs and arrays are kind of interchangeable. | |
Representation of arrays used in tokens.
Used for both std::string and double
|
explicitprivate |
| Array::Array | ( | ) |
Default Constructor.
Definition at line 27 of file array.cc.
Referenced by Add(), Add(), Divide(), Multiply(), Subtract(), and Subtract().

|
explicit |
Constructor from symbol.
Definition at line 31 of file array.cc.
References GMAD::Symtab::array, and data.
| void Array::Clear | ( | ) |
|
inline |
Copy STL string containers into symbols.
Definition at line 86 of file array.h.
References symbols.
Referenced by GMAD::Parser::FillArray(), and GMAD::Parser::FillString().

|
inline |
|
inline |
|
inline |
| void Array::Print | ( | ) |
| double Array::Product | ( | Array * | a | ) |
|
inline |
Copy symbols into STL string containers.
Definition at line 102 of file array.h.
References symbols.
Referenced by GMAD::CoolingChannel::set_value(), GMAD::PhysicsBiasing::set_value(), and GMAD::Material::set_value().

|
inline |
|
friend |
|
private |
Representation of double array.
Definition at line 46 of file array.h.
Referenced by Add(), Add(), Array(), Array(), Clear(), Copy(), Divide(), Multiply(), Print(), Product(), GMAD::Symtab::Set(), set_vector(), Subtract(), and Subtract().
|
private |
Representation of string array.
Definition at line 44 of file array.h.
Referenced by Clear(), Copy(), GetSymbols(), Print(), and set_vector().