artofscience / SAOR

Sequential Approximate Optimization Repository
GNU General Public License v3.0
5 stars 1 forks source link

Update loops in mixed subproblems #49

Closed MaxvdKolk closed 3 years ago

MaxvdKolk commented 3 years ago

This updates the layout of the loops within the mixed subproblem class, from the commit:

Provides a generator function that yields the required combinations of indices and values across the variable and response sets. Also adds the __getitem__ and __setitem__ methods such that the subproblems can be accessed by indexing directly on the class instances, e.g. self[i, j] compared to self.subproblems[i, j].

This might make the code a bit more readable, as it reduces the double loops in most functions and makes the statements a little bit more concise.

Maybe @artofscience and @Giannis1993 can do a review to see if it should be merged or not.

artofscience commented 3 years ago

@MaxvdKolk ready to merge?