Skip to content

Commit 32b4ab7

Browse files
fix for v0.7
1 parent fca11b2 commit 32b4ab7

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

src/MATLABDiffEq.jl

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ using Reexport
66
@reexport using DiffEqBase
77
using MATLAB
88

9-
abstract MATLABAlgorithm <: DiffEqBase.AbstractODEAlgorithm
10-
immutable ode23 <: MATLABAlgorithm end
11-
immutable ode45 <: MATLABAlgorithm end
12-
immutable ode113 <: MATLABAlgorithm end
13-
immutable ode23s <: MATLABAlgorithm end
14-
immutable ode23t <: MATLABAlgorithm end
15-
immutable ode23tb <: MATLABAlgorithm end
16-
immutable ode15s <: MATLABAlgorithm end
17-
immutable ode15i <: MATLABAlgorithm end
9+
abstract type MATLABAlgorithm <: DiffEqBase.AbstractODEAlgorithm end
10+
struct ode23 <: MATLABAlgorithm end
11+
struct ode45 <: MATLABAlgorithm end
12+
struct ode113 <: MATLABAlgorithm end
13+
struct ode23s <: MATLABAlgorithm end
14+
struct ode23t <: MATLABAlgorithm end
15+
struct ode23tb <: MATLABAlgorithm end
16+
struct ode15s <: MATLABAlgorithm end
17+
struct ode15i <: MATLABAlgorithm end
1818

1919
function DiffEqBase.__solve{uType,tupType,isinplace,AlgType<:MATLABAlgorithm}(
2020
prob::DiffEqBase.AbstractODEProblem{uType,tupType,isinplace},
2121
alg::AlgType,timeseries=[],ts=[],ks=[];
22-
saveat=eltype(tType)[],timeseries_errors=true,reltol = 1e-3, abstol = 1e-6,
22+
saveat=eltype(tupType)[],timeseries_errors=true,reltol = 1e-3, abstol = 1e-6,
2323
kwargs...)
24-
24+
2525
tType = eltype(tupType)
2626

2727
if !(typeof(prob.f) <: DiffEqBase.AbstractParameterizedFunction)
@@ -72,9 +72,9 @@ function DiffEqBase.__solve{uType,tupType,isinplace,AlgType<:MATLABAlgorithm}(
7272

7373
# Reshape the result if needed
7474
if uType <: AbstractArray
75-
timeseries = Vector{uType}(0)
75+
timeseries = Vector{uType}(undef,length(ts))
7676
for i=1:length(ts)
77-
push!(timeseries,timeseries_tmp[i,:])
77+
timeseries[i] = timeseries_tmp[i,:]
7878
end
7979
else
8080
timeseries = timeseries_tmp

test/runtests.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using DiffEqBase, MATLABDiffEq, ParameterizedFunctions
2-
using Base.Test
3-
1+
using DiffEqBase, MATLABDiffEq, ParameterizedFunctions, Test
42

53
f = @ode_def_bare LotkaVolterra begin
64
dx = a*x - b*x*y

0 commit comments

Comments
 (0)