def set(nl_file, args): header = util.read_nl_header(nl_file.name) maxfct = k * 50 * (header.num_vars + header.num_cons + 2)**2 solver_options = args['solver_options'] solver_options['g_maxfct'] = maxfct solver_options['l_maxfct'] = maxfct solver_options['maxnosuc'] = maxfct
def test_read_nl_header(): with tempfile.NamedTemporaryFile() as nl_file: nl_file.write('''g3 1 1 0 # problem bqp1var 11 22 1 0 0 # vars, constraints, objectives, ranges, eqns ''') nl_file.flush() header = util.read_nl_header(nl_file.name) assert header.num_vars == 11 assert header.num_cons == 22
def test_read_nl_header(): with tempfile.NamedTemporaryFile() as nl_file: nl_file.write( '''g3 1 1 0 # problem bqp1var 11 22 1 0 0 # vars, constraints, objectives, ranges, eqns ''') nl_file.flush() header = util.read_nl_header(nl_file.name) assert header.num_vars == 11 assert header.num_cons == 22