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

Preserve types in triangular constructors #126

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

jishnub
Copy link
Member

@jishnub jishnub commented Jan 3, 2024

Currently,

julia> U = UpperTriangularToeplitz([1,2,3,4])
4×4 UpperTriangularToeplitz{Int64, Vector{Int64}}:
 1  2  3  4
 0  1  2  3
 0  0  1  2
 0  0  0  1

julia> UpperTriangular(U)
4×4 UpperTriangularToeplitz{Int64, Vector{Int64}}:
 1  2  3  4
 0  1  2  3
 0  0  1  2
 0  0  0  1

This is not ideal, as the UpperTriangular constructor should create an object of that type. This PR changes this to

julia> UpperTriangular(U)
4×4 UpperTriangular{Int64, UpperTriangularToeplitz{Int64, Vector{Int64}}}:
 1  2  3  4
   1  2  3
     1  2
       1

This wrapper would allow one to use optimized LinearAlgebra functions that are defined for UpperTriangular/LowerTriangular, although there is a certain degree of redundancy present.

Similarly, change Symmetric(::AbstractToeplitz) to return a wrapper instead of a SymmetricToeplitz.

Since this was explicitly implemented this way and was being tested for, I have marked this change as breaking (minor version update). This also allows us to bump the Julia compatibility and drop support for v1.0. This should close #91.

Copy link

codecov bot commented Jan 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.05%. Comparing base (ee9e796) to head (5cd64ec).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #126      +/-   ##
==========================================
+ Coverage   93.87%   94.05%   +0.17%     
==========================================
  Files           9        9              
  Lines         963      958       -5     
==========================================
- Hits          904      901       -3     
+ Misses         59       57       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Jan 8, 2024

Pull Request Test Coverage Report for Build 7443282799

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 95.781%

Totals Coverage Status
Change from base Build 7443258038: 0.2%
Covered Lines: 908
Relevant Lines: 948

💛 - Coveralls

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.

None yet

1 participant