Chapter Contents |
Previous |
Next |
Language Reference |
q={1, 1}; m={1 0, 0 1}; call lcp(rc,w,z,m,q);The result is
RC 1 row 1 col (numeric) 0 W 2 rows 1 col (numeric) 1 1 Z 2 rows 1 col (numeric) 0 0The next example shows the relationship between quadratic programming and the linear complementarity problem. Consider the linearly constrained quadratic program:
/*---- Data for the Quadratic Program -----*/ c={1,2,3,4}; h={100 10 1 0, 10 100 10 1, 1 10 100 10, 0 1 10 100}; g={1 2 3 4, 10 20 30 40}; b={1, 1}; /*----- Express the Kuhn-Tucker Conditions as an LCP ----*/ m=h||-g^{\prime} ; m=m//(g||j(nrow(g),nrow(g),0)); q=c//-b ; /*----- Solve for a Kuhn-Tucker Point --------*/ call lcp(rc,w,z,m,q); /*------ Extract the Solution to the Quadratic Program ----*/ x=z[1:nrow(h)]; print rc x;The printed solution is
RC 1 row 1 col (numeric) 0 X 4 rows 1 col (numeric) 0.0307522 0.0619692 0.0929721 0.1415983
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.