Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add arithmetic for UnivariateFinite objects. #12

Merged
merged 12 commits into from
Dec 13, 2021
Merged

Add arithmetic for UnivariateFinite objects. #12

merged 12 commits into from
Dec 13, 2021

Conversation

ablaom
Copy link
Member

@ablaom ablaom commented Nov 25, 2021

edited

This PR implements +(::U, ::U), -(::U, ::U), -(::U), *(::U, ::Number), *(::Number, U), \(::U, ::Number) where U is a UnivariateFinite or UnivariateFiniteArray, with performant versions for the latter. These symbols are being given the usual meanings when we view a UnivariateFinite object as a finite measure. It seems the restriction to Number type is necessary to avoid ambiguity with Base.*(::Number, ::AbstractArray).

It also adds some doc-string fixes and a fix to allow show method to work when "probabilities" are complex, etc.

Resolves #10.

@codecov-commenter
Copy link

codecov-commenter commented Nov 25, 2021

Codecov Report

Merging #12 (a73e225) into dev (076cbd2) will decrease coverage by 1.55%.
The diff coverage is 82.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev      #12      +/-   ##
==========================================
- Coverage   93.02%   91.47%   -1.56%     
==========================================
  Files           4        5       +1     
  Lines         373      387      +14     
==========================================
+ Hits          347      354       +7     
- Misses         26       33       +7     
Impacted Files Coverage Δ
src/arrays.jl 98.88% <ø> (ø)
src/methods.jl 80.74% <0.00%> (-6.36%) ⬇️
src/types.jl 96.22% <ø> (ø)
src/arithmetic.jl 97.05% <97.05%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 076cbd2...a73e225. Read the comment docs.

@ablaom ablaom merged commit f7093e6 into dev Dec 13, 2021
This was referenced Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Define +(::UnivariateFinite, ::UnivariateFinite) and ditto for abstract arrays
2 participants