Skip to content

Commit

Permalink
change :auto to stationary, bump version to 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
axsk committed Nov 1, 2023
1 parent f6c214f commit 3d1dfda
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PCCAPlus"
uuid = "f48fc343-7e38-490c-be15-e66d68689cd5"
authors = ["Alexander Sikorski"]
version = "0.2.0"
version = "1.0.0"

[deps]
Arpack = "7d9fca2a-8960-54d3-9f78-7d1dccf2cb97"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ P = P ./ sum(P, dims=2) # sparse row stochastic matrix

# solve the PCCA+ problem weighted with the stationary density
# and optimize for crispness, using the KrylovKit.jl eigensolver
chi = pcca(P, 2; pi=:auto, optimize=true, solver=KrylovSolver())
chi = pcca(P, 2; pi=:stationary, optimize=true, solver=KrylovSolver())
```

For sparse matrix support, add either the `ArnoldiMethod.jl` or `KrylovKit.jl` and pass the corresponding `ArnoldiSolver()` or `KrylovSolver()` as a solver.
Expand Down
4 changes: 1 addition & 3 deletions ext/KrylovExt.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
module KrylovExt

import PCCAPlus
import KrylovKit




function PCCAPlus.schurvecs(T, n, israte, ::PCCAPlus.KrylovSolver)
which = israte ? :LR : :LM
R, Qs, = KrylovKit.schursolve(T, rand(size(T, 1)), n, which, KrylovKit.Arnoldi())
Expand Down
6 changes: 3 additions & 3 deletions src/pccap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ using LinearAlgebra
performs the pcca clustering on the transition matrix `T` with `n` clusters.
Here `T` can be either a stochastic propagator with row sum 1 or a rate matrix with row sum 0.
- `pi` is a density for weighting the result. `pi=:auto` uses the stationary density
- `pi` is a density for weighting the result. `pi=:stationary` uses the stationary density
- `optimize` uses the optimization from Roeblitz (2013) to improve crispness
- `solver` is the solver to use for computing the schur decomposition.
The BaseSolver() is built in. ArnoldiSolver() and KrylovSolver() require ArnoldiMethod.jl and KrylovKit.jl respectively and provide support for sparse matrices.
Returns the membership matrix `chi`.
Returns the membership matrix `chi` assigning to each state a membership to one of the `n` clusters.
"""

function pcca(T::AbstractMatrix, n::Integer; pi=nothing, optimize=false, solver=BaseSolver())
israte = isratematrix(T)
if pi == :auto
if pi == :stationary
pi = stationarydensity(T, israte)
end
X = schurvectors(T, pi, n, israte, solver)
Expand Down

2 comments on commit 3d1dfda

@axsk
Copy link
Owner Author

@axsk axsk commented on 3d1dfda Nov 1, 2023

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/94568

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.0.0 -m "<description of version>" 3d1dfda474881a5d2af93c7efea3f8acc398dd99
git push origin v1.0.0

Please sign in to comment.