Skip to content

Commit

Permalink
Fix positive numbers, bump dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
kellertuer committed Sep 23, 2023
1 parent 0ed2117 commit 5d4491c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Graphs = "1.4"
HybridArrays = "0.4"
Kronecker = "0.4, 0.5"
ManifoldDiff = "0.3.6"
ManifoldsBase = "0.14.11"
ManifoldsBase = "0.14.12"
MatrixEquations = "2.2"
OrdinaryDiffEq = "6.31"
Plots = "1"
Expand Down
19 changes: 19 additions & 0 deletions src/manifolds/PositiveNumbers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,25 @@ function parallel_transport_to!(::PositiveNumbers, Y, p, X, q)
return (Y .= X .* q ./ p)
end

function Random.rand(M::PositiveNumbers; kwargs...)
return rand(Random.default_rng(), M; kwargs...)
end

function Random.rand(
rng::AbstractRNG,
::PositiveNumbers;
σ=1.0,
vector_at=nothing,
)
if vector_at === nothing
return exp(randn(rng) * σ)
else
return vector_at * randn(rng) * σ
end
return pX
end


function Random.rand!(
rng::AbstractRNG,
::PositiveNumbers,
Expand Down

0 comments on commit 5d4491c

Please sign in to comment.