AmpGen 2.1
Loading...
Searching...
No Matches
Array.h
Go to the documentation of this file.
1#ifndef AMPGEN_ARRAY_H
2#define AMPGEN_ARRAY_H
3
4#include <memory>
5#include <vector>
6#include <cstddef>
7#include <memory>
8#include <string>
9#include <utility>
10
11#include "AmpGen/Expression.h"
13#include "AmpGen/Types.h"
14
15namespace AmpGen
16{
17 class ASTResolver;
18
24 class Array : public IExpression
25 {
26 public:
27 Array( const Expression& top, const int& size, const Expression& address = 0 );
28 std::string to_string(const ASTResolver* resolver=nullptr) const override ;
29 void resolve( ASTResolver& resolver ) const override;
30 operator Expression();
31 complex_t operator()() const override;
32 Expression operator[]( const Expression& address ) const;
33 Expression top() const { return m_top ; }
34 int size() const { return m_size; }
35 private:
36 Expression m_top;
37 Expression m_address;
38 int m_size;
39 };
40} // namespace AmpGen
41
42#endif
(Internal) class to aide in the resolution of the dependencies of expression trees.
Definition ASTResolver.h:29
Array(const Expression &top, const int &size, const Expression &address=0)
int size() const
Definition Array.h:34
complex_t operator()() const override
Evaluate the expression using the tree, will generally be very slow but ocassionally useful for debug...
Expression top() const
Definition Array.h:33
void resolve(ASTResolver &resolver) const override
Resolve the dependencies of a tree using an ASTResolver, which keeps track of parameters,...
std::string to_string(const ASTResolver *resolver=nullptr) const override
Called to convert the Expression tree into source code.
Expression operator[](const Expression &address) const
Wrapper class for shared_ptrs to virtual expressions for use in conjunction with operators to build e...
Definition Expression.h:135
Virtual base class for other expression tree components.
Definition Expression.h:116
std::complex< real_t > complex_t
Definition Types.h:7