file
BNAlgebra.hdeclares the BarNatan algebra from [4]
The BarNatan algebra is implemented as a category in terms of objects (BNObj) and morphisms between them (BNMor, Label). We also use the classes defined here to implement the free polynomial ring , namely we regard it as the subalgebra of based at the idempotent ●.
Classes
Typedefs
 using Idem = bool
 idempotent of the BarNatan algebra : true = 1 = ● (= b = ⦁ = ⬮) and false = 0 = ○ (= c = ∘ = ⬯).
Functions
 auto arrow_is_shorter(const int& a, const int& b) > bool
 false if a=0; otherwise true if a<b, assuming both have the same sign. This function is needed in the arrow pushing algorithm.

template<typename Coeff>auto BNMorNonZero(const int& row, const int& col, const BNMor<Coeff>& value) > bool
 true if morphism is zero; this function is needed by the Eigen Template Library

template<typename Coeff>auto label_is_zero(const Label<Coeff>& label) > bool
 true if the coefficient of the label is zero. This function is used in BNMor::
simplify() .