Chains
ComputationalHomology.AbstractChain
— TypeAbstractChain{C, R}
A chain is a formal linear combination of C
-type elements in R
-module.
Given a C
-type element set $E$, we can construct a free R
-module $M$ that has $E ⊆ M$ as a basis $M$, the module $M$ is the module of the formal linear combinations of elements of $E$, or free module over $E$, $R^{(E)}$, s.t. given a finite subset ${X_1, ..., X_n}$ of $E$, a formal linear combination of $X_1, ..., X_n$ is
$a_1 X_1 + ··· + a_n X_n$
where the $a_i$ ∈ R
.
ComputationalHomology.Chain
— TypeChain{IX<:Integer, R}
The chain of integer elements for R
-module.
This chain implementation uses a dictionary for storing elements and coefficients.
ComputationalHomology.EmptyChain
— TypeEmptyChain
It's a dummy chain class that does not store anything.
Every chain implementation need to implement following interface functions.
ComputationalHomology.dim
— Methoddim(ch::AbstractChain)
Returns the dimension of the chain ch
.
Base.length
— Methodlength(ch::AbstractChain)
Returns the length of the chain ch
.
Base.keys
— Methodkeys(ch::AbstractChain)
Returns elements of the chain ch
.
Base.values
— Methodvalues(ch::AbstractChain)
Returns coefficients of the chain ch
.
Base.copy
— Methodcopy(ch::AbstractChain)
Returns the copy of the chain ch
.
Missing docstring for setindex!(::AbstractChain{C,R}, ::C, ::R) where {C,R}
. Check Documenter's build log for details.
Base.getindex
— Methodgetindex(ch::AbstractChain{C,R}, e::C)
Returns a coefficient of the element e
of the chain ch
.
Base.push!
— Methodpush!(ch:: AbstractChain{C,R}, e::Pair{C,R})
Add element with coefficient e
to the chain ch
. If the element is already in the chain then the coefficient value of e
will be added to the chain element coefficient.
Use setindex!
to reset an element coefficient in the chain.
Base.iterate
— Methoditerate(ch::AbstractChain)
Return a element/coefficient iterator of the chain ch
ComputationalHomology.simplify
— Methodsimplify(ch::AbstractChain)
Returns a simplified (without 0 elements) copy of the chain ch
.
There are additional function available after implementing the above interface.
Missing docstring for iszero(::AbstractChain)
. Check Documenter's build log for details.
Missing docstring for keytype(::AbstractChain)
. Check Documenter's build log for details.
Missing docstring for valtype(::AbstractChain)
. Check Documenter's build log for details.
Missing docstring for push!(::AbstractChain{C,R}, ::C, ::R) where {C,R}
. Check Documenter's build log for details.
Missing docstring for push!(::AbstractChain{C,R}, ::Tuple{C,R}) where {C,R}
. Check Documenter's build log for details.
Base.map
— Methodmap(f, ch::AbstractChain)
Apply function f
to every coefficient of the chain ch
.
Missing docstring for map!(f, ::AbstractChain, ::AbstractChain)
. Check Documenter's build log for details.
Base.in
— Methodin(e, ch::AbstractChain)
Check if the element e
in the chain ch
.
Base.append!
— Methodappend!(a::AbstractChain, b::AbstractChain)
Perform mutable addition of the chain b
to the chain a
.
Base.:+
— Method+(ch::AbstractChain{C,R}, e::Tuple{C,R})
Perform non-mutable addition of the element e
with a coefficient to the chain ch
.
Base.:+
— Method+(ch::AbstractChain{C,R}, r::R)
Perform non-mutable addition of the coefficient r
to every element of the chain ch
.