# #include <sources/headers/Complex.h>template<typename Coeff> Complex<BNObj, BNMor, Coeff> class

Specialization of Complex to the Bar-Natan algebra (BNAlgebra.h)

## Base classes

template<typename Obj, template<typename> typename Mor, typename Coeff>
class Complex_Base<BNObj, BNMor, Coeff>
base class for complexes

## Constructors, destructors, conversion operators

const Chains<Coeff> chains)
constructor from Chains

## Public functions

void clean_up(ssize_t max_iter = max_clean_up_iter)
attempts to turn a complex into a loop-type complex in the sense of [2], so it can be converted to chains (Chains)
void clean_up_once(const bool& faceD)
makes the complex correspond to a precurve in the sense of [4] which is simply-faced with respect to if 'faceD'==true and if 'faceD'==false.
auto cone(const int& n) const -> Complex<BNObj, BNMor, Coeff>
cone of the endomorphism on the complex defined by . For example, is the cone of on the complex . If , this acts like the identity; raises an exception.
auto is_loop_type() const -> bool
true if each generator of the complex is connected to at most one other generator along a differential labelled by a power of , and the same for powers of . We assume the complex is fully reduced.
auto is_loop_type(const bool& faceD) const -> bool
true if each generator of the complex is connected to at most one other generator along a differential labelled by a power of if 'faceD'==true and if 'faceD'==false. We assume the complex is fully reduced.
void isolate_arrow(const size_t& start, const size_t& end, const bool& faceD)
implements the main step of the proof of Proposition 5.10 in [4], compare also Proposition 4.16 [14]. After this step, the component of the differential from 'start' to 'end' in the face corresponding to the algebra element if 'faceD==true ( if 'faceD==false) is the only one connecting these two generators in this face.
auto operator+(const Complex<BNObj, BNMor, Coeff>& cx2) const -> Complex<BNObj, BNMor, Coeff>
Take the tensor product between two complexes corresponding to taking the (vertical) tangle sum, ie stack two 2-2-tangles. cx2 is the lower one.
void print(const std::string& name = "", const std::string& metadata = "", const bool is_4ended = true, const bool& is_Khr = false) const
if name is empty, print string representation of complex into terminal; if name is non-empty, prints the string representation into the file specified by 'name'. Metadata must be provided. If the complex is loop-type (see is_loop_type()), the complex is first converted into chains (see Chains.h); 'is_4ended' should be false if algebra elements should be interpreted as elements of the free polynomial ring in the variable (ie for four-ended tangles). 'is_Khr' should be true if components are expected to be special and rational see [6].
auto to_chains() const -> Chains<Coeff>
Chains corresponding to the complex over the Bar-Natan algebra, see Chains.h for details.