Skip to content

Preserve types in triangular constructors - #126

Open
jishnub wants to merge 6 commits into
masterfrom
jishnub/triconstructor
Open

Preserve types in triangular constructors#126
jishnub wants to merge 6 commits into
masterfrom
jishnub/triconstructor

Conversation

@jishnub

@jishnub jishnub commented Jan 3, 2024

Copy link
Copy Markdown
Member

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.

@codecov

codecov Bot commented Jan 3, 2024

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.05%. Comparing base (ee9e796) to head (5cd64ec).
⚠️ Report is 12 commits behind head on master.

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 Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jishnub
jishnub force-pushed the jishnub/triconstructor branch from 2de6b64 to dd6d811 Compare January 8, 2024 04:42
@github-actions

github-actions Bot commented Jan 8, 2024

Copy link
Copy Markdown
Contributor

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

@jishnub
jishnub force-pushed the jishnub/triconstructor branch from dd6d811 to 5f38148 Compare January 10, 2024 05:04
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.

1 participant