コード例 #1
0
ファイル: test_sdr.py プロジェクト: vishalbelsare/pylocus
 def call_method(self, method=''):
     print('TestSDP:call_method')
     Xhat, edm = reconstruct_sdp(self.pts.edm,
                                 all_points=self.pts.points,
                                 solver='CVXOPT',
                                 method='maximize')
     return Xhat
コード例 #2
0
 def call_method(self, method=''):
     print('TestSDP:call_method')
     Xhat, edm = reconstruct_sdp(self.pts.edm,
                                 real_points=self.pts.points,
                                 solver='SCS',
                                 eps=1e-10,
                                 method='maximize')
     return Xhat
コード例 #3
0
ファイル: test_sdr.py プロジェクト: vishalbelsare/pylocus
 def test_parameters(self):
     print('TestSDP:test_parameters')
     self.create_points()
     epsilons = [1e-3, 1e-5, 1e-7]
     options_list = [{}, {
         'solver': 'CVXOPT',
         'abstol': 1e-5,
         'reltol': 1e-6,
         'feastol': 1e-7
     }]
     for options, eps in zip(options_list, epsilons):
         print('testing options', options, eps)
         self.eps = eps
         points_estimate, __ = reconstruct_sdp(self.pts.edm,
                                               all_points=self.pts.points,
                                               method='maximize',
                                               **options)
         error = np.linalg.norm(self.pts.points - points_estimate)
         self.assertTrue(
             error < self.eps,
             'with options {} \nerror: {} not smaller than {}'.format(
                 options, error, self.eps))