From fd4798331b5172e55a2d2fe450b4c7441be8cd25 Mon Sep 17 00:00:00 2001 From: James Rising Date: Tue, 20 Feb 2018 15:44:48 +0000 Subject: [PATCH] typo fixes --- src/linproghouse.jl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/linproghouse.jl b/src/linproghouse.jl index e031cc2..4a2b261 100644 --- a/src/linproghouse.jl +++ b/src/linproghouse.jl @@ -255,9 +255,12 @@ function roomchunks(model::Model, component::Symbol, variable::Symbol, parameter dimsvar = getdims(model, component, variable) dimspar = getdims(model, component, parameter) + dimvarnames = getdimnames(model, component, variable) + dimparnames = getdimnames(model, component, parameter) + varchunk2 = 0 while varchunk2 < length(dimsvar) - if !(dimsvar[end - varchunk2] in varchunk) + if !(dimvarnames[end - varchunk2] in varchunk) break end varchunk2 += 1 @@ -265,7 +268,7 @@ function roomchunks(model::Model, component::Symbol, variable::Symbol, parameter parchunk2 = 0 while parchunk2 < length(dimspar) - if !(dimspar[end - parchunk2] in parchunk) + if !(dimparnames[end - parchunk2] in parchunk) break end parchunk2 += 1 @@ -1083,10 +1086,10 @@ function matrixchunks(rowdims::Vector{Int64}, coldims::Vector{Int64}, gen::Funct for jj in 1:chunkcoldimlen colindex = toindex(jj, chunkcoldims) - topii = fromindex([ones(Int64, length(rowdims) - rowchunk); index], rowdims) - bottomii = fromindex([rowdims[1:length(rowdims) - rowchunk]; index], rowdims) - leftii = fromindex([ones(Int64, length(coldims) - colchunk); index], coldims) - rightii = fromindex([coldims[1:length(coldims) - colchunk]; index], coldims) + topii = fromindex([ones(Int64, length(rowdims) - rowchunk); rowindex], rowdims) + bottomii = fromindex([rowdims[1:length(rowdims) - rowchunk]; rowindex], rowdims) + leftii = fromindex([ones(Int64, length(coldims) - colchunk); colindex], coldims) + rightii = fromindex([coldims[1:length(coldims) - colchunk]; colindex], coldims) A[topii:bottomii, leftii:rightii] = gen(rowindex..., colindex...) end