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 class ASTResolver;
17
23 class Array : public IExpression {
24 public:
25 Array(const Expression &top, const int &size, const Expression &address = 0);
26 std::string to_string(const ASTResolver *resolver = nullptr) const override;
27 void resolve(ASTResolver &resolver) const override;
28 operator Expression();
29 complex_t operator()() const override;
30 Expression operator[](const Expression &address) const;
31 Expression top() const { return m_top; }
32 int size() const { return m_size; }
33
34 private:
35 Expression m_top;
36 Expression m_address;
37 int m_size;
38 };
39} // namespace AmpGen
40
41#endif
(Internal) class to aide in the resolution of the dependencies of expression trees.
Definition ASTResolver.h:30
Array(const Expression &top, const int &size, const Expression &address=0)
int size() const
Definition Array.h:32
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:31
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