Minimize ||y &minus &phi||2 , over A&phi&ge 0,
where y is a vector in &realn, and A is an m by n "irreducible" matrix.
Here "irreducible" (Meyer 1999) means that the constraints are "nonredundant;" specifically, no row of A is a positive linear combination of other rows, and there is not a positive linear combination of rows of A that is equal to the zero vector. The following code has arguments A and y, and returns the solution.
Minimize &phi'Q &phi &minus 2c'&phi, over A&phi&ge 0,
where Q is an n by n positive-definite matrix, c is a constant vector in &realn, and A is an m by n "irreducible" matrix.
The following code has arguments Q, A and c, and returns the solution.