-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSCRATCHPAD.jl
More file actions
50 lines (31 loc) · 1.07 KB
/
SCRATCHPAD.jl
File metadata and controls
50 lines (31 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using BenchmarkTools, Profile
testarray = rand(Float64, 1000000)
testpeakidxs, testpeakvals = findmaxima(testarray, 1)
@btime @fastmath getDif($testpeakidxs, $testarray)
#< Benchmarking automatic vs stiff solvers
@benchmark autosol = solve(fullprob, saveat=0.1, save_idxs=1, maxiters=10000, verbose=false)
@benchmark @fastmath solve(fullprob, saveat=0.1, save_idxs=1, maxiters=10000, verbose=false)
plot(autosol)
@benchmark stiffsol = solve(fullprob, Rosenbrock23(), saveat=0.1, save_idxs=1, maxiters=10000, verbose=false)
plot!(stiffsol)
difference = sum(autosol - stiffsol)
@btime CostFunction($autosol)
@btime @fastmath CostFunction($autosol)
#< PerAmp testing
per, amp = getPerAmp(autosol)
eval_ic_fitness(fullprob.u0, fullprob)
#< Comparing getDif_bidirectional to getDif
getDif(testpeakidxs, testarray)
getDif(testpeakvals)
getDif_bidirectional(testpeakvals)
#< Testing Supertypes
abstract type AbstractTestType <: ConstraintType end
struct TestType1 <: AbstractTestType
a::Int
b::Int
c::Int
end
testype1 = TestType1(1,2,3)
for n in testype1
println(n)
end