|
From: | Ray Zimmerman |
Subject: | [Octave-bug-tracker] [bug #47314] quadprog() equality constraints have opposite sign |
Date: | Tue, 01 Mar 2016 15:35:40 +0000 |
User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/601.4.4 (KHTML, like Gecko) Version/9.0.3 Safari/601.4.4 |
URL: <http://savannah.gnu.org/bugs/?47314> Summary: quadprog() equality constraints have opposite sign Project: GNU Octave Submitted by: rdzman Submitted on: Tue 01 Mar 2016 03:35:39 PM GMT Category: Octave Forge Package Severity: 3 - Normal Priority: 5 - Normal Item Group: Matlab Compatibility Status: None Assigned to: None Originator Name: Ray Zimmerman Originator Email: Open/Closed: Open Discussion Lock: Any Release: 4.0.1-rc1 Operating System: Mac OS _______________________________________________________ Details: quadprog() from optim-1.5.0 implements the equality constraints with the opposite sign from Matlab. That is, the multipliers on the equality constraints have the opposite sign. I have attached an example that gives the following respective output: for Octave: ans = 2.1933 for Matlab: ans = -2.1933 The fix is to simply add a negative sign in line 382: lambda.eqlin = -qp_lambda(lm_idx:lm_idx + n_eq - count_not_ineq - 1); _______________________________________________________ File Attachments: ------------------------------------------------------- Date: Tue 01 Mar 2016 03:35:39 PM GMT Name: quadprogtest.m Size: 456B By: rdzman <http://savannah.gnu.org/bugs/download.php?file_id=36521> _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?47314> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |