Home > source > @penlab > setpentype.m

# setpentype

## PURPOSE

Set index sets assigning constraint numbers to the type of constraint

## SYNOPSIS

function []=setpentype(obj,lbxbar,ubxbar,lbYbar,ubYbar)

## DESCRIPTION

     Set index sets assigning constraint numbers to the type of constraint
     penalization (which penalty function is used for each inequality).
     By default, penalty-barrier and reciprocal penalty are used for function
     and matrix constraints, respectively. Constraints using log-barrier need
     to be explicitely named in *Ybar arrays.

## CROSS-REFERENCE INFORMATION

This function calls:

This function is called by:

- penlab PenLab (Pennon Laboratory for Matlab, previously PennonM)

## SOURCE CODE

    0001 % Set index sets assigning constraint numbers to the type of constraint
    0002 % penalization (which penalty function is used for each inequality).
    0003 % By default, penalty-barrier and reciprocal penalty are used for function
    0004 % and matrix constraints, respectively. Constraints using log-barrier need
    0005 % to be explicitely named in *Ybar arrays.
    0006 function []=setpentype(obj,lbxbar,ubxbar,lbYbar,ubYbar)
    0007
    0008   [ignore, indbar, ignore2] = intersect((obj.xboxmap.*obj.xboxmlt)',[-lbxbar,ubxbar]);
    0009   obj.xboxindbar = indbar;
    0010   obj.xboxindphi = setdiff([1:obj.Nxbox],indbar);
    0011   %obj.xboxindbar = [1:obj.Nxbox];
    0012   %obj.xboxindphi = [];
    0013
    0014   %obj.ineqindbar = []; % will not use
    0015   obj.ineqindphi = [1:obj.Nineq];
    0016
    0017   [ignore, indbar, ignore2] = intersect((obj.Yboxmap.*obj.Yboxmlt)',[-lbYbar,ubYbar]);
    0018   obj.Yboxindbar = indbar;
    0019   obj.Yboxindphi = setdiff([1:obj.NYbox],indbar);
    0020   %obj.Yboxindphi = [1:obj.NYbox];
    0021
    0022   %obj.Aindbar = [];   % will not use at all
    0023   obj.Aindphi = [1:obj.NA];
    0024
    0025