function N = get_lin_N(om, name)
%GET_LIN_N  Returns the number of linear constraints.
%   N = get_lin_N(om)       : total number of linear constraints
%   N = get_lin_N(om, name) : number of linear constraints in named set

%   MATPOWER
%   $Id: get_lin_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.lin.N;
else
    if isfield(om.lin.idx.N, name)
        N = om.lin.idx.N.(name);
    else
        N = 0;
    end
end
