Implementation of logdet()

46 views
Skip to first unread message

Noboru Sebe

unread,
Nov 2, 2013, 10:26:39 PM11/2/13
to yal...@googlegroups.com
Hi,

I have a question about implementation of logdet().
If I pass the parbarrier option to sdpt3() directly
(by dirty tricks), the consumption time is much reduced.
Is it possible to realize the same thing without dirty tricks?

The conceptual code is given below.
And complete example files are attached as a zip file.


F=[Fi,Fe];    % Fi: inequality constraints, Fe: equality constraints
hp
=1e-2;

obj_tmp
=obj.dvar;
F_method
=1    % 1: usual code, 2: pass parbarrier option to sdpt3()
switch F_method
 
case 1
 
for i=1:length(Fi)
    obj_tmp
=obj_tmp-logdet(Fi{i})*hp;
 
end
  F
=Fe;
 
case 2
  parbarrier
=cell(length(F,1));
 
for i=1:length(Fi)
    parbarrier
{i}=hp;
 
end
 
for i=1:length(Fe)
    parbarrier
{length(Fi)+i}=0;
 
end
  yopts
=sdpsettings(yopts,'sdpt3.parbarrier',parbarrier);
end

sol
=solvesdp(F,obj_tmp,yopts);
obj
.cvar=double(obj.dvar)


Thank you in advance.
Regards,
Noboru

test_logdet.zip

Johan Löfberg

unread,
Nov 3, 2013, 3:47:56 AM11/3/13
to yal...@googlegroups.com
Note that your code would fail if you used different gains on the different terms. YALMIP/SDPT3 reorder things internally (1x1 are put together in LP cones and are placed first etc).

The reason it runs slower is because YALMIP turns off the feature smallblkdim (blocks many small LMI constraints in one large LMI. Default size is 50, i.e. 3 13x13 constraints would be placed in one matrix and all linear algebra is performed on that matrix instead) when logdet terms are present. I don't remember the reason, I guess it got really messy when dealing with complex cases. I'll might have a look at it again.

Noboru Sebe

unread,
Nov 3, 2013, 4:40:06 AM11/3/13
to yal...@googlegroups.com
Thank you for your quick reply.
I'll take a look at smallblkdim option again.
Thank you for your information.

Best regards,
Noboru

Johan Löfberg

unread,
Nov 3, 2013, 4:48:55 AM11/3/13
to yal...@googlegroups.com
You are already using the smallblkdim to your favor (i.e., not setting it to zero), so there is nothing for you to do there. It cannot be used when YALMIP sets up the logdet problem, it will crash if you remove the part in the callsdpt340 where it forcefully sets it to zero. I have to rewrite other parts first, to make it work with logdet terms.
Reply all
Reply to author
Forward
0 new messages