def _fwd_bem_linear_collocation_solution(m):
 for surf in m['surfs']:
  complete_surface_info(surf, copy=False, verbose=False)
 logger.info('Computing the linear collocation solution...')
 logger.info('    Matrix coefficients...')
 coeff = _fwd_bem_lin_pot_coeff(m['surfs'])
 m['nsol'] = len(coeff)
 logger.info('    Inverting the coefficient matrix...')
 nps = [surf['np'] for surf in m['surfs']]
 m['solution'] = _fwd_bem_multi_solution(coeff, m['gamma'], nps)
 if (len(m['surfs']) == 3):
  ip_mult = (m['sigma'][1] / m['sigma'][2])
  if (ip_mult <= FIFF.FWD_BEM_IP_APPROACH_LIMIT):
   logger.info('IP approach required...')
   logger.info('    Matrix coefficients (homog)...')
   coeff = _fwd_bem_lin_pot_coeff([m['surfs'][(-1)]])
   logger.info('    Inverting the coefficient matrix (homog)...')
   ip_solution = _fwd_bem_homog_solution(coeff, [m['surfs'][(-1)]['np']])
   logger.info('    Modify the original solution to incorporate IP approach...')
   _fwd_bem_ip_modify_solution(m['solution'], ip_solution, ip_mult, nps)
 m['bem_method'] = FIFF.FWD_BEM_LINEAR_COLL
 logger.info('Solution ready.')

def _fwd_bem_linear_collocation_solution ( m ) : for surf in m [ 'surfs' ] : complete_surface_info ( surf , copy = False , verbose = False ) logger . info ( 'Computing the linear collocation solution...' ) logger . info ( '    Matrix coefficients...' ) coeff = _fwd_bem_lin_pot_coeff ( m [ 'surfs' ] ) m [ 'nsol' ] = len ( coeff ) logger . info ( '    Inverting the coefficient matrix...' ) nps = [ surf [ 'np' ] for surf in m [ 'surfs' ] ] m [ 'solution' ] = _fwd_bem_multi_solution ( coeff , m [ 'gamma' ] , nps ) if ( len ( m [ 'surfs' ] ) == 3 ) : ip_mult = ( m [ 'sigma' ] [ 1 ] / m [ 'sigma' ] [ 2 ] ) if ( ip_mult <= FIFF . FWD_BEM_IP_APPROACH_LIMIT ) : logger . info ( 'IP approach required...' ) logger . info ( '    Matrix coefficients (homog)...' ) coeff = _fwd_bem_lin_pot_coeff ( [ m [ 'surfs' ] [ ( - 1 ) ] ] ) logger . info ( '    Inverting the coefficient matrix (homog)...' ) ip_solution = _fwd_bem_homog_solution ( coeff , [ m [ 'surfs' ] [ ( - 1 ) ] [ 'np' ] ] ) logger . info ( '    Modify the original solution to incorporate IP approach...' ) _fwd_bem_ip_modify_solution ( m [ 'solution' ] , ip_solution , ip_mult , nps ) m [ 'bem_method' ] = FIFF . FWD_BEM_LINEAR_COLL logger . info ( 'Solution ready.' )
compute the linear collocation potential solution .