Skip to content

support general colon indexing for JuMPArray #684

Closed
@mlubin

Description

@mlubin

https://groups.google.com/forum/#!topic/julia-opt/6eVnmkhiDZg

This is a regression in 0.12:

julia> @defVar(m, x[0:3,0:3])

julia> x[1,:]
ERROR: MethodError: `isless` has no method matching isless(::Colon, ::Int64)
Closest candidates are:
  isless(::AbstractFloat, ::Real)
  isless(::ForwardDiff.ForwardDiffNumber{N,T<:Real,C}, ::Real)
  isless(::Real, ::Real)
  ...
 in getindex at /home/mlubin/.julia/v0.4/JuMP/src/JuMPArray.jl:61

Related issues: #643 #287

To fix the regression I think we should have a special case for colons and put off handling ranges for later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions