Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
sgloperations.h
Go to the documentation of this file.
1 // This file is part of MARTY.
2 //
3 // MARTY is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, either version 3 of the License, or
6 // (at your option) any later version.
7 //
8 // MARTY is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with MARTY. If not, see <https://www.gnu.org/licenses/>.
15 
23 #pragma once
24 
25 #include "multifunction.h"
26 
27 namespace sgl {
28 
29  class Sum: public AbstractMultiFunction {
30  public:
31  using AbstractMultiFunction::AbstractMultiFunction;
32 
33  bool isZero() const override;
34 
35  GExpr copy() const override;
36  GExpr refresh() const override;
37 
38  bool contains(csl::Index const &index) const override;
39  void replace(csl::Index const &i, csl::Index const &j) override;
40 
41  csl::Expr toCSL(TensorSet const&) const override;
42 
43  void merge();
44  void print(std::ostream &out) const override;
45  };
46 
47  class Prod: public AbstractMultiFunction {
48  public:
49  using AbstractMultiFunction::AbstractMultiFunction;
50 
51  bool isZero() const override;
52 
53  csl::Expr getFactor() const override;
54  GExpr getTerm() const override;
55 
56  GExpr copy() const override;
57  GExpr refresh() const override;
58 
59  bool contains(csl::Index const &index) const override;
60  void replace(csl::Index const &i, csl::Index const &j) override;
61 
62  csl::Expr toCSL(TensorSet const&) const override;
63 
64  void print(std::ostream &out) const override;
65 
66  void merge();
67  void applyProperties();
68  GExpr expand();
69  };
70 
71  GExpr sum_s(std::vector<GExpr> args);
72  GExpr prod_s(std::vector<GExpr> args);
73 }
Definition: tensorset.h:30
Expr prod_s(const Expr &leftOperand, const Expr &rightOperand, bool explicitProd=0)
Definition: abstractgammasym.h:87
Definition: abstractgammasym.h:32
Base class for expressions with arguments in SGL.
Definition: sgloperations.h:29
Definition: multifunction.h:29
Definition: sgloperations.h:47