From d03aab26f4a6e97603ace08c7b707b3e2932cbc3 Mon Sep 17 00:00:00 2001 From: Nathanael Bosch Date: Fri, 20 Oct 2023 18:14:16 +0200 Subject: [PATCH] JuliaFormatter.jl --- src/kronecker.jl | 24 ++++++++++++++---------- src/solution.jl | 2 +- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/kronecker.jl b/src/kronecker.jl index 2774122b9..2040a486b 100644 --- a/src/kronecker.jl +++ b/src/kronecker.jl @@ -32,21 +32,25 @@ function check_matmul_sizes(A::IKP, B::IKP) # For A * B Ad, Bd = A.ldim, B.ldim An, Am, Bn, Bm = size(A)..., size(B)... - if !(A.ldim == B.ldim) || !(Am == Bnb) - throw( - DimensionMismatch("Matrix multiplication not compatible: A has size ($Ad⋅$An,$Ad⋅$Am), B has size ($Bd⋅$Bn,$Bd⋅$Bm)"), - ) - end + if !(A.ldim == B.ldim) || !(Am == Bnb) + throw( + DimensionMismatch( + "Matrix multiplication not compatible: A has size ($Ad⋅$An,$Ad⋅$Am), B has size ($Bd⋅$Bn,$Bd⋅$Bm)", + ), + ) + end end function check_matmul_sizes(C::IKP, A::IKP, B::IKP) # For C = A * B Ad, Bd, Cd = A.ldim, B.ldim, C.ldim An, Am, Bn, Bm, Cn, Cm = size(A)..., size(B)..., size(C)... - if !(A.ldim == B.ldim == C.ldim) || !(Am == Bn && An == Cn && Bm == Cm) - throw( - DimensionMismatch("Matrix multiplication not compatible: A has size ($Ad⋅$An,$Ad⋅$Am), B has size ($Bd⋅$Bn,$Bd⋅$Bm), C has size ($Cd⋅$Cn,$Cd⋅$Cm)"), - ) - end + if !(A.ldim == B.ldim == C.ldim) || !(Am == Bn && An == Cn && Bm == Cm) + throw( + DimensionMismatch( + "Matrix multiplication not compatible: A has size ($Ad⋅$An,$Ad⋅$Am), B has size ($Bd⋅$Bn,$Bd⋅$Bm), C has size ($Cd⋅$Cn,$Cd⋅$Cm)", + ), + ) + end end Base.:+(A::IKP, B::IKP) = begin diff --git a/src/solution.jl b/src/solution.jl index 6fb1b7a3f..816593e25 100644 --- a/src/solution.jl +++ b/src/solution.jl @@ -91,7 +91,7 @@ function DiffEqBase.build_solution( uElType = eltype(prob.u0) d, q = cache.d, cache.q - D = d * (q+1) + D = d * (q + 1) FAC = cache.covariance_factorization pu_cov = PSDMatrix(factorized_zeros(FAC, uElType, D, d; d, q))