Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/yalmip/YALMIP into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan Löfberg committed Aug 24, 2024
2 parents ea0ff80 + 1141b2e commit de4b306
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions @sdpvar/mtimes.m
Original file line number Diff line number Diff line change
Expand Up @@ -817,15 +817,21 @@
args = args.arg{1};
% Temporarily recast slog as log (slog is log(1+x))
if isequal(Y.extra.opname,'slog')
args = args + 1;
Y.extra.opname = 'log';
if nnz(getbasematrix(X,0))==0
% Not entropy but fits cross entropy
Z = -crossentropy(X,args + 1);
else
% Still hope for entropy
args = args + 1;
Y.extra.opname = 'log';
end
end
% Detect the case log(f)*(k*f), and rescale to k*log(f)*f
% to simplify comparison of function argument and outer argument
if isequal(X.dim,args.dim) && isequal(size(X.basis),size(args.basis))
[~,~,a] = find(X.basis);
[~,~,b] = find(args.basis);
if ~isequal(a,b)
if ~isequal(a,b) && all(size(a) == size(b))
c = a./b;
if all(abs(c-c(1))<=1e-13)
k = c(1);
Expand Down

0 comments on commit de4b306

Please sign in to comment.