Skip to content

Commit

Permalink
special-case OneIndexedArray{Float64} print/show
Browse files Browse the repository at this point in the history
  • Loading branch information
joehuchette committed Jun 24, 2015
1 parent 59a5223 commit 7dd80cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/print.jl
Expand Up @@ -429,6 +429,13 @@ cont_str(::Type{IJuliaMode}, j::JuMPContainer{Variable}; mathmode=true) =
ijulia_for_all, ijulia_in, ijulia_open_set, ijulia_mid_set, ijulia_close_set,
ijulia_union, ijulia_infty, ijulia_open_rng, ijulia_close_rng, ijulia_integer), mathmode)


#------------------------------------------------------------------------
## OneIndexedArray{Float64}
#------------------------------------------------------------------------
Base.print(io::IO, j::OneIndexedArray{Float64}) = print(io, j.innerArray)
Base.show( io::IO, j::OneIndexedArray{Float64}) = print(io, j.innerArray)

#------------------------------------------------------------------------
## JuMPContainer{Float64}
#------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion test/print.jl
Expand Up @@ -65,7 +65,7 @@ facts("[print] JuMPContainer{Variable}") do
#------------------------------------------------------------------
# Test index set printing
context("index set printing") do
@defVar(m, rng_unit1[1:10]) # JuMPArray
@defVar(m, rng_unit1[1:10]) # OneIndexedArray
@defVar(m, rng_unit2[-2:3]) # JuMPArray
@defVar(m, rng_unit3[[1:10;]]) # JuMPDict
@defVar(m, rng_step1[1:2:10])
Expand Down

0 comments on commit 7dd80cb

Please sign in to comment.