Documentation of CSL
interface_indicial.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 #ifndef INTERFACE_INDICIAL_H_INCLUDED
24 #define INTERFACE_INDICIAL_H_INCLUDED
25 
26 #include <string>
27 #include <vector>
28 #include "abstract.h"
29 
30 namespace csl {
31 
32 class Tensor;
33 class Space;
34 class Index;
35 
36 void AddProperty(csl::Tensor & tensor,
37  Expr const& A,
38  Expr const& B,
39  Expr const& res);
40 
41 void AddProperty(csl::Tensor & tensor,
42  std::vector<Expr> const& product,
43  Expr const& res);
44 
45 const csl::Space* GetSpace(csl::Tensor const& tensor,
46  int pos = 0);
47 
48 csl::Index GetIndex(csl::Tensor const& tensor,
49  int pos = 0);
50 
51 csl::Index GetIndex(csl::Space const* space);
52 
53 std::vector<csl::Index> GetIndices(
54  size_t N,
55  csl::Space const* space);
56 
57 csl::Index GetIndex(csl::Space const& space);
58 
59 std::vector<csl::Index> GetIndices(
60  size_t N,
61  csl::Space const& space);
62 
63 std::vector<csl::Index> GetIndices(
64  size_t N,
65  csl::Tensor const &tensor,
66  int pos = 0
67  );
68 
69 std::vector<csl::Index> GetFullSetOfIndicesFor(
70  csl::Tensor const& tensor);
71 
72 Tensor Unitary(std::string const& name,
73  csl::Space const* space);
74 
75 bool TestIndexSanity(
76  Expr const &expr,
77  bool verbose = false
78  );
79 
80 }
81 
82 
83 #endif
Namespace for csl library.
Definition: abreviation.h:34
Index object that is used for indicial objects.
Definition: index.h:75
Vector space that has a name, a dimension, a delta tensor and possibly a non-trivial metric...
Definition: space.h:64
Base classes for all exprs in the program.
Definition: indicial.h:675