function indexes = BR_get_vtable(vtable,L1,L2,L3,c,parity,op)
% BR_get_table - find entries in vtable matching query
% On input:
%     vtable (kx7 array): variable table
%     L1 (int): if 0, no query, else literal value
%     L2 (int): if 0, no query, else literal value
%     L3 (int): if 0, no query, else literal value
%     c (int): if <1, no query, else clause number
%     parity (int): if <0, no query, else clause number
%     op (int): if <0, no query, else operator value
% On output:
%     indexes (px1 vector): indexes of matching entries
% Call:
%     BR_get_vtable(vtable,1,2,3,-1,-1,-1)
% Author:
%     T. Henderson
%     UU
%     Summer 2018
%

all_indexes = vtable(:,6);
if L1~=0
    indexes = intersect(all_indexes,find(vtable(:,1)==L1));
end
if L2~=0
    indexes = intersect(indexes,find(vtable(:,2)==L2));
end
if L3~=0
    indexes = intersect(indexes,find(vtable(:,3)==L3));
end
if c>0
    indexes = intersect(indexes,find(vtable(:,4)==c));
end
if parity>=0
    indexes = intersect(indexes,find(vtable(:,5)==parity));
end
if op>=0
    indexes = intersect(indexes,find(vtable(:,7)==op));
end
