Macaulay2 Engine
Loading...
Searching...
No Matches
Word.cpp
Go to the documentation of this file.
1#include "NCAlgebras/Word.hpp"
2#include <iostream>
3
4std::ostream& operator<<(std::ostream& o, const Word& w)
5{
6 o << "[";
7 if (w.size() > 0)
8 {
9 int i = 0;
10 for (; i < w.size() - 1; ++i)
11 {
12 o << w.begin()[i] << ",";
13 }
14 o << w.begin()[i];
15 }
16 o << "]";
17 return o;
18}
19
20std::ostream& operator<<(std::ostream& o, const WordWithData& w)
21{
22 o << w.word() << "(" << w.ecartDegree() << ")";
23 return o;
24}
25
26// Local Variables:
27// compile-command: "make -C $M2BUILDDIR/Macaulay2/e "
28// indent-tabs-mode: nil
29// End:
std::ostream & operator<<(std::ostream &o, const Word &w)
Definition Word.cpp:4
Word and WordWithData — non-owning views over the flat-int encoding of a non-commutative word.
const int * begin() const
Definition Word.hpp:72
int size() const
Definition Word.hpp:74
Non-owning view of a non-commutative word: [begin, end) of int variable indices.
Definition Word.hpp:56
Word word() const
Definition Word.hpp:143
int ecartDegree() const
Definition Word.hpp:145
Word plus its ecart degree and heft degree — the value type WordWithDataTable stores.
Definition Word.hpp:116