From 05fcff8cf6464bd1acdada675411d18ff95a495e Mon Sep 17 00:00:00 2001 From: Ronny Bergmann Date: Sat, 23 Sep 2023 08:48:13 +0200 Subject: [PATCH] Fix SPDs --- src/manifolds/PositiveNumbers.jl | 8 +------- src/manifolds/SymmetricPositiveDefinite.jl | 4 ++++ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/manifolds/PositiveNumbers.jl b/src/manifolds/PositiveNumbers.jl index 780d9f2c4f..4f50c7ed46 100644 --- a/src/manifolds/PositiveNumbers.jl +++ b/src/manifolds/PositiveNumbers.jl @@ -298,12 +298,7 @@ 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, -) +function Random.rand(rng::AbstractRNG, ::PositiveNumbers; σ=1.0, vector_at=nothing) if vector_at === nothing return exp(randn(rng) * σ) else @@ -312,7 +307,6 @@ function Random.rand( return pX end - function Random.rand!( rng::AbstractRNG, ::PositiveNumbers, diff --git a/src/manifolds/SymmetricPositiveDefinite.jl b/src/manifolds/SymmetricPositiveDefinite.jl index 44e974741d..dd0beb3ebd 100644 --- a/src/manifolds/SymmetricPositiveDefinite.jl +++ b/src/manifolds/SymmetricPositiveDefinite.jl @@ -403,6 +403,10 @@ Generate a random symmetric positive definite matrix on the """ rand(M::SymmetricPositiveDefinite; σ::Real=1) +function allocate_result(M::SymmetricPositiveDefinite, ::typeof(Random.rand), p::SPDPoint) + return zero_vector(M, p) +end + function Random.rand!( rng::AbstractRNG, M::SymmetricPositiveDefinite{N},