Mercurial > octave-nkf
comparison scripts/optimization/qp.m @ 10540:952d4df5b686
Eliminate NaN*ones and Inf*ones constructs and just use Nan() and Inf()
author | Rik <code@nomad.inbox5.com> |
---|---|
date | Thu, 22 Apr 2010 14:03:47 -0700 |
parents | 17ce2a700a97 |
children | 95c3e38098bf |
comparison
equal
deleted
inserted
replaced
10539:8db807a0eb78 | 10540:952d4df5b686 |
---|---|
347 else | 347 else |
348 Atmp = [Ain, gamma]; | 348 Atmp = [Ain, gamma]; |
349 btmp = bin; | 349 btmp = bin; |
350 endif | 350 endif |
351 ctmp = [zeros(n-n_eq, 1); ones(n_in, 1)]; | 351 ctmp = [zeros(n-n_eq, 1); ones(n_in, 1)]; |
352 lb = [-Inf*ones(n-n_eq,1); zeros(n_in,1)]; | 352 lb = [-Inf(n-n_eq,1); zeros(n_in,1)]; |
353 ub = []; | 353 ub = []; |
354 ctype = repmat ("L", n_in, 1); | 354 ctype = repmat ("L", n_in, 1); |
355 [P, dummy, status] = glpk (ctmp, Atmp, btmp, lb, ub, ctype); | 355 [P, dummy, status] = glpk (ctmp, Atmp, btmp, lb, ub, ctype); |
356 if ((status == 180 || status == 181 || status == 151) | 356 if ((status == 180 || status == 181 || status == 151) |
357 && all (abs (P(n-n_eq+1:end)) < rtol * (1 + norm (btmp)))) | 357 && all (abs (P(n-n_eq+1:end)) < rtol * (1 + norm (btmp)))) |