blegat / EntropicCone.jl

Entropic Cone approximation and optimization
Other
8 stars 3 forks source link

Confusing notations for indexes #2

Open cynddl opened 6 years ago

cynddl commented 6 years ago

I am not sure how to correctly index entropic cones.

For example, we have:

>>> nonnegative(10, EntropicCone.set(10)).h
1023-element SparseVector{Int64,Int64} with 1 stored entry:
  [1   ]  =  1

>>> nonnegative(10, EntropicCone.set([10])).h
1023-element SparseVector{Int64,Int64} with 1 stored entry:
  [512 ]  =  1

I find the notations difficult to read, esp. because of the mix of different types of indexes (12 is sometimes the 12th marginal, sometimes the set of the first and second).

What's the correct way to index entropic cones? Thanks!

blegat commented 6 years ago

What's the correct way to index entropic cones?

I would say that EntropicCone.set(10) is the most appropriate one when you know the index when writing the code (and when the set does not contain any number greater than 9) and EntropicCone.set([10]) is more appropriate when you generate programatically. I have added documentation in fefb6cdecb21ef30d72ef4a03451812190a8f9a2 :)

Here EntropicCone.set([10]) corresponds to the set {10} hence it is not possible to build this set with the other set method since 10 > 9