Skip to content

Commit

Permalink
Clean up of old CVS headers, inconsistent function headers and dead code
Browse files Browse the repository at this point in the history
Thanks to Robertgj for finding the issues
  • Loading branch information
johanlofberg committed Apr 23, 2021
1 parent 54b8290 commit c2d45a6
Show file tree
Hide file tree
Showing 68 changed files with 41 additions and 374 deletions.
3 changes: 0 additions & 3 deletions @sdpvar/any.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
function anys = any(x)
%ANY (overloaded)

% Author Johan Löfberg
% $Id: any.m,v 1.2 2006-07-26 20:17:57 joloef Exp $

x_base = x.basis;
anys = full(sum(abs(x.basis),2)>0);
anys = reshape(anys,x.dim(1),x.dim(2));
2 changes: 1 addition & 1 deletion @sdpvar/domain.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Y=plot(varargin)
function Y=domain(varargin)
%DOMAIN Extract domain for PWA variable

% Fast version for plotting simple PWA objects
Expand Down
2 changes: 0 additions & 2 deletions @sdpvar/poly.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
%
% See also DET

% Author Anders Helmersson, Johan Löfberg

[n, m] = size (A);
if n ~= m, error ('A must be square'); end;

Expand Down
2 changes: 1 addition & 1 deletion @sdpvar/sumsum.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Y=sum(Y)
function Y=sumsum(Y)
%SUM (overloaded)

Y.basis = sum(Y.basis,1);
Expand Down
2 changes: 1 addition & 1 deletion @sdpvar/variablereplace.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function y = replace(y,oldVar,newVar)
function y = variablereplace(y,oldVar,newVar)

var = y.lmi_variables;

Expand Down
3 changes: 0 additions & 3 deletions extras/@lmi/chebyball.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
% If only one output is requested, only the symbolic constraint is returned
% C = chebyball(F)

% Author Johan Löfberg
% $Id: chebyball.m,v 1.1 2004-12-08 00:07:15 johanl Exp $

[model,recoverdata,diagnostic,p] = export(F,[],[],[],[],0);
if p.K.q(1) > 0 | p.K.s(1) > 0 | any(p.variabletype) | ~isempty(p.binary_variables) | ~isempty(p.integer_variables)
error('Polytope can only be applied to linear elementwise constraints.')
Expand Down
3 changes: 0 additions & 3 deletions extras/@lmi/constraintclass.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
function LIST = constraintclass(F,property)
%CONSTRAINTCLASS Returns a list describing the constraints

% Author Johan Löfberg
% $Id: constraintclass.m,v 1.2 2005-02-04 10:10:26 johanl Exp $

F = flatten(F);
if isempty(F.clauses)
LIST = [];
Expand Down
2 changes: 0 additions & 2 deletions extras/@lmi/envelope.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
% plot(E,[x;u],[],[],sdpsettings('relax',1))
% xx = (-1:0.01:1);hold on;plot(xx,xx+sin(pi*xx),xx,4-xx.^2)

% Author Johan Löfberg

[aux1,aux2,aux3,p] = export(C,[],sdpsettings('solver','bmibnb'));

if isempty(p)
Expand Down
6 changes: 3 additions & 3 deletions extras/@lmi/sizeOLD.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
function varargout=size(varargin)
function varargout=sizeOLD(varargin)
%size Returns the number of inequalities and equalities
%
% n = SIZE(F) Returns the number of inequalities
% [n,m] = SIZE(F) Returns the number of inequalities and equalities
% n = SIZEOLD(F) Returns the number of inequalities
% [n,m] = SIZEOLD(F) Returns the number of inequalities and equalities
%
% See also LMI, ADDLMI

Expand Down
37 changes: 0 additions & 37 deletions extras/@logdet/minus.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,40 +47,3 @@
Z.P = {Alog{:},Blog{:}};
Z.gain = [Again -Bgain];

% function Z = minus(cx,P)
% %display Overloaded
%
% % Author Johan Löfberg
% % $Id: minus.m,v 1.4 2007-02-07 09:11:27 joloef Exp $
%
% % Standard case c't-logdet(P)
%
% if isa(P,'logdet') % sdpvr - logdet
%
% if prod(size(cx))>1
% error('Only scalar terms can be added to a logdet term');
% end
%
% if isa(cx,'logdet')
% error('Logdet objects can only be added');
% end
%
% Z = P;
% if isempty(P.cx)
% Z.cx = cx;
% else
% Z.cx = cx-P.cx;
% end
% Z.gain = -Z.gain;
% else % logdet - cx
% temp = cx;
% cx = P;
% P = temp;
%
% Z = P;
% if isempty(P.cx)
% Z.cx = -cx;
% else
% Z.cx = P.cx-cx;
% end
% end
31 changes: 0 additions & 31 deletions extras/@logdet/plus.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,34 +46,3 @@

Z.P = {Alog{:},Blog{:}};
Z.gain = [Again Bgain];

