23 #ifndef CSL_LIBRARY_EXPANDER_H_INCLUDED 24 #define CSL_LIBRARY_EXPANDER_H_INCLUDED 60 static std::vector<Structure> parse(
65 static size_t nCommonIndices(
71 std::vector<Structure> &A,
72 std::vector<Structure>
const &B
75 static std::vector<Structure> merge(
76 std::vector<std::vector<Structure>> &init,
86 std::vector<Structure>
const &init,
101 std::swap(first, second);
116 inline csl::Index const &getFirst()
const {
return first; }
117 inline csl::Index const &getSecond()
const {
return second; }
119 inline void setFirst(
csl::Index const &index) {
123 inline void setSecond(
csl::Index const &index) {
129 return first == other.first
130 and second == other.second;
133 return !(*
this == other);
137 if (first < other.first)
139 return (!(other.first < first)) ? second < other.second :
false;
155 inline bool isZero()
const {
156 return factor == CSL_0;
159 void add(
Expr const &t_factor);
161 void mult(
Expr const &t_factor);
163 void mult(
ipair const &p);
177 static int commonIndex(
183 size_t reserveStorage = 10;
186 std::vector<ipair> indices;
Definition: libraryexpander.h:91
Namespace for csl library.
Definition: abreviation.h:34
Index object that is used for indicial objects.
Definition: index.h:75
Definition: libraryexpander.h:34
void sort(std::vector< Expr > &argument)
Sorts a container using mergeSort().
Definition: sort.cpp:89
Expr operator*(const Expr &a, const Expr &b)
Shortcut function that allows to use arithmetic operator * with Expr (== shared_ptr<Abstract>).
Definition: abstract.cpp:1351
Vector space that has a name, a dimension, a delta tensor and possibly a non-trivial metric...
Definition: space.h:64
bool operator==(const Expr &a, const Expr &b)
see Abstract::operator==()
Definition: abstract.cpp:1398
Base classes for all exprs in the program.
Definition: libraryexpander.h:93
const Space & Minkowski
Space with a metric g = diag(-1,1,1,1).
Definition: space.h:448
bool operator<(const Expr &a, const Expr &b)
see Abstract::operator<()
Definition: abstract.cpp:1423
bool operator!=(const Expr &a, const Expr &b)
see Abstract::operator!=()
Definition: abstract.cpp:1404
Expression type/.
Definition: abstract.h:1573