Skip to content

Commit 0155e48

Browse files
authored
row/colsupport for Cholesky factors with AbstractInfUnitRange (#193)
* row/colsupport for Cholesky factors with AbstractInfUnitRange * Create downstream.yml
1 parent 5ee4b40 commit 0155e48

File tree

4 files changed

+74
-2
lines changed

4 files changed

+74
-2
lines changed

.github/workflows/downstream.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: IntegrationTest
2+
on:
3+
push:
4+
branches: [master]
5+
tags: [v*]
6+
pull_request:
7+
paths-ignore:
8+
- 'LICENSE'
9+
- 'README.md'
10+
- '.github/workflows/TagBot.yml'
11+
12+
jobs:
13+
pre_job:
14+
# continue-on-error: true # Uncomment once integration is finished
15+
runs-on: ubuntu-latest
16+
# Map a step output to a job output
17+
outputs:
18+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
19+
steps:
20+
- id: skip_check
21+
uses: fkirc/skip-duplicate-actions@v5
22+
test:
23+
needs: pre_job
24+
if: needs.pre_job.outputs.should_skip != 'true'
25+
name: ${{ matrix.package.group }}/${{ matrix.package.repo }}/${{ matrix.julia-version }}
26+
runs-on: ${{ matrix.os }}
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
julia-version: ['1']
31+
os: [ubuntu-latest]
32+
package:
33+
- {repo: ClassicalOrthogonalPolynomials.jl, group: JuliaApproximation}
34+
- {repo: MultivariateOrthogonalPolynomials.jl, group: JuliaApproximation}
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: julia-actions/setup-julia@v2
38+
with:
39+
version: ${{ matrix.julia-version }}
40+
arch: x64
41+
- uses: julia-actions/julia-buildpkg@latest
42+
- name: Clone Downstream
43+
uses: actions/checkout@v4
44+
with:
45+
repository: ${{ matrix.package.group }}/${{ matrix.package.repo }}
46+
path: downstream
47+
- name: Load this and run the downstream tests
48+
shell: julia --color=yes --project=downstream {0}
49+
run: |
50+
using Pkg
51+
try
52+
# force it to use this PR's version of the package
53+
Pkg.develop(PackageSpec(path=".")) # resolver may fail with main deps
54+
Pkg.update()
55+
Pkg.test(; coverage = true) # resolver may fail with test time deps
56+
catch err
57+
err isa Pkg.Resolve.ResolverError || rethrow()
58+
# If we can't resolve that means this is incompatible by SemVer and this is fine
59+
# It means we marked this as a breaking change, so we don't need to worry about
60+
# Mistakenly introducing a breaking change, as we have intentionally made one
61+
@info "Not compatible with this release. No problem." exception=err
62+
exit(0) # Exit immediately, as a success
63+
end
64+
- uses: julia-actions/julia-processcoverage@v1
65+
- uses: codecov/codecov-action@v5
66+
with:
67+
token: ${{ secrets.CODECOV_TOKEN }}
68+
files: lcov.info

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "InfiniteLinearAlgebra"
22
uuid = "cde9dba0-b1de-11e9-2c62-0bab9446c55c"
3-
version = "0.9.0"
3+
version = "0.9.1"
44

55
[deps]
66
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"

src/infcholesky.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ ArrayLayouts._cholesky(::SymTridiagonalLayout, ::NTuple{2,OneToInf{Int}}, A, ::C
5454
ArrayLayouts._cholesky(::SymmetricLayout{<:AbstractBandedLayout}, ::NTuple{2,OneToInf{Int}}, A, ::CNoPivot) = adaptivecholesky(A)
5555

5656
colsupport(::AdaptiveCholeskyFactors, ::OneToInf) = OneToInf()
57-
rowsupport(::AdaptiveCholeskyFactors, ::OneToInf) = OneToInf()
57+
colsupport(F::AdaptiveCholeskyFactors, kr::AbstractInfUnitRange) = max(1,kr[1]-bandwidth(F,2)):
58+
rowsupport(::AdaptiveCholeskyFactors, kr::AbstractInfUnitRange) = kr
5859

5960
function colsupport(F::AdaptiveCholeskyFactors, j)
6061
partialcholesky!(F, maximum(j)+bandwidth(F,2))

test/test_infcholesky.jl

+3
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ import InfiniteLinearAlgebra: SymmetricBandedLayouts, AdaptiveCholeskyFactors
6464
F = cholesky(S)
6565
@test colsupport(F.factors,5) == rowsupport(F.factors,3) == 3:5
6666
@test rowsupport(F.factors) == colsupport(F.factors) == axes(F.factors,1)
67+
@test rowsupport(F.factors,2:∞) == 2:
68+
@test colsupport(F.factors,2:∞) == 1:
69+
@test colsupport(F.factors,5:∞) == 3:
6770

6871
@test (F.U * F.U')[1:10,1:10] F.U[1:10,1:12] * F.U[1:10,1:12]'
6972
@test (F.U' * F.U)[1:10,1:10] S[1:10,1:10]

0 commit comments

Comments
 (0)