help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: glpk problem,please check code


From: Ben Abbott
Subject: Re: glpk problem,please check code
Date: Sun, 12 Feb 2017 12:31:00 -0500

> On Feb 12, 2017, at 10:54 AM, saiko7 <address@hidden> wrote:
> 
> function [alpha]=mclp(B,c,d);
> 
> a=B(:,1:29);
> r=size(a,1);
> c=size(a,2);
> Q=gallery("lehmer",r);Q2=[Q zeros(r,r);zeros(r,r) zeros(r,r)];
> alpha=zeros(r,1);
> e=ones(r,1);e2=[e;zeros(r,1)];
> u=zeros(r,1);u2=[u;zeros(r,1)];
> v=zeros(r,1);v2=[v;zeros(r,1)];
> y=B(:,30);
> p=sum(y==0);q=sum(y==1);
> 
> E=[eye(q,q) zeros(q,p);zeros(p,q) -eye(p,p)];E2=[E zeros(r,r);zeros(r,r)
> zeros(r,r)];
> alpha=zeros(r,1);
> b=a*a'+e*e';
> H=[b zeros(r,r);zeros(r,r) Q];
> alpha2=[alpha;u];alpha2(1,1)=0.000000001;
> 
> [alpha2 obj
> inf]=qp(alpha2,H,zeros(2*r,1),[],[],[],[],(-Q2*u2)-(d*e2),E2,-c*e2);
> 
> ihave checked the dimensions of the matrices invoved ,but keep getting the
> message 
> mclp(a,3,1)
> error: glpk: A must be a real valued 8 by 12 matrix
> error: called from
>    glpk at line 506 column 5
>    qp at line 370 column 29
>    mclp at line 20 column 16
> 
> where a is a 4*30 matrix

I’m seeing a possible problem with glpk as well. What version of Octave are you 
using and what is the value for “a” when you call mclp(a,3,1)?

Ben




reply via email to

[Prev in Thread] Current Thread [Next in Thread]