function N = get_nln_N(om, name)
%GET_NLN_N  Returns the number of non-linear constraints.
%   N = get_nln_N(om)       : total number of non-linear constraints
%   N = get_nln_N(om, name) : number of non-linear constraints in named set

%   MATPOWER
%   $Id: get_nln_N.m,v 1.3 2009/11/04 15:58:44 ray Exp $
%   by Ray Zimmerman, PSERC Cornell
%   Copyright (c) 2008 by Power System Engineering Research Center (PSERC)
%   See http://www.pserc.cornell.edu/matpower/ for more info.

if nargin < 2
    N = om.nln.N;
else
    if isfield(om.nln.idx.N, name)
        N = om.nln.idx.N.(name);
    else
        N = 0;
    end
end
