Skip to content

Instantly share code, notes, and snippets.

View IainNZ's full-sized avatar

Iain Dunning IainNZ

View GitHub Profile
{
"cells": [
{
"cell_type": "code",
"execution_count": 113,
"metadata": {
"collapsed": false
},
"outputs": [
{
for col in 1:n
for idx in colptr[i]:colptr[i]-1
row = rowval[idx]
nzv = nzvals[idx]
if row==col && nzv
return true
elseif row>col
break
end
end
JuMP 0.11
Julia 0.4.1
5.173100 seconds (8.65 M allocations: 387.304 MB, 1.78% gc time)
1.112170 seconds (2.30 M allocations: 103.153 MB, 3.06% gc time)
1.112430 seconds (2.30 M allocations: 103.343 MB, 2.77% gc time)
Julia 0.5-dev+2072 (17287f0)
5.294610 seconds (8.65 M allocations: 387.346 MB, 1.70% gc time)
1.164331 seconds (2.30 M allocations: 103.153 MB, 3.15% gc time)
1.104843 seconds (2.30 M allocations: 103.343 MB, 2.81% gc time)
Julia 0.5-llvm37 branch
using JuMP, Ipopt
function run_test()
# Create JuMP model, using Ipopt as the solver
mod = Model(solver=IpoptSolver(print_level=0))
# Constants
# Note that all parameters in the model have been normalized
# to be dimensionless. See the COPS3 paper for more info.
h_0 = 1 # Initial height
using JuMP, Ipopt
function run_test()
# Create JuMP model, using Ipopt as the solver
mod = Model(solver=IpoptSolver(print_level=0))
# Constants
# Note that all parameters in the model have been normalized
# to be dimensionless. See the COPS3 paper for more info.
h_0 = 1 # Initial height
(v0.7) pkg> test RandomCorrelationMatrices
Testing RandomCorrelationMatrices
Resolving package versions...
Random correlation matrix
ERROR: LoadError: MethodError: no method matching cholesky(::Array{Float64,2}, ::Type{Val{:L}})
Closest candidates are:
cholesky(::Union{Union{DenseArray{T,2}, Base.ReinterpretArray{T,2,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Tuple{AbstractUnitRange,Vararg{Any,N} where N} where A<:DenseArray where N where T, DenseArray}, Base.ReshapedArray{T,2,A,MI} where MI<:Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},N} where N} where A<:Union{Base.ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Tuple{AbstractUnitRange,Vararg{Any,N} where N} where A<:DenseArray where N where T, DenseArray} where N where T, SubArray{T,N,A,I,true} where I<:Tuple{AbstractUnitRange,Vararg{Any,N} where N} where A<:DenseArray where N where T, DenseArray}, SubArray{T,2,A,I,L} where L where I<:Tuple{Vararg{Union{Int64, AbstractR