Commit 18130470 authored by Dr.李's avatar Dr.李

update to use interior method with mumps

parent 2f190f74
......@@ -37,6 +37,25 @@ class TestLinearBuild(unittest.TestCase):
expected_risk = np.zeros(self.risk_exp.shape[1])
np.testing.assert_array_almost_equal(calc_risk, expected_risk)
def test_linear_build_with_interior(self):
bm = self.bm / self.bm.sum()
eplson = 1e-6
status, _, w = linear_builder(self.er,
0.,
0.01,
self.risk_exp,
(bm @ self.risk_exp, bm @ self.risk_exp),
method='interior')
self.assertEqual(status, 'optimal')
self.assertAlmostEqual(np.sum(w), 1.)
self.assertTrue(np.all(w <= 0.01 + eplson))
self.assertTrue(np.all(w >= -eplson))
calc_risk = (w - bm) @ self.risk_exp
expected_risk = np.zeros(self.risk_exp.shape[1])
np.testing.assert_array_almost_equal(calc_risk, expected_risk)
def test_linear_build_with_inequality_constraints(self):
bm = self.bm / self.bm.sum()
eplson = 1e-6
......
......@@ -51,7 +51,16 @@ else:
"alphamind/pfopt/include/pfopt",
"alphamind/pfopt/include/eigen",
"alphamind/pfopt/include/alglib"],
libraries=['pfopt', 'alglib', 'libClp', 'libCoinUtils', 'libipopt', 'libcoinhsl', 'libcoinblas', 'libcoinlapack', 'libcoinmetis'],
libraries=['pfopt',
'alglib',
'libClp',
'libCoinUtils',
'libipopt',
'libcoinhsl',
'libcoinblas',
'libcoinlapack',
'libcoinmetis',
'libcoinmumps'],
library_dirs=['alphamind/pfopt/lib'],
extra_compile_args=['/MD']),
]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment