Home > source > @penlab > disp.m

# disp

## PURPOSE

overloading default disp()

## SYNOPSIS

function disp(obj)

## DESCRIPTION

     overloading default disp()

## CROSS-REFERENCE INFORMATION

This function calls:

This function is called by:

- logfile open/close log file based on option settings (in obj.allopts)
- penlab PenLab (Pennon Laboratory for Matlab, previously PennonM)
- print Publisher (printing manager) for PenLab

## SOURCE CODE

    0001 % overloading default disp()
    0002 function disp(obj)
    0003
    0004   fprintf('%s problem object\n',penlab.solvername)
    0005   fprintf('  Problem name: %s\n',obj.probname);
    0006   if (~isempty(obj.comment))
    0007     fprintf('  Description:  %s\n',obj.comment);
    0008   end
    0009   switch(obj.phase)
    0010     case 0  % empty
    0011       str = 'problem hasn''t been loaded yet';
    0012     case 1  % init
    0013       str = 'problem initialized and loaded';
    0014     case 2  % solving
    0015       str = 'problem is being solved right now';
    0016     case 3  % finished
    0017       str = 'solver finished';
    0018     otherwise
    0019       str = sprintf('unnamed phase: %i',obj.phase);
    0020   end
    0021   fprintf('  Phase:        %s\n\n', str);
    0022
    0023   if (obj.phase>0)
    0024     nNLNineq=sum(obj.ineqmap<=obj.NgNLN);
    0025     nNLNeq=sum(obj.eqmap<=obj.NgNLN);
    0026     nNLNAineq=sum(obj.Amap<=obj.NANLN);
    0027     fprintf('                              normal    mvars (m.elems)\n');
    0028     fprintf('  Number of variables        %7d  %7d (%7d)\n',obj.Nx, obj.NY, obj.NYnnz);
    0029     fprintf('                                 box   linear   nonlin\n');
    0030     fprintf('  (Function) inequalities    %7d  %7d  %7d\n',obj.Nxbox,obj.Nineq-nNLNineq,nNLNineq);
    0031     fprintf('  (Function) equalities               %7d  %7d\n',obj.Neq-nNLNeq, nNLNeq);
    0032     fprintf('  Matrix     inequalities    %7d  %7d  %7d\n',obj.NYbox,obj.NA-nNLNAineq,nNLNAineq);
    0033   end
    0034
    0035
    0036   if (obj.phase>=2)
    0037     if (obj.phase<3)
    0038       fprintf('\n  Optimality meassures in the last completed iteration:\n');
    0039     else
    0040       fprintf('\n  Optimality meassures in the final iteration:\n');
    0041     end
    0042     fprintf('  Objective                %27.16E\n',obj.objx);
    0043     fprintf('  Relative precision       %27.16E\n',abs(obj.ALx-obj.objx)/max(1,obj.objx));
    0044     fprintf('  Compl. Slackness         %27.16E\n',obj.rCompl);
    0045     fprintf('  Grad augm. lagr.         %27.16E\n',obj.rNormG);
    0046     fprintf('  Feasibility              %27.16E\n',obj.rFeas);
    0047     fprintf('  Minimal penalty          %27.16E\n',min([obj.pxbox;obj.pineq]));
    0048
    0049     fprintf('  Newton steps                                   %5d\n',obj.miter);
    0050     fprintf('  Inner steps                                    %5d\n',obj.initer);
    0051     fprintf('  Linesearch steps                               %5d\n',obj.lsiter);
    0052     %fprintf('  Time statistics:\n');
    0053     %fprintf('     - total process time             %14g s\n',obj.stats_time_total);
    0054     %fprintf('     - all minimization steps         %14g s\n',obj.stats_time_miters);
    0055     %fprintf('     - all factorizations             %14g s\n',obj.stats_time_fact);
    0056     %fprintf('     - function values evaluation     %14g s\n',obj.stats_time_alx);
    0057     %fprintf('     - gradient values evaluation     %14g s\n',obj.stats_time_aldx);
    0058     %fprintf('     - hessian values evaluation      %14g s\n',obj.stats_time_alddx);
    0059   end
    0060
    0061 end