regqp.solve(PredictorCorrector=not options.longstep, check_infeasible=not options.assume_feasible, **opts_solve) # Display summary line. probname=os.path.basename(probname) if probname[-3:] == '.nl': probname = probname[:-3] if not options.verbose: log.info(fmt % (probname, regqp.iter, regqp.obj_value, regqp.pResid, regqp.dResid, regqp.rgap, t_setup, regqp.solve_time, regqp.short_status)) if regqp.short_status == 'degn': log.info(' F') # Could not regularize sufficiently. qp.close() log.info('-'*len(hdr)) if not multiple_problems: x = regqp.x[:qp.original_n] log.info('Final x: %s, |x| = %7.1e' % (repr(x),norm2(x))) log.info('Final y: %s, |y| = %7.1e' % (repr(regqp.y),norm2(regqp.y))) log.info('Final z: %s, |z| = %7.1e' % (repr(regqp.z),norm2(regqp.z))) log.info(regqp.status) log.info('#Iterations: %-d' % regqp.iter) log.info('RelResidual: %7.1e' % regqp.kktResid) log.info('Final cost : %21.15e' % regqp.obj_value) log.info('Setup time : %6.2fs' % t_setup) log.info('Solve time : %6.2fs' % regqp.solve_time)
check_infeasible=not options.assume_feasible, **opts_solve) # Display summary line. probname=os.path.basename(probname) if probname[-3:] == '.nl': probname = probname[:-3] if not options.verbose: sys.stdout.write(fmt % (probname, regqp.iter, regqp.obj_value, regqp.pResid, regqp.dResid, regqp.rgap, t_setup, regqp.solve_time, regqp.short_status)) if regqp.short_status == 'degn': sys.stdout.write(' F') # Could not regularize sufficiently. sys.stdout.write('\n') qp.close() if not options.verbose: sys.stderr.write('-'*len(hdr) + '\n') else: x = regqp.x[:qp.original_n] print 'Final x: ', x, ', |x| = %7.1e' % norm2(x) print 'Final y: ', regqp.y, ', |y| = %7.1e' % norm2(regqp.y) print 'Final z: ', regqp.z, ', |z| = %7.1e' % norm2(regqp.z) sys.stdout.write('\n' + regqp.status + '\n') sys.stdout.write(' #Iterations: %-d\n' % regqp.iter) sys.stdout.write(' RelResidual: %7.1e\n' % regqp.kktResid) sys.stdout.write(' Final cost : %21.15e\n' % regqp.obj_value) sys.stdout.write(' Setup time : %6.2fs\n' % t_setup) sys.stdout.write(' Solve time : %6.2fs\n' % regqp.solve_time)
numpy.set_printoptions(precision=3, linewidth=80, threshold=10, edgeitems=3) if not options.verbose: sys.stderr.write(hdr + '\n' + '-'*len(hdr) + '\n') for probname in args: t_setup = cputime() lp = SlackFramework(probname) t_setup = cputime() - t_setup islp = True if not lp.islp(): sys.stderr.write('Problem %s is not a linear program\n' % probname) islp = False lp.close() continue # Pass problem to RegLP. reglp = RegLPInteriorPointSolver(lp, scale=not options.no_scale, stabilize=not options.no_stabilize, verbose=options.verbose, **opts_init) reglp.solve(PredictorCorrector=not options.longstep, check_infeasible=not options.assume_feasible, **opts_solve) # Display summary line. probname=os.path.basename(probname)
numpy.set_printoptions(precision=3, linewidth=80, threshold=10, edgeitems=3) if not options.verbose: sys.stderr.write(hdr + '\n' + '-' * len(hdr) + '\n') for probname in args: t_setup = cputime() lp = SlackFramework(probname) t_setup = cputime() - t_setup islp = True if not lp.islp(): sys.stderr.write('Problem %s is not a linear program\n' % probname) islp = False lp.close() continue # Pass problem to RegLP. reglp = RegLPInteriorPointSolver(lp, scale=not options.no_scale, stabilize=not options.no_stabilize, verbose=options.verbose, **opts_init) reglp.solve(PredictorCorrector=not options.longstep, check_infeasible=not options.assume_feasible, **opts_solve) # Display summary line. probname = os.path.basename(probname)