Skip to content

Instantly share code, notes, and snippets.

View IainNZ's full-sized avatar

Iain Dunning IainNZ

View GitHub Profile
@IainNZ
IainNZ / goddard.jl
Created February 13, 2015 18:40
Goddard rocket
#############################################################################
# JuMP
# An algebraic modelling langauge for Julia
# See http://github.com/JuliaOpt/JuMP.jl
#############################################################################
# goddard.jl
#
# Goddard Rocket control problem from:
# Benchmarking Optimization Software with COPS 3.0
# http://www.mcs.anl.gov/~more/cops/cops3.pdf
@IainNZ
IainNZ / sma.jl
Last active August 29, 2015 14:10
function sma_original(avect, numPer)
numEle = length(avect)
tout = Array(Float32, numEle)
for ndx = 1:numEle
tsum = 0.0
begndx = max(1, ndx - numPer)
for slicendx = begndx:ndx
tsum += avect[slicendx]
end
tout[ndx] = tsum / float32(numPer)
@IainNZ
IainNZ / gist:aa75b3298d0ad6a70d86
Created October 20, 2014 03:45
N20, R50, MIPGap=0.01, Threads=1
PYTHON
2651
-75.3212163
49.8698305592
min 7.85425305367
mean 7.98054280281
75656742.8543
cb_work_time/ITERS 1.93139100075e-06
Julia
getObjectiveValue(m) => 118.11250034248698
norm((getValue(x))[:]) => 100.0
callbacks => 1041
minimum(times) => 2.275295964
median(times) => 2.3760397215
mean(times) => 2.3844805166
dummy => 3.0e8
function genspmat2(N)
iseven(N) && error("even N not allowed")
# Determine memory usage
k = N^2
for i in 1:N^2
if i > N
k += 2
elseif i > 1
function iain_magic(n::Int)
if n % 2 == 1
# Odd-order magic square
# http://en.wikipedia.org/wiki/Magic_square#Method_for_constructing_a_magic_square_of_odd_order
M = zeros(Int, n, n)
for I = 1:n, J = 1:n # row, column
@inbounds M[I,J] = n*((I+J-1+div(n,2))%n) + ((I+2J-2)%n) + 1
end
return M
elseif n % 4 == 0

This is an automatic message from MechaJulia, a Julia bot that aims to help maintain Julia and its package ecosystem. If you think there is something wrong with this message, or have ideas for a new feature, please file an issue


  • It looks like you are adding a version 0.0.0, but this is discouraged. Consider tagging a "real" first version like 0.0.1 or, if you feel the package is not ready, encourage testers to obtain it with Pkg.clone
Instance parameters
(2.4019123140049112,2.6791717677439486,-8.08507581784363,1.0935793293105867)
[8.02,6.5,20.04]
[80.94,79.15,94.93]
2 180.22
3 201.52
(Array{Any,1},Array{Any,1},Array{Any,1}) ({nothing,[Sample([0.0])],[Sample([0.0,0.0])]},{[1,0]},{1})
Initial solve
Num stubs before feas check: 1
[idunning@che cont5]$ ./runpulp.sh | tee pulplog.log
N 250 buildTime 4.993 writeTime 1.270 totalTime 6.263 M
N 250 buildTime 5.149 writeTime 1.261 totalTime 6.409 M
N 250 buildTime 4.940 writeTime 1.244 totalTime 6.184 M
N 500 buildTime 18.229 writeTime 4.835 totalTime 23.064 M
N 500 buildTime 17.626 writeTime 4.808 totalTime 22.433 M
N 500 buildTime 18.356 writeTime 4.805 totalTime 23.161 M
N 750 buildTime 39.024 writeTime 12.051 totalTime 51.076 M
cont5
elapsed time: 0.049582814 seconds
elapsed time: 0.328209747 seconds
N 250 buildTime 0.050 writeTime 0.328 totalTime 0.378 MPS
elapsed time: 0.057842824 seconds
elapsed time: 0.323715819 seconds
N 250 buildTime 0.058 writeTime 0.324 totalTime 0.382 MPS
elapsed time: 0.051271069 seconds
elapsed time: 0.330348401 seconds