View Single Post
  #31  
Old 05-21-2012, 04:30 PM
kurts kurts is offline
Invited Guest
 
Join Date: Apr 2012
Location: Portland, OR
Posts: 70
Default Re: What Quadratic Programming Package?

Quote:
Originally Posted by jg2012 View Post
Anyone have success with Octave + qp?
Here's the setup that I used for the qp function

Code:
    n = length(X(:,1)); % How many points
    d = length(X(1,:)); % Dimensionality of X
    H = zeros(n,n);
    L = ones(n,1);
    L = -1.*L;       % Linear term is tall vector of -1
    lb = zeros(n,1); % Lower bound on alpha is tall vector of 0
    A = Y';          % Linear coefficient  (A)(alpha) + blin = 0
    blin = 0;        % 
    
    for i = 1:n;
        for j = 1:n;
            H(i,j) = Y(i)*Y(j)*X(j,:)*X(i,:)';
        end;
    end;

    [alpha, obj, info, lambda] = qp([],H,L,A,blin,lb,[]);
Reply With Quote