(newby) Concept of "sets" and julia tutorial ?

51 views
Skip to first unread message

Antonello L.

unread,
Nov 24, 2016, 4:37:31 AM11/24/16
to julia-opt
Hello everyone,
 I am very new to both Julia and JuMP.
I am trying to have a look on it and the first question it come in my mind reading the doc is "where is the concept of sets ?", that is the dimensions over which variable and constrains are defined.
I have read in the doc that:

To create arrays of variables we append brackets to the variable name.

@variable(m, x[1:M,1:N] >= 0 )
will create an M by N array of variables. Both ranges and arbitrary iterable sets are supported as index sets.

Does it mean that variables can have a maximum of two dimensions?

Could you also suggest me a good theoretical/practical tutorial for Julia? I have started reading its manual at  http://docs.julialang.org/en/release-0.5/ but it's a 355 pages document, and a bit too technical on same aspects. Conversely, all the other cited documents in the "Resources" section of the same document points to cheatsheet, hands on and how-to that don't return me a feeling of getting the knowledge of the language.
In this, I miss a lot the 66 pages (92 with overview of the standard library) Python tutorial of Guido van Rossum: concise but at the same time it teaches you the basis of the language explaining the various topics by examples.

Thank you
  Antonello Lobianco

Patrick Kofod Mogensen

unread,
Nov 24, 2016, 5:27:09 AM11/24/16
to julia-opt
May I ask if you tried adding a third dimension?

using JuMP

m
= Model()
# Choose dimensions (added a third called O)
M
, N, O = 3,4,5
# This is the example you mentioned

@variable(m, x[1:M,1:N] >= 0 )
# But have you tried answering your own question by simply trying?
@variable(m, y[1:M,1:N,1:O] >= 0 )


Antonello L.

unread,
Nov 24, 2016, 6:33:35 AM11/24/16
to julia-opt
Thank you for your reply that I interpret as variables can have an "infinite" number of dimensions.
Honestly I didn't already installed JuMP... I was only asking about some features that were not clear  from the documentation.

Cheers,
   Antonello
Reply all
Reply to author
Forward
0 new messages