Skip to content

different pivoting for hmatrices#5

Merged
JoshuaTetzner merged 5 commits into
JoshuaTetzner:devfrom
alitaghdiri89:dev
Aug 19, 2025
Merged

different pivoting for hmatrices#5
JoshuaTetzner merged 5 commits into
JoshuaTetzner:devfrom
alitaghdiri89:dev

Conversation

@alitaghdiri89

Copy link
Copy Markdown
Contributor

No description provided.

@JoshuaTetzner JoshuaTetzner left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the issues.

Comment thread test/test_ACAHMatrices.jl
Comment thread ext/ACAHMatrices/hmatrices_interface.jl
@JoshuaTetzner JoshuaTetzner self-requested a review August 14, 2025 19:20

@JoshuaTetzner JoshuaTetzner left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code linting tells you that you do try to call (::AdaptiveCrossApproximation.RandomSampling)(::Vector{Int64}, ::Vector{Int64}) but you do not have it implemented.

Comment thread Project.toml Outdated
Comment thread src/aca.jl Outdated
Comment thread src/pivoting/combinedpivstrat.jl Outdated
Comment thread test/runtests.jl Outdated
Comment thread Project.toml
Comment thread Project.toml
Comment thread ext/ACAHMatrices/hmatrices_interface.jl Outdated
npivots, U, V = cur_aca(
K, rowBuffer, colBuffer, maxrank; rowidcs=irange, colidcs=jrange
)
aca = aca(K, Vector(irange), Vector(jrange))

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cant we directly use the irange and jrange?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The functions that existed in geometrical pivot strategies and are used here expect Vector{Int}, because of that and also since Vector can support index sets like 1, 4, 8, ... that are not consecutive and might be desired sometime in the fuiure I wrote everything based on Vectors

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should not make any difference, since we only need the length which is defined for both. Accessing a Vector with both types is possible as well. Perhaps there is an abstract type containing both, do not define it at all or use a Union{} of Vector and Range.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AbstractArray contains both, use AbstractArray or union?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AbstractArray

@alitaghdiri89 alitaghdiri89 Aug 19, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just saw they already have AbstractArray when they return next index(e. g. in maxvalue.jl line 16), I'm looking now will union cause a problem or not

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not want to convert irange and jrange into a vector. Remove this first if it is still working with the abstractarray type leave it this way, if not change it to a Union of abstract array and Unit range

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used AbstractArray{Int}

@alitaghdiri89

Copy link
Copy Markdown
Contributor Author

The code linting tells you that you do try to call (::AdaptiveCrossApproximation.RandomSampling)(::Vector{Int64}, ::Vector{Int64}) but you do not have it implemented.

I resolved this issue and the I failed the ambiguity test between the two functions at lines 33 and 40 of aca.jl. Their 'where' clauses were respectively:
where {RP<:RandomSamplingPivoting,CP<:PivStrat,CC<:RandomSampling}
where {RP<:PivStrat,CP<:RandomSamplingPivoting,CC<:RandomSampling}

because of this I rewrote this part and wrote a single function to handle different pivoting cases for random sampling convergence. And for the sake of uniformity did the same for combined convergence too. hope that is fine.

@JoshuaTetzner JoshuaTetzner self-requested a review August 19, 2025 18:30
Comment thread src/aca.jl
@JoshuaTetzner

Copy link
Copy Markdown
Owner

I think you look into the Rang vector stuff again. I left a comment there.

@alitaghdiri89

Copy link
Copy Markdown
Contributor Author

locally on my laptop it passes the tests, including formatting. I have no idea

@JoshuaTetzner JoshuaTetzner merged commit bfc38f1 into JoshuaTetzner:dev Aug 19, 2025
1 of 2 checks passed
JoshuaTetzner added a commit that referenced this pull request Aug 22, 2025
* CI.yml aktualisieren

* different pivoting for hmatrices (#5)

* Small fix

* Documentation Fix

* Update README.md

---------

Co-authored-by: Ali <88579506+alitaghdiri89@users.noreply.github.com>
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.

2 participants