Open wsshin opened 3 years ago
I haven't added any documentation pages for COCG, as IterativeSolvers.jl
seems to use Documenter.jl
, which I haven't used before. Please let me know if there are some basic guidelines as to how to create documentation pages using Documenter.jl
.
Totals | |
---|---|
Change from base Build 444205317: | -0.3% |
Covered Lines: | 1873 |
Relevant Lines: | 1927 |
This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Totals | |
---|---|
Change from base Build 444205317: | 0.3% |
Covered Lines: | 1939 |
Relevant Lines: | 1982 |
Hi @wsshin, thanks for your contribution!
I think another way to do this is to dispatch to a different dot-function inside of CG based on a tag.
For instance:
struct InnerProduct end
struct UnconjugatedProduct end
_norm(::InnerProduct, xs) = norm(xs)
_dot(::InnerProduct, xs, ys) = dot(xs, ys)
_norm(::UnconjugatedProduct, xs) = sqrt(sum(x^2 for x in xs))
_dot(::UnconjugatedProduct, xs, ys) = sum(prod, zip(xs, ys))
and then add this tag InnerProduct
/ NoInnerProduct
to the CG iterable type. That saves some duplication.
Is there a name for this non-conjugate innerproduct-like operation sum(prod, zip(xs, ys))
?
@haampie, thanks for the suggestion. Please let me know if the new commit fulfills your request.
Not sure why codecov generated a failure. Tried to remove it by adding more unit tests, but it didn't work. Please advise.
@haampie, any thoughts on the new commit in this PR? Hope to finish this PR soon and move on to the implementation of COCR as mentioned in #288.
Hi @wsshin , i'll review in the weekend if that's ok with you.
@haampie, please let me know if you don't agree with my opinions; I can accommodate yours.
I think I have addressed all the concerns raised so far. If there is anything else, please let me know.
Can you also list this method in the docs? https://julialinearalgebra.github.io/IterativeSolvers.jl/dev/linear_systems/cg/ maybe as part of this page?
So this is the part I was curious about. I haven't created docs for Julia packages before. Is there a quick guide for creating docs?
You can do
$ cd path/to/IterativeSolvers/docs
$ julia
julia> using Revise
(@v1.5) pkg> activate .
Activating environment at `~/.julia/dev/IterativeSolvers/docs/Project.toml`
(docs) pkg> instantiate
julia> include("make.jl") # repeatedly
and edit docs/*
and open build/index.html
in your browser
@wsshin, see https://juliadocs.github.io/Documenter.jl/stable/ … you might add a note to https://github.com/JuliaLinearAlgebra/IterativeSolvers.jl/blob/master/docs/src/linear_systems/cg.md and https://github.com/JuliaLinearAlgebra/IterativeSolvers.jl/blob/master/docs/src/index.md
(The above commands are only only needed to build the doc pages locally; they will be built automatically when a PR is merged.)
@haampie, it took a while for me to add the documentation for COCG. Hopefully the latest commits are good to be merged. Note that CI tests are failing for Julia 1, but the failures are from gmres
, not from cg
or cocg
.
This PR adds the conjugate orthogonal conjugate gradient (COCG) method for complex symmetric matrices
A
(i.e.,transpose(A) == A
rather thanadjoint(A) == A
). The PR implementscocg
andcocg!
functions (corresponding tocg
andcg!
for Hermitian matrices), supporting functions and types, and basic unit tests.This PR is related with #288.