@@ -6,22 +6,22 @@ using Reexport
6
6
@reexport using DiffEqBase
7
7
using MATLAB
8
8
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
18
18
19
19
function DiffEqBase. __solve {uType,tupType,isinplace,AlgType<:MATLABAlgorithm} (
20
20
prob:: DiffEqBase.AbstractODEProblem{uType,tupType,isinplace} ,
21
21
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 ,
23
23
kwargs... )
24
-
24
+
25
25
tType = eltype (tupType)
26
26
27
27
if ! (typeof (prob. f) <: DiffEqBase.AbstractParameterizedFunction )
@@ -72,9 +72,9 @@ function DiffEqBase.__solve{uType,tupType,isinplace,AlgType<:MATLABAlgorithm}(
72
72
73
73
# Reshape the result if needed
74
74
if uType <: AbstractArray
75
- timeseries = Vector {uType} (0 )
75
+ timeseries = Vector {uType} (undef, length (ts) )
76
76
for i= 1 : length (ts)
77
- push! ( timeseries, timeseries_tmp[i,:])
77
+ timeseries[i] = timeseries_tmp[i,:]
78
78
end
79
79
else
80
80
timeseries = timeseries_tmp
0 commit comments