Skip to content

Commit

Permalink
Reintroduce old hcat behaviour for constructor (non-documented still) (
Browse files Browse the repository at this point in the history
…#36)

* reintroduce old hcat behaviour for constructor (non-documented still)

* changelog and version
  • Loading branch information
kahaaga authored Oct 6, 2024
1 parent b79aacd commit bde8090
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Changelog for StateSpaceSets.jl is kept w.r.t. version 1.3

# 2.2

- Allow construction of `StateSpaceSet`s from existing `StateSpaceSet`s (this just calls `hcat` under the hood).

# 2.1

It is allowed to make `StateSpaceSet` with points of arbitrary `eltype` now.
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "StateSpaceSets"
uuid = "40b095a5-5852-4c12-98c7-d43bf788e795"
authors = ["George Datseris <[email protected]>"]
repo = "https://github.com/JuliaDynamics/StateSpaceSets.jl.git"
version = "2.1.2"
version = "2.2.0"

[deps]
Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
Expand Down
5 changes: 5 additions & 0 deletions src/statespaceset_concrete.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ function StateSpaceSet(v::Vector{V}; container = SVector) where {V<:AbstractVect
return StateSpaceSet{n,t,U}(u)
end

# Concatenating existing state space sets
function StateSpaceSet(xs::AbstractStateSpaceSet...)
return hcat(xs...)
end

###########################################################################
# StateSpaceSet(Vectors of stuff)
###########################################################################
Expand Down
5 changes: 4 additions & 1 deletion test/ssset_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ s = StateSpaceSet(o)
x = rand(10)
y = rand(10)
z = rand(10, 4)

w = rand(10, 2)
s1 = StateSpaceSet(x)
s2 = StateSpaceSet(x, y)
s3 = StateSpaceSet(z)
s4 = StateSpaceSet(w)

@test dimension(StateSpaceSet(s3, s4)) == 6

for (i, q) in enumerate((s1, s2, s, s3))
@test dimension(q) == i
Expand Down

0 comments on commit bde8090

Please sign in to comment.