def _check_reg_match(sss_py, sss_mf, comp_tol):
 info_py = sss_py.info['proc_history'][0]['max_info']['sss_info']
 assert_true((info_py is not None))
 assert_true((len(info_py) > 0))
 info_mf = sss_mf.info['proc_history'][0]['max_info']['sss_info']
 n_in = None
 for inf in (info_py, info_mf):
  if (n_in is None):
   n_in = _get_n_moments(inf['in_order'])
  else:
   assert_equal(n_in, _get_n_moments(inf['in_order']))
  assert_equal(inf['components'][:n_in].sum(), inf['nfree'])
 assert_allclose(info_py['nfree'], info_mf['nfree'], atol=comp_tol, err_msg=sss_py._filenames[0])

def _check_reg_match ( sss_py , sss_mf , comp_tol ) : info_py = sss_py . info [ 'proc_history' ] [ 0 ] [ 'max_info' ] [ 'sss_info' ] assert_true ( ( info_py is not None ) ) assert_true ( ( len ( info_py ) > 0 ) ) info_mf = sss_mf . info [ 'proc_history' ] [ 0 ] [ 'max_info' ] [ 'sss_info' ] n_in = None for inf in ( info_py , info_mf ) : if ( n_in is None ) : n_in = _get_n_moments ( inf [ 'in_order' ] ) else : assert_equal ( n_in , _get_n_moments ( inf [ 'in_order' ] ) ) assert_equal ( inf [ 'components' ] [ : n_in ] . sum ( ) , inf [ 'nfree' ] ) assert_allclose ( info_py [ 'nfree' ] , info_mf [ 'nfree' ] , atol = comp_tol , err_msg = sss_py . _filenames [ 0 ] )
helper to check regularization .