From dd4c966d39fd387961668ff59dc3a5d3002e34c8 Mon Sep 17 00:00:00 2001 From: Vasily Ilin Date: Tue, 3 Oct 2023 13:59:58 -0700 Subject: [PATCH] Create a compact `show` for `MvNormal`. --- src/multivariate/mvnormal.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/multivariate/mvnormal.jl b/src/multivariate/mvnormal.jl index 6126c1d8f1..69ec78d796 100644 --- a/src/multivariate/mvnormal.jl +++ b/src/multivariate/mvnormal.jl @@ -245,8 +245,10 @@ distrname(d::ZeroMeanIsoNormal) = "ZeroMeanIsoNormal" distrname(d::ZeroMeanDiagNormal) = "ZeroMeanDiagNormal" distrname(d::ZeroMeanFullNormal) = "ZeroMeanFullNormal" -Base.show(io::IO, d::MvNormal) = +Base.show(io::IO, ::MIME"text/plain", d::MvNormal) = show_multline(io, d, [(:dim, length(d)), (:μ, mean(d)), (:Σ, cov(d))]) +Base.show(io::IO, d::MvNormal) = + print(io, "MvNormal($(d.μ), $(d.Σ))") ### Basic statistics