Skip to content

Commit

Permalink
update NEWS + docs
Browse files Browse the repository at this point in the history
  • Loading branch information
joehuchette committed Aug 25, 2015
1 parent 078e125 commit 2b159b1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ Unversioned
-----------

* Support (on Julia 0.4 and later) for conditions in indexing ``@defVar`` and ``@addConstraint`` constructs, e.g. ``@defVar(m, x[i=1:5,j=1:5; i+j >= 3])``
* Support for vectorized operations on Variables, expressions, and JuMPArrays with indexing over unit-step ranges starting at one. See
the documentation for details.
* Support for vectorized operations on Variables and expressions. See the documentation for details.
* New ``getVar()`` method to access variables in a model by name
* Support for semidefinite programming.
* Dual solutions are now available for general nonlinear problems. You may call ``getDual`` on a reference object for a nonlinear constraint, and ``getDual`` on a variable object for Lagrange multipliers from active bounds.
* Introduce warnings for two common performance traps: too many calls to ``getValue()`` on a collection of variables and use of the ``+`` operator in a loop to sum expressions.
* Second-order cone constraints can be written directly with the ``norm()`` and ``norm2{}`` syntax.
* Implement MathProgBase interface for querying Hessian-vector products.
* Iteration over ``JuMPContainer``s is deprecated; instead, use the ``keys`` and ``values`` functions, and ``zip(keys(d),values(d))`` for the old behavior.
* ``@defVar`` returns ``Array{Variable,N}`` when each of ``N`` index sets are of the form ``1:nᵢ``.

Version 0.9.3 (August 11, 2015)
-------------------------------
Expand Down
16 changes: 8 additions & 8 deletions doc/refexpr.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,16 @@ Vectorized operations
^^^^^^^^^^^^^^^^^^^^^

JuMP supports vectorized expressions and constraints for linear and quadratic models. Although this syntax may
be familiar for users coming from MATLAB-based modeling languages, we caution that this syntax can be slow---especially
for large operations. Nevertheless, the syntax often proves useful, for example in constraints involving small,
dense matrix-vector products.
be familiar for users coming from MATLAB-based modeling languages, we caution that this syntax may be slower than
the scalar versions using loops---especially for large operations. Nevertheless, the syntax often proves useful,
for example in constraints involving small, dense matrix-vector products.

Linear algebraic operators are available to give meaning to expressions like ``A*x`` where ``A`` is a matrix
of numbers and ``x`` is a vector of ``Variable``s. You may also use ``JuMPArray``s in these types of expressions,
but only if the index sets that define them are matrix-like: that is, the index sets are ranges of the type
of numbers and ``x`` is a vector of ``Variable``s. You may also use ``Array{Variable}``s in these types of
expressions; for example, any object you construct with ``@defVar`` where each of the index sets are of the form
``1:n``. For example::

@defVar(m, x[1:3])
@defVar(m, x[1:3,1:4])
expr = rand(3,3)*x

is allowed, while::
Expand All @@ -169,8 +169,8 @@ and ``.<=``. For instance, you can write constraints of the form::

Note that scalar literals (such as 1 or 0) are allowed in expressions.

Concatenation is also overloaded for these matrix-like ``JuMPArray``s. For instance, the following will create
a matrix of ``QuadExpr`` that you can use elsewhere in your model::
Concatenation is also possible for these ``Array``s of ``Variable``s or expressions. For instance, the following
will create a matrix of ``QuadExpr`` that you can use elsewhere in your model::

@defVar(m, x[1:3])
A = [1 x'
Expand Down
3 changes: 1 addition & 2 deletions src/JuMP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,6 @@ function getValue(arr::Array{Variable})
registered = haskey(m.varData, arr)
name = registered ? m.varData[arr].name : m.colName[v.col]
for I in eachindex(arr)
# TODO: Only warn once
v = arr[I]
value = _getValue(v)
ret[I] = value
Expand Down Expand Up @@ -614,7 +613,7 @@ end
# scalars, and Xᵢ are n×n symmetric variable matrices. The inequality
# is taken w.r.t. the psd partial order.
type SDPConstraint <: JuMPConstraint
terms # purposely leave this untyped so that we can special-case OneIndexedArray with no additional variables
terms
end

# Special-case X ≥ 0, which is often convenient
Expand Down
3 changes: 2 additions & 1 deletion test/model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ facts("[model] Test model copying") do
addSOS2(source, [x, 2y])
@addSDPConstraint(source, x*ones(3,3) >= eye(3,3))
@addSDPConstraint(source, ones(3,3) <= 0)
@defVar(source, z[1:3]) # OneIndexedArray
@defVar(source, z[1:3])
@defVar(source, w[2:4]) # JuMPArray
@defVar(source, v[[:red],1:3]) # JuMPDict
setSolveHook(source, m -> 1)
Expand Down Expand Up @@ -716,5 +716,6 @@ end
facts("[model] Test getValue on OneIndexedArrays") do
m = Model()
@defVar(m, x[i=1:5], start=i)
@fact typeof(x) --> Vector{Variable}
@fact typeof(getValue(x)) --> Vector{Float64}
end
2 changes: 1 addition & 1 deletion test/print.jl
Original file line number Diff line number Diff line change
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]) # OneIndexedArray
@defVar(m, rng_unit1[1:10]) # Array{Variable}
@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 2b159b1

Please sign in to comment.