Replaced left/right with list based dimension args in swr_1dopt
Replaced hard coded locs with dim list in swr_2dopt
List comprehension in forming list of g updates for 1d and 2d swr opt
Merged 1d and 2d swr functions