def process_conf(conf, kwargs): """ Missing items are set to default values. Example configuration, all items:: solver_2 = { 'name' : 'eigen1', 'kind' : 'eig.pysparse', 'i_max' : 150, 'eps_a' : 1e-5, 'tau' : -10.0, 'method' : 'qmrs', 'verbosity' : 0, 'strategy' : 1, } """ get = make_get_conf(conf, kwargs) common = EigenvalueSolver.process_conf(conf) return Struct(i_max=get('i_max', 100), eps_a=get('eps_a', 1e-5), tau=get('tau', 0.0), method=get('method', 'qmrs'), verbosity=get('verbosity', 0), strategy=get('strategy', 1)) + common
def process_conf( conf ): """ Missing items are set to default values. Example configuration, all items: solver_2 = { 'name' : 'eigen1', 'kind' : 'eig.pysparse', 'i_max' : 150, 'eps_a' : 1e-5, 'tau' : -10.0, 'method' : 'qmrs', 'verbosity' : 0, 'strategy' : 1, } """ get = conf.get_default_attr i_max = get( 'i_max', 100 ) eps_a = get( 'eps_a', 1e-5 ) tau = get( 'tau', 0.0 ) method = get( 'method', 'qmrs' ) verbosity = get( 'verbosity', 0 ) strategy = get( 'strategy', 1 ) common = EigenvalueSolver.process_conf( conf ) return Struct( **locals() ) + common
def process_conf(conf, kwargs): """ Missing items are set to default values. Example configuration, all items:: solver_2 = { 'name' : 'lobpcg', 'kind' : 'eig.scipy_lobpcg', 'i_max' : 20, 'n_eigs' : 5, 'eps_a' : None, 'largest' : True, 'precond' : None, 'verbosity' : 0, } """ get = make_get_conf(conf, kwargs) common = EigenvalueSolver.process_conf(conf) return Struct(i_max=get('i_max', 20), n_eigs=get('n_eigs', None), eps_a=get('eps_a', None), largest=get('largest', True), precond=get('precond', None), verbosity=get('verbosity', 0)) + common
def process_conf(conf, kwargs): """ Missing items are set to default values. Example configuration, all items:: solver_2 = { 'name' : 'eigen1', 'kind' : 'eig.pysparse', 'i_max' : 150, 'eps_a' : 1e-5, 'tau' : -10.0, 'method' : 'qmrs', 'verbosity' : 0, 'strategy' : 1, } """ get = make_get_conf(conf, kwargs) common = EigenvalueSolver.process_conf(conf) return Struct(i_max=get('i_max', 100), n_eigs=get('n_eigs', 5), eps_a=get('eps_a', 1e-5), tau=get('tau', 0.0), method=get('method', 'qmrs'), verbosity=get('verbosity', 0), strategy=get('strategy', 1)) + common
def process_conf( conf ): """ Missing items are set to default values. Example configuration, all items:: solver_2 = { 'name' : 'lobpcg', 'kind' : 'eig.scipy_lobpcg', 'i_max' : 20, 'n_eigs' : 5, 'eps_a' : None, 'largest' : True, 'precond' : None, 'verbosity' : 0, } """ get = conf.get_default_attr i_max = get( 'i_max', 20 ) n_eigs = get( 'n_eigs', None ) eps_a = get( 'eps_a', None ) largest = get( 'largest', True ) precond = get( 'precond', None ) verbosity = get( 'verbosity', 0 ) common = EigenvalueSolver.process_conf( conf ) return Struct( **locals() ) + common
def process_conf(conf, kwargs): """ Missing items are set to default values. Example configuration, all items:: solver_20 = { 'name' : 'eigen2', 'kind' : 'eig.sgscipy', 'force_n_eigs' : True, } """ get = make_get_conf(conf, kwargs) common = EigenvalueSolver.process_conf(conf) return Struct(force_n_eigs=get('force_n_eigs', False)) + common