예제 #1
0
    def test_optimisation(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")

        sol2 = exercice_particulier2()
        x2 = sol2['x']
        d = abs(x2[0] - 0.428571428055853) + abs(x2[1] - 0.2857142848749249)
        assert d < 1e-5

        if is_travis_or_appveyor() == "travis":
            # skip mkl
            return

            sol1 = exercice_particulier1()
            sol2 = exercice_particulier2()
            fLOG("cvxopt")
            fLOG(sol1)
            fLOG("solution:", sol1['x'].T)
            fLOG("Arrow_Hurwicz")
            fLOG(sol2)
            fLOG("solution:", sol2['x'])

            x1 = sol1['x']
            x2 = sol2['x']
            d1 = x1[0] - x2[0]
            d2 = x1[1] - x2[1]
            fLOG(d1, d2)
            assert abs(d1) < 1e-5
            assert abs(d2) < 1e-5
예제 #2
0
    def test_optimisation(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        sol2 = exercice_particulier2()
        x2 = sol2['x']
        d = abs(x2[0] - 0.428571428055853) + abs(x2[1] - 0.2857142848749249)
        assert d < 1e-5

        if is_travis_or_appveyor() == "travis":
            # skip mkl
            return

            sol1 = exercice_particulier1()
            sol2 = exercice_particulier2()
            fLOG("cvxopt")
            fLOG(sol1)
            fLOG("solution:", sol1['x'].T)
            fLOG("Arrow_Hurwicz")
            fLOG(sol2)
            fLOG("solution:", sol2['x'])

            x1 = sol1['x']
            x2 = sol2['x']
            d1 = x1[0] - x2[0]
            d2 = x1[1] - x2[1]
            fLOG(d1, d2)
            assert abs(d1) < 1e-5
            assert abs(d2) < 1e-5
예제 #3
0
    def test_optimisation_cvxopt(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")

        sol2 = exercice_particulier2()
        x2 = sol2['x']
        d = abs(x2[0] - 0.428571428055853) + abs(x2[1] - 0.2857142848749249)
        self.assertLesser(d, 1e-5)

        sol1 = exercice_particulier1()
        sol2 = exercice_particulier2()
        fLOG("cvxopt")
        fLOG(sol1)
        fLOG("solution:", sol1['x'].T)
        fLOG("Arrow_Hurwicz")
        fLOG(sol2)
        fLOG("solution:", sol2['x'])

        x1 = sol1['x']
        x2 = sol2['x']
        d1 = x1[0] - x2[0]
        d2 = x1[1] - x2[1]
        fLOG(d1, d2)
        self.assertLesser(abs(d1), 1e-5)
        self.assertLesser(abs(d2), 1e-5)
예제 #4
0
    def test_optimisation(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")

        sol2 = exercice_particulier2()
        x2 = sol2['x']
        d = abs(x2[0] - 0.428571428055853) + abs(x2[1] - 0.2857142848749249)
        self.assertLesser(d, 1e-5)
예제 #5
0
    def test_optimisation(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")

        sol1 = exercice_particulier1()
        sol2 = exercice_particulier2()
        fLOG("cvxopt")
        fLOG(sol1)
        fLOG("solution:", sol1['x'].T)
        fLOG("Arrow_Hurwicz")
        fLOG(sol2)
        fLOG("solution:", sol2['x'])

        x1 = sol1['x']
        x2 = sol2['x']
        d1 = x1[0] - x2[0]
        d2 = x1[1] - x2[1]
        fLOG(d1, d2)
        assert abs(d1) < 1e-5
        assert abs(d2) < 1e-5
    def test_optimisation(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        sol1 = exercice_particulier1()
        sol2 = exercice_particulier2()
        fLOG("cvxopt")
        fLOG(sol1)
        fLOG("solution:", sol1['x'].T)
        fLOG("Arrow_Hurwicz")
        fLOG(sol2)
        fLOG("solution:", sol2['x'])

        x1 = sol1['x']
        x2 = sol2['x']
        d1 = x1[0] - x2[0]
        d2 = x1[1] - x2[1]
        fLOG(d1, d2)
        assert abs(d1) < 1e-5
        assert abs(d2) < 1e-5