Skip to content

Commit

Permalink
Merge pull request #888 from JuliaControl/StaticArraysCore
Browse files Browse the repository at this point in the history
depend on StaticArraysCore instead of StaticArrays
  • Loading branch information
baggepinnen committed Oct 12, 2023
2 parents 71091fc + 17bc8e1 commit f8a5207
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions lib/ControlSystemsBase/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[weakdeps]
Expand All @@ -44,7 +44,7 @@ Polyester = "0.6, 0.7"
Polynomials = "1.1.10, 2.0, 3.0"
PrecompileTools = "1"
RecipesBase = "1"
StaticArrays = "1"
StaticArraysCore = "1"
julia = "1.6"

[extras]
Expand All @@ -55,7 +55,8 @@ FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
GR = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
ImplicitDifferentiation = "57b37032-215b-411a-8a7c-41a003a55207"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "Aqua", "ComponentArrays", "Documenter", "FiniteDifferences", "ImplicitDifferentiation", "GR", "Plots"]
test = ["Test", "Aqua", "ComponentArrays", "Documenter", "FiniteDifferences", "ImplicitDifferentiation", "GR", "Plots", "StaticArrays"]
2 changes: 1 addition & 1 deletion lib/ControlSystemsBase/src/ControlSystemsBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ import MatrixPencils
using MacroTools
using MatrixEquations
using UUIDs # to load Plots in gangoffourplot
using StaticArrays, Polyester
using StaticArraysCore, Polyester

abstract type AbstractSystem end

Expand Down
2 changes: 1 addition & 1 deletion lib/ControlSystemsBase/src/connections.jl
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ function feedback(sys1::AbstractStateSpace, sys2::AbstractStateSpace;
end

mutable(x::AbstractArray, ::Type{T}) where T = convert(Matrix{T}, x)
mutable(x::StaticArray, ::Type{T}) where T = Matrix{T}(x)
mutable(x::StaticArraysCore.StaticArray, ::Type{T}) where T = Matrix{T}(x)


"""
Expand Down
3 changes: 2 additions & 1 deletion lib/ControlSystemsBase/src/types/staticsystems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ function *(sys1::StaticStateSpace, sys2::StaticStateSpace)
timeevol = common_timeevol(sys1,sys2)
T = promote_type(numeric_type(sys1), numeric_type(sys2))

O = @SMatrix zeros(size(sys2.A, 1), size(sys1.A, 2))
n2 = size(sys2.A, 1)*size(sys1.A, 2)
O = zero(SMatrix{size(sys2.A, 1), size(sys1.A, 2), T, n2})
A = [[sys1.A sys1.B*sys2.C];
[O sys2.A]]
B = [sys1.B*sys2.D ; sys2.B]
Expand Down
2 changes: 1 addition & 1 deletion lib/ControlSystemsBase/src/utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ to_abstract_matrix(A::Number) = fill(A, 1, 1)

# Do no sorting of eigenvalues
eigvalsnosort(args...; kwargs...) = eigvals(args...; sortby=nothing, kwargs...)
eigvalsnosort(A::StaticMatrix; kwargs...) = eigvalsnosort(Matrix(A); kwargs...)
eigvalsnosort(A::StaticArraysCore.StaticMatrix; kwargs...) = eigvalsnosort(Matrix(A); kwargs...)
roots(args...; kwargs...) = Polynomials.roots(args...; sortby=nothing, kwargs...)

issemiposdef(A) = ishermitian(A) && minimum(real.(eigvals(A))) >= 0
Expand Down

0 comments on commit f8a5207

Please sign in to comment.