Skip to content

Commit

Permalink
feat: Overload exponentiation operator for BioMarkovChain
Browse files Browse the repository at this point in the history
  • Loading branch information
camilogarciabotero committed Jul 29, 2024
1 parent 533e53d commit 09f0371
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/extended.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,10 @@ end

@inline Base.length(bmc::BioMarkovChain) = length(bmc.inits)
@inline Base.size(bmc::BioMarkovChain) = size(bmc.tpm)
@inline Base.eltype(bmc::BioMarkovChain) = bmc.alphabet
@inline Base.eltype(bmc::BioMarkovChain) = bmc.alphabet

## Overload operators

# Base.:(==)(a::BioMarkovChain, b::BioMarkovChain) = a.tpm == b.tpm && a.inits == b.inits
Base.:(^)(a::BioMarkovChain, n::Int) = BioMarkovChain(a.alphabet, a.tpm^n, a.inits, n)

0 comments on commit 09f0371

Please sign in to comment.