49 explicit Array(
unsigned int n);
75 std::list<std::string> GetSymbolsList()
const;
76 const std::vector<double>& GetData()
const {
return data;}
77 std::list<double> GetDataList()
const;
85 template<
template <
typename,
typename>
class Container>
86 void Copy(Container<std::string, std::allocator<std::string>>& cpy)
88 for (
const std::string& name : cpy)
93 template<
typename T,
template <
typename,
typename>
class Container>
94 void Copy(Container<T, std::allocator<T>>& cpy)
97 {
data.push_back(value);}
101 template<
template <
typename,
typename>
class Container>
102 void set_vector(Container<std::string, std::allocator<std::string>>& dst)
const
104 for (std::string symbol :
symbols)
106 dst.push_back(symbol);
108 std::cout << symbol <<
" ";
112 std::cout << std::endl;
117 template<
typename T,
template <
typename,
typename>
class Container>
120 for (
auto value :
data)
122 dst.push_back((T)value);
124 std::cout << (T)value <<
" ";
128 std::cout << std::endl;
Representation of arrays used in tokens.
const std::vector< std::string > & GetSymbols() const
Access.
void Copy(Container< std::string, std::allocator< std::string > > &cpy)
Copy STL string containers into symbols.
void set_vector(Container< std::string, std::allocator< std::string > > &dst) const
Copy symbols into STL string containers.
static Array * Subtract(Array *a1, Array *a2)
Constructor from subtracting 2 double arrays.
static Array * Multiply(Array *a, double d)
Constructor from multiplying an array.
std::vector< std::string > symbols
Representation of string array.
void Copy(Container< T, std::allocator< T > > &cpy)
Copy STL numerical containers into data.
std::vector< double > data
Representation of double array.
static Array * Divide(Array *a, double d)
Constructor from dividing an array.
static Array * Add(Array *a1, Array *a2)
Constructor from adding 2 double arrays.
double Product(Array *a)
Scalar vector product.
Array()
Default Constructor.
void set_vector(Container< T, std::allocator< T > > &dst) const
Copy data into STL numerical containers.
Common header for the lexer and the parser to share Symbol table for numeric variables,...
Parser namespace for GMAD language. Combination of Geant4 and MAD.