Skip to content

Commit

Permalink
fix more cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jrising committed Apr 15, 2019
1 parent dce3ae2 commit 022b19a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions REQUIRE
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ DataFrames
Clp
Distributions
BlackBoxOptim
LinearAlgebra
6 changes: 3 additions & 3 deletions src/linproghouse.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using MathProgBase
using DataFrames
using Clp
using SparseArrays
using SparseArrays, LinearAlgebra

import Base.*, Base.-, Base.+, Base./, Base.max

Expand Down Expand Up @@ -1073,7 +1073,7 @@ function insertdim(iis::Vector{Int64}, dims::Vector{Int64}, insertat::Int64, dim
(dimvalue - 1) * prod(dims) + iis
else
proddimsleft = prod(dims[1:insertat-1])
(div.(iis - 1, proddimsleft) * dimsize + dimvalue - 1) * proddimsleft + (iis - 1) .% proddimsleft + 1
(div.(iis .- 1, proddimsleft) * dimsize .+ dimvalue .- 1) * proddimsleft .+ (iis .- 1) .% proddimsleft .+ 1
end
end

Expand Down Expand Up @@ -1207,7 +1207,7 @@ end

function matrixdiagonal(dims::Vector{Int64}, constant::Float64)
dimlen = prod(dims)
speye(dimlen, dimlen) * constant
sparse(1.0I, dimlen, dimlen) * constant
end

function matrixdiagonal(dims::Vector{Int64}, gen::Function, dupover::Vector{Bool})
Expand Down

0 comments on commit 022b19a

Please sign in to comment.