Skip to content

Commit

Permalink
bugfixes #44, #45
Browse files Browse the repository at this point in the history
  • Loading branch information
Datseris committed Oct 23, 2017
1 parent 5aef915 commit a4c5a3f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/src/periodicity.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ For example, let's find the fixed points of the [Standard Map](system_definition
and 8. We will use all permutations for the `signs` but only one for the `inds`.
We will also only use one `λ` value, and a 21×21 density of initial conditions:
```julia
using DynamicalSystems, PyPlot
using DynamicalSystems, PyPlot, StaticArrays

ds = Systems.standardmap()
xs = linspace(0, 2π, 21); ys = copy(xs)
Expand Down
7 changes: 4 additions & 3 deletions src/delay_coords.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ end
end
# Conversions:
@inbounds function Dataset(R::Reconstruction{V, T, D, τ}) where {V, T, D, τ}
data = SVector{D, T}[]
for i in 1:length(R)
push!(data, R[i])
L = length(R)
data = Vector{SVector{D, T}}(L)
for i in 1:L
data[i] = R[i]
end
return Dataset(data)
end
Expand Down
4 changes: 2 additions & 2 deletions src/systems/continuous.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ end
# Pretty-Printing #
#######################################################################################
import Base.show
function Base.show(io::IO, s::ContinuousDS{S, F, J}) where {S, F, J}
function Base.show(io::IO, ds::ContinuousDS{S, F, J}) where {S, F, J}
D = dimension(ds)
print(io, "$D-dimensional continuous dynamical system:\n",
"state: $(s.state)\n", "e.o.m.: $F\n", "jacobian: $J")
Expand All @@ -144,7 +144,7 @@ end
@require Juno begin
function Juno.render(i::Juno.Inline, s::ContinuousDS{S, F, J}) where
{S, F, J}
D = dimension(ds)
D = dimension(s)
t = Juno.render(i, Juno.defaultrepr(s))
t[:head] = Juno.render(i, Text("$D-dimensional continuous dynamical system"))
t
Expand Down
9 changes: 5 additions & 4 deletions src/systems/dataset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ end
function Dataset(v::Vector{Vector{T}}) where {T<:Number}
D = length(v[1])
L = length(v)
data = Vector{SVector{3,Float64}}(L)
data = Vector{SVector{D, T}}(L)
for i in 1:length(v)
D != length(v[i]) && throw(ArgumentError(
"All data-points in a Dataset must have same size"
Expand Down Expand Up @@ -109,9 +109,10 @@ end

function Base.convert(::Type{Dataset}, mat::AbstractMatrix)
D = size(mat, 2); T = eltype(mat)
d = SVector{D, T}[]
for i in 1:size(mat, 1)
push!(d, SVector{D, T}(view(mat, i, :)))
L = size(mat, 1)
d = Vector{SVector{D, T}}(L)
for i in 1:L
d[i] = SVector{D, T}(view(mat, i, :))
end
return Dataset(d)
end
Expand Down

0 comments on commit a4c5a3f

Please sign in to comment.