Skip to content

Commit

Permalink
fix whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
dpo committed Mar 12, 2018
1 parent 4897b95 commit d663426
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions Formulations/K1x.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
sol
norm_A
end

methods (Abstract)
Solver(o)
end

methods
function o = K1x(slack, options)
o.diagHess = true;
end

function y = opK1y(x, ~)
t = o.A * x;
t = t ./ (o.d2.^2);
t = o.A' * t;
y = t + o.H * x;
end

function Solve_Newton(o)
%-----------------------------------------------------------------
% Solve (*) for dx.
Expand Down Expand Up @@ -50,21 +50,21 @@ function Solve_Newton(o)
if o.PDitns == 1
o.norm_A = normest(o.A, 1.0e-2);
end
if o.need_precon
o.precon = 1 ./ (o.norm_A^2 / o.d2^2 + 1./o.H);
o.precon = diag(sparse(o.precon));
end
if o.explicitA
o.M = o.A' * sparse(1:o.m, 1:o.m, 1 ./ (o.d2.^2), o.m, o.m) * o.A;
o.M = o.M + sparse(1:o.n, 1:o.n, o.H, o.n, o.n);
else
o.M = opFunction(o.m, o.m, @opK1y);
end
o.rhs = o.A' * (o.r1 ./ (o.d2.^2)) - w;
Solver(o);
o.dx = o.sol;
Expand Down
14 changes: 7 additions & 7 deletions Solvers/Cholesky.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
R
P
end

methods
function o = Cholesky(slack, options)
o.manage_op = false;
o.need_precon = false;
o.solver = ' Chol'; o.head3 = ' Chol';
end

function Print_param(o)
fprintf(o.file_id, '\n\nMethod = Cholesky\n');
end

function Init_param(~)
end

function Solver(o)

if o.PDitns==1, o.P = symamd(o.M); end % Do ordering only once.

[o.R, indef] = chol(o.M(o.P, o.P));
Expand All @@ -34,11 +34,11 @@ function Solver(o)
o.sol = o.R \ (o.R' \ o.rhs(o.P));
o.sol(o.P) = o.sol;
end

function Print_results(o)
if o.PDitns == 1, fprintf(o.file_id, ' %8g', nnz(o.R)); end
end

function Reset_param(~)
end
end
Expand Down

0 comments on commit d663426

Please sign in to comment.