function [idxv, idxl, idxn, idxc] = get_idx(om)
%GET_IDX  Returns the idx struct for vars, lin/nln constraints, costs.
%   idxv = get_idx(om)
%   [idxv, idxl] = get_idx(om)
%   [idxv, idxl, idxn] = get_idx(om)
%   [idxv, idxl, idxn, idxc] = get_idx(om)

%   MATPOWER
%   $Id: get_idx.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.

idxv = om.var.idx;
if nargout > 1
    idxl = om.lin.idx;
    if nargout > 2
        idxn = om.nln.idx;
        if nargout > 3
            idxc = om.cost.idx;
         end
    end
end
