# Path: labella/vpsc.py
# class PositionStats(object):
# class Constraint(object):
# class Variable(object):
# class Block(object):
# class Blocks(object):
# class Solver(object):
#     def __init__(self, scale):
#     def addVariable(self, v):
#     def getPosn(self):
#     def __init__(self, left, right, gap, equality=None):
#     def slack(self):
#     def __repr__(self):
#     def __str__(self):
#     def __init__(self, desiredPosition, weight=None, scale=None):
#     def dfdv(self):
#     def position(self):
#     def visitNeighbours(self, prev, f):
#         def ff(c, _next):
#     def __repr__(self):
#     def __str__(self):
#     def __init__(self, v):
#     def addVariable(self, v):
#     def updateWeightedPosition(self):
#     def compute_lm(self, v, u, postAction):
#         def f(c, _next):
#     def populateSplitBlock(self, v, prev):
#         def f(c, _next):
#     def traverse(self, visit, acc, v, prev):
#         def f(c, _next):
#     def findMinLM(self):
#         def f(c):
#     def findMinLMBetween(self, lv, rv):
#         def f(x):
#         def f(c, _next):
#     def findPath(self, v, prev, to, visit):
#         def f(c, _next):
#     def isActiveDirectedPathBetween(self, u, v):
#     def split(cls, c):
#     def createSplitBlock(cls, startVar):
#     def splitBetween(self, vl, vr):
#     def mergeAcross(self, b, c, dist):
#     def cost(self):
#     def __init__(self, vs):
#     def cost(self):
#     def insert(self, b):
#     def remove(self, b):
#     def merge(self, c):
#     def forEach(self, f):
#     def updateBlockPositions(self):
#     def split(self, inactive):
#     def __init__(self, vs, cs):
#     def cost(self):
#     def setStartingPositions(self, ps):
#     def setDesiredPositions(self, ps):
#     def mostViolated(self):
#     def satisfy(self):
#     def solve(self):
#     LAGRANGIAN_TOLERANCE = -1e-4
#     ZERO_UPPERBOUND = -1e-10


import unittest
from labella import vpsc
                {'left': 6, 'right': 9, 'gap': 3 },
                {'left': 7, 'right': 8, 'gap': 3 },
                {'left': 7, 'right': 9, 'gap': 3 },
                {'left': 8, 'right': 9, 'gap': 3 }]
        expected = [-3.71429, 4, 1, -0.714286, 2.28571, 2.28571, 7, 5.28571,
                8.28571, 11.2857]
        rnd_exp, rnd_res = self.get_solution(variables, constraints, expected)
        self.assertEqual(rnd_exp, rnd_res)

    def test_6(self):
        variables = [
		{'desiredPosition': 7, 'weight': 1 },
		{'desiredPosition': 0, 'weight': 1 },
		{'desiredPosition': 3, 'weight': 1 },
		{'desiredPosition': 1, 'weight': 1 },
		{'desiredPosition': 4, 'weight': 1 }
		]
        constraints = [
		{'left': 0, 'right': 3, 'gap': 3 },
		{'left': 0, 'right': 2, 'gap': 3 },
		{'left': 1, 'right': 4, 'gap': 3 },
		{'left': 1, 'right': 4, 'gap': 3 },
		{'left': 2, 'right': 3, 'gap': 3 },
		{'left': 3, 'right': 4, 'gap': 3 }
		]
        expected = [-0.75, 0, 2.25, 5.25, 8.25]
        rnd_exp, rnd_res = self.get_solution(variables, constraints, expected)
        self.assertEqual(rnd_exp, rnd_res)

    def test_7(self):

# Path: labella/vpsc.py
# class PositionStats(object):
# class Constraint(object):
# class Variable(object):
# class Block(object):
# class Blocks(object):
# class Solver(object):
#     def __init__(self, scale):
#     def addVariable(self, v):
#     def getPosn(self):
#     def __init__(self, left, right, gap, equality=None):
#     def slack(self):
#     def __repr__(self):
#     def __str__(self):
#     def __init__(self, desiredPosition, weight=None, scale=None):
#     def dfdv(self):
#     def position(self):
#     def visitNeighbours(self, prev, f):
#         def ff(c, _next):
#     def __repr__(self):
#     def __str__(self):
#     def __init__(self, v):
#     def addVariable(self, v):
#     def updateWeightedPosition(self):
#     def compute_lm(self, v, u, postAction):
#         def f(c, _next):
#     def populateSplitBlock(self, v, prev):
#         def f(c, _next):
#     def traverse(self, visit, acc, v, prev):
#         def f(c, _next):
#     def findMinLM(self):
#         def f(c):
#     def findMinLMBetween(self, lv, rv):
#         def f(x):
#         def f(c, _next):
#     def findPath(self, v, prev, to, visit):
#         def f(c, _next):
#     def isActiveDirectedPathBetween(self, u, v):
#     def split(cls, c):
#     def createSplitBlock(cls, startVar):
#     def splitBetween(self, vl, vr):
#     def mergeAcross(self, b, c, dist):
#     def cost(self):
#     def __init__(self, vs):
#     def cost(self):
#     def insert(self, b):
#     def remove(self, b):
#     def merge(self, c):
#     def forEach(self, f):
#     def updateBlockPositions(self):
#     def split(self, inactive):
#     def __init__(self, vs, cs):
#     def cost(self):
#     def setStartingPositions(self, ps):
#     def setDesiredPositions(self, ps):
#     def mostViolated(self):
#     def satisfy(self):
#     def solve(self):
#     LAGRANGIAN_TOLERANCE = -1e-4
#     ZERO_UPPERBOUND = -1e-10


# Path: tests/test_vpsc.py
import unittest
from labella import vpsc

                {'left': 6, 'right': 9, 'gap': 3 },
                {'left': 7, 'right': 8, 'gap': 3 },
                {'left': 7, 'right': 9, 'gap': 3 },
                {'left': 8, 'right': 9, 'gap': 3 }]
        expected = [-3.71429, 4, 1, -0.714286, 2.28571, 2.28571, 7, 5.28571,
                8.28571, 11.2857]
        rnd_exp, rnd_res = self.get_solution(variables, constraints, expected)
        self.assertEqual(rnd_exp, rnd_res)

    def test_6(self):
        variables = [
		{'desiredPosition': 7, 'weight': 1 },
		{'desiredPosition': 0, 'weight': 1 },
		{'desiredPosition': 3, 'weight': 1 },
		{'desiredPosition': 1, 'weight': 1 },
		{'desiredPosition': 4, 'weight': 1 }
		]
        constraints = [
		{'left': 0, 'right': 3, 'gap': 3 },
		{'left': 0, 'right': 2, 'gap': 3 },
		{'left': 1, 'right': 4, 'gap': 3 },
		{'left': 1, 'right': 4, 'gap': 3 },
		{'left': 2, 'right': 3, 'gap': 3 },
		{'left': 3, 'right': 4, 'gap': 3 }
		]
        expected = [-0.75, 0, 2.25, 5.25, 8.25]
        rnd_exp, rnd_res = self.get_solution(variables, constraints, expected)
        self.assertEqual(rnd_exp, rnd_res)

    def test_7(self):

        variables = [