% function Z = plus(X,Y)
% %display Overloaded
%
% % Author Johan Löfberg
% % $Id: plus.m,v 1.5 2007-02-07 09:11:27 joloef Exp $
%
% % LOGDET + SDPVAR
% if isa(Y,'logdet')
% Z = X;
% X = Y;
% Y = Z;
% end
%
% if prod(size(Y))>1
% error('Only scalar terms can be added to a logdet term');
% end
%
% if isa(Y,'logdet')
% Z = X;
% Z.P = {Z.P{:},Y.P{:}};%blkdiag(Z.P,Y.P);
% Z.gain = [X.gain Y.gain];
% return
% end
%
% Z = X;
% if isempty(Z.cx)
% Z.cx = Y;
% else
% Z.cx = plus(Z.cx,Y);
% end
3 changes: 0 additions & 3 deletions extras/@ncvar/integer.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,5 @@
%
% See also BINARY, SET, SDPVAR, INTVAR, BINVAR

% Author Johan Löfberg
% $Id: integer.m,v 1.1 2006-08-10 18:00:20 joloef Exp $

x.typeflag = 7;
x = lmi(x);
2 changes: 1 addition & 1 deletion extras/RecoverNonlinearSolverSolution.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function x = RecoverNonlinearSolversolution(model,xout);
function x = RecoverNonlinearSolverSolution(model,xout);

if isempty(model.nonlinearindicies)
x = xout(:);
Expand Down
2 changes: 1 addition & 1 deletion extras/addExponentialCone.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function [data,cones,output] = adExponentialCone(data,cones,model)
function [data,cones,output] = addExponentialCone(data,cones,model)

output.problem = 0;
if ~isempty(model.evalMap)
Expand Down
4 changes: 0 additions & 4 deletions extras/bmilin.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
% bmilin.maxiterls - Maximum number of iterations in line search [integer (10)]
% bmilin.maxiter - Maximum number of iterations [integer (25)]

% Author Johan Löfberg
% $Id: bmilin.m,v 1.3 2005-04-29 08:05:01 joloef Exp $


disp('***********************************************')
disp('')
disp('Warning : This code is still under development')
Expand Down
11 changes: 0 additions & 11 deletions extras/compressfactors2.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
function [constants,general,newsingles,newpairs] = compressfactors2(constants,general,singles,pairs)

% Author Johan Löfberg
% $Id: compressfactors2.m,v 1.1 2009-11-03 10:30:33 joloef Exp $

newpairs = {};
taken = zeros(1,length(pairs));
for i = 1:length(pairs)
Expand All @@ -13,14 +10,6 @@

if ~taken(i)
for j = i+1:length(pairs)
% if ~isequal(pairs{i}.M,pairs{j}.M)
% if isequal(pairs{i}.M,pairs{j}.M',1)
% pairs{j}.M = pairs{i}.M;
% temp = pairs{j}.L;
% pairs{j}.L = pairs{j}.R';
% pairs{j}.R = temp';
% end
% end
if isequal(pairs{i}.M,pairs{j}.M,1)
if isequal(pairs{i}.L,pairs{j}.L)
Lsameas = [Lsameas j];
Expand Down
2 changes: 1 addition & 1 deletion extras/findulb_interval.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function [lb,ub,cand_rows] = findulb(F_struc,K)
function [lb,ub,cand_rows] = findulb_interval(F_struc,K)
%FINDULB Internal function to extract upper and lower variable bounds

% special code for the interval data case, to avoid overhead in the default
Expand Down
2 changes: 1 addition & 1 deletion extras/fmincon_funhessian.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function H = fmincon_fun(x,params,what)
function H = fmincon_funhessian(x,params,what)

xevaled = zeros(1,length(params.interfacedata.c));
xevaled(params.linearindicies) = x;
Expand Down
150 changes: 0 additions & 150 deletions extras/matrixcoefficients.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,153 +100,3 @@
end
p_base_parametric = stackcell(sdpvar(1,1),xx)';
end



%
%
%
%
%
% function [base,v] = coefficients(p,x)
% %COEFFICIENTS Extract coefficients and monomials from polynomials
% %
% % [c,v] = COEFFICIENTS(p,x) extracts the coefficents
% % of a polynomial p(x) = c'*v(x)
% %
% % INPUT
% % p : SDPVAR object
% % x : SDPVAR object
% %
% % OUTPUT
% % c : SDPVAR object
% % v : SDPVAR object
% %
% % EXAMPLE
% % sdpvar x y s t
% % p = x^2+x*y*(s+t)+s^2+t^2; % define p(x,y), parameterized with s and t
% % [c,v] = coefficients(p,[x y]);
% % sdisplay([c v])
% %
% % See also SDPVAR
%
% % Author Johan Löfberg
% % $Id: matrixcoefficients.m,v 1.4 2006-08-09 12:14:04 joloef Exp $
%
%
% if length(p) > 1%size(p,2) > 1
% error('Coefficents can only be applied to column vectors');
% end
%
% allvar = depends(p);
% if nargin==1
% xvar = allvar;
% x = recover(xvar);
% else
% xvar = depends(x);
% end
%
% pvar = recover(depends(p));
%
% base = [];
% for i = 1:length(p)
% [bi{i},vi{i}] = coefficientsi(p(i),xvar,pvar,allvar);
% end
%
% % Fix the lengths of the basis to use same basis for all elements
% if length(bi)>1
% allvars = [];
% for i = 1:length(bi)
% bivar{i} = getvariables(vi{i});
% if isequal(vi{i}(1),1)
% bivar{i} = [0 bivar{i}];
% end
% allvars = unique([allvars bivar{i}]);
% end
% v = recover(allvars);
% c = zeros(length(p),length(allvars))';
% ci = [];
% cj = [];
% cv = [];
% for i = 1:length(bi)
% index = find(ismember(allvars,bivar{i}));
% ci = [ci index];
% cj = [cj repmat(i,1,length(index))];
% cv = [cv bi{i}'];
% end
% base = sparse(ci,cj,cv);
% else
% base = bi{1};
% v = vi{1};
% end
%
%
% function [base,v] = coefficientsi(p,xvar,pvar,allvar)
%
% % Try to debug this!
% t = setdiff(allvar,xvar);
% [exponent_p,p_base] = getexponentbase(p,pvar);
% ParametricIndicies = find(ismember(allvar,t));
% % FIX : don't define it here, wait until sparser below. Speed!!
% tempbase = parameterizedbase(p,[],recover(t),ParametricIndicies,exponent_p,p_base);
% [i,j,k] = unique(full(exponent_p(:,find(~ismember(allvar,t)))),'rows');
% %V = sparse(max(k),length(tempbase));
% %for i = 1:max(k)
% % V(i,find(k==i)) = 1;
% %end
% V = sparse(1:length(k),k,1,length(tempbase),max(k))';
% base = V*tempbase;
% if nargout == 2
% keepthese = j(1:max(k));
% v = recovermonoms(exponent_p(keepthese,find(~ismember(allvar,t))),recover(xvar));
% end
%
%
% function p_base_parametric = parameterizedbase(p,z, params,ParametricIndicies,exponent_p,p_base)
%
% % Check for linear parameterization
% parametric_basis = exponent_p(:,ParametricIndicies);
% if all(sum(parametric_basis,2)==0)
% p_base_parametric = full(p_base(:));
% return
% end
% if all(sum(parametric_basis,2)<=1)
% p_base_parametric = full(p_base(:));
% n = length(p_base_parametric);
% ii = [];
% vars = [];
% js = sum(parametric_basis,1);
% for i = 1:size(parametric_basis,2)
% if js(i)
% j = find(parametric_basis(:,i));
% ii = [ii j(:)'];
% vars = [vars repmat(i,1,js(i))];
% end
% end
% k = setdiff1D(1:n,ii);
% if isempty(k)
% p_base_parametric = p_base_parametric.*sparse(ii,repmat(1,1,n),params(vars));
% else
% pp = params(vars); % Must do this, bug in ML 6.1 (x=sparse(1);x([1 1]) gives different result in 6.1 and 7.0!)
% p_base_parametric = p_base_parametric.*sparse([ii k(:)'],repmat(1,1,n),[pp(:)' ones(1,1,length(k))]);
% end
% else
% % Bummer, nonlinear parameterization sucks...
% for i = 1:length(p_base)
% j = find(exponent_p(i,ParametricIndicies));
% if ~isempty(j)
% temp = p_base(i);
% for k = 1:length(j)
% if exponent_p(i,ParametricIndicies(j(k)))==1
% temp = temp*params(j(k));
% else
% temp = temp*params(j(k))^exponent_p(i,ParametricIndicies(j(k)));
% end
% end
% xx{i} = temp;
% else
% xx{i} = p_base(i);
% end
% end
% p_base_parametric = stackcell(sdpvar(1,1),xx)';
% end
2 changes: 1 addition & 1 deletion extras/pennlp_conhess.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function [nnz, row, col, val] = pennlp_fun(i,x)
function [nnz, row, col, val] = pennlp_conhess(i,x)

try
H = datasaver(6,x,i+1);
Expand Down
2 changes: 1 addition & 1 deletion extras/pennonm_callback_f.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function f = ipopt_callback_f(x,model_in)
function f = pennonm_callback_f(x,model_in)

global latest_x
global latest_df
Expand Down
2 changes: 1 addition & 1 deletion extras/plotInternalModel.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function x_opt = PlotInternalModel(internalmodel,x,n,localindex,color,opts)
function x_opt = plotInternalModel(internalmodel,x,n,localindex,color,opts)
% Code used by both lmi/plot and optimizer/plot

if isempty(internalmodel.binary_variables)
Expand Down
Loading

0 comments on commit c2d45a6

Please sign in to comment.