5 deleted 2 characters in body edited Oct 2 '17 at 10:58 kglr 218k1010 gold badges248248 silver badges499499 bronze badges For the version of the question before Edit 2: m = Range[0, 5]; a = -Range[15]; Pick[m, NonPositive[Max[# + a - 1] & /@ m]] (* or Select[m, NonPositive[Max[# + a - 1]]&] *)  {0, 1, 2} Update: For the general case, with M and A as in OP's Edit 2, simply change # + a -1 to #.Transpose[A] - 1: Pick[M, NonPositive[Max[#.Transpose[A] - 1]& /@ M]] (* or Pick[M, UnitStep[1 - Max[#.Transpose[A]]] & /@ M, 1] *) (* or Select[M, NonPositive[Max[#.Transpose[A] - 1]]&] *)  all give {{0,0,0,1}, {-(1/2),-(1/2),-(1/2),1/2}, {-(1/2),1/2,1/2,1/2}, {1/2,-(1/2),1/2,1/2}, <<9>>, {-(1/2),1/2,-(1/2),-(1/2)}, {1/2,-(1/2),-(1/2),-(1/2)}, {0,0,0,-1}} For the version of the question before Edit 2: m = Range[0, 5]; a = -Range[15]; Pick[m, NonPositive[Max[# + a - 1] & /@ m]] (* or Select[m, NonPositive[Max[# + a - 1]]&] *)  {0, 1, 2} Update: For the general case, with M and A as in OP's Edit 2, simply change # + a -1 to #.Transpose[A] - 1: Pick[M, NonPositive[Max[#.Transpose[A] - 1]& /@ M]] (* or Pick[M, UnitStep[1 - Max[#.Transpose[A]]] & /@ M, 1] *) (* or Select[M, NonPositive[Max[#.Transpose[A] - 1]]&] *)  {{0,0,0,1}, {-(1/2),-(1/2),-(1/2),1/2}, {-(1/2),1/2,1/2,1/2}, {1/2,-(1/2),1/2,1/2}, <<9>>, {-(1/2),1/2,-(1/2),-(1/2)}, {1/2,-(1/2),-(1/2),-(1/2)}, {0,0,0,-1}} For the version of the question before Edit 2: m = Range[0, 5]; a = -Range[15]; Pick[m, NonPositive[Max[# + a - 1] & /@ m]] (* or Select[m, NonPositive[Max[# + a - 1]]&] *)  {0, 1, 2} Update: For the general case, with M and A as in OP's Edit 2, simply change # + a -1 to #.Transpose[A] - 1: Pick[M, NonPositive[Max[#.Transpose[A] - 1]& /@ M]] Pick[M, UnitStep[1 - Max[#.Transpose[A]]] & /@ M, 1] Select[M, NonPositive[Max[#.Transpose[A] - 1]]&]  all give {{0,0,0,1}, {-(1/2),-(1/2),-(1/2),1/2}, {-(1/2),1/2,1/2,1/2}, {1/2,-(1/2),1/2,1/2}, <<9>>, {-(1/2),1/2,-(1/2),-(1/2)}, {1/2,-(1/2),-(1/2),-(1/2)}, {0,0,0,-1}} 4 added 69 characters in body edited Oct 2 '17 at 9:42 kglr 218k1010 gold badges248248 silver badges499499 bronze badges For the version of the question before Edit 2: m = Range[0, 5]; a = -Range[15]; Pick[m, NonPositive[Max[# + a - 1] & /@ m]] (* or Select[m, NonPositive[Max[# + a - 1]]&] *)  {0, 1, 2} Update: For the general case, with M and A as in OP's Edit 2, simply change # + a -1 to #.Transpose[A] - 1: Pick[M, NonPositive[Max[#.Transpose[A] - 1]& /@ M]] (* or Pick[M, UnitStep[1 - Max[#.Transpose[A]]] & /@ M, 1] *) (* or Select[M, NonPositive[Max[#.Transpose[A] - 1]]&] *)  {{0,0,0,1}, {-(1/2),-(1/2),-(1/2),1/2}, {-(1/2),1/2,1/2,1/2}, {1/2,-(1/2),1/2,1/2}, <<9>>, {-(1/2),1/2,-(1/2),-(1/2)}, {1/2,-(1/2),-(1/2),-(1/2)}, {0,0,0,-1}} For the version of the question before Edit 2: m = Range[0, 5]; a = -Range[15]; Pick[m, NonPositive[Max[# + a - 1] & /@ m]] (* or Select[m, NonPositive[Max[# + a - 1]]&] *)  {0, 1, 2} Update: For the general case, with M and A as in OP's Edit 2, simply change # + a -1 to #.Transpose[A] - 1: Pick[M, NonPositive[Max[#.Transpose[A] - 1]& /@ M]] (* or Select[M, NonPositive[Max[#.Transpose[A] - 1]]&] *)  {{0,0,0,1}, {-(1/2),-(1/2),-(1/2),1/2}, {-(1/2),1/2,1/2,1/2}, {1/2,-(1/2),1/2,1/2}, <<9>>, {-(1/2),1/2,-(1/2),-(1/2)}, {1/2,-(1/2),-(1/2),-(1/2)}, {0,0,0,-1}} For the version of the question before Edit 2: m = Range[0, 5]; a = -Range[15]; Pick[m, NonPositive[Max[# + a - 1] & /@ m]] (* or Select[m, NonPositive[Max[# + a - 1]]&] *)  {0, 1, 2} Update: For the general case, with M and A as in OP's Edit 2, simply change # + a -1 to #.Transpose[A] - 1: Pick[M, NonPositive[Max[#.Transpose[A] - 1]& /@ M]] (* or Pick[M, UnitStep[1 - Max[#.Transpose[A]]] & /@ M, 1] *) (* or Select[M, NonPositive[Max[#.Transpose[A] - 1]]&] *)  {{0,0,0,1}, {-(1/2),-(1/2),-(1/2),1/2}, {-(1/2),1/2,1/2,1/2}, {1/2,-(1/2),1/2,1/2}, <<9>>, {-(1/2),1/2,-(1/2),-(1/2)}, {1/2,-(1/2),-(1/2),-(1/2)}, {0,0,0,-1}} 3 added 403 characters in body edited Oct 2 '17 at 9:31 kglr 218k1010 gold badges248248 silver badges499499 bronze badges For the version of the question before Edit 2: m = Range[0, 5]; a = -Range[15]; Pick[m, NonPositive[Max[# + a - 1] & /@ m]] (* or Select[m, NonPositive[Max[# + a - 1] &]1]]&] *)  {0, 1, 2} Update: For the general case, with M and A as in OP's Edit 2, simply change # + a -1 to #.Transpose[A] - 1: Pick[M, NonPositive[Max[#.Transpose[A] - 1]& /@ M]] (* or Select[M, NonPositive[Max[#.Transpose[A] - 1]]&] *)  {{0,0,0,1}, {-(1/2),-(1/2),-(1/2),1/2}, {-(1/2),1/2,1/2,1/2}, {1/2,-(1/2),1/2,1/2}, <<9>>, {-(1/2),1/2,-(1/2),-(1/2)}, {1/2,-(1/2),-(1/2),-(1/2)}, {0,0,0,-1}} For the version of the question before Edit 2: m = Range[0, 5]; a = -Range[15]; Pick[m, NonPositive[Max[# + a - 1] & /@ m]] (* or Select[m, NonPositive[Max[# + a - 1] &] *)  {0, 1, 2} For the version of the question before Edit 2: m = Range[0, 5]; a = -Range[15]; Pick[m, NonPositive[Max[# + a - 1] & /@ m]] (* or Select[m, NonPositive[Max[# + a - 1]]&] *)  {0, 1, 2} Update: For the general case, with M and A as in OP's Edit 2, simply change # + a -1 to #.Transpose[A] - 1: Pick[M, NonPositive[Max[#.Transpose[A] - 1]& /@ M]] (* or Select[M, NonPositive[Max[#.Transpose[A] - 1]]&] *)  {{0,0,0,1}, {-(1/2),-(1/2),-(1/2),1/2}, {-(1/2),1/2,1/2,1/2}, {1/2,-(1/2),1/2,1/2}, <<9>>, {-(1/2),1/2,-(1/2),-(1/2)}, {1/2,-(1/2),-(1/2),-(1/2)}, {0,0,0,-1}} 2 added 50 characters in body edited Oct 2 '17 at 1:54 kglr 218k1010 gold badges248248 silver badges499499 bronze badges Post Undeleted by kglr occurred Oct 2 '17 at 1:52 Post Deleted by kglr occurred Oct 2 '17 at 1:52 1 answered Oct 2 '17 at 1:49 kglr 218k1010 gold badges248248 silver badges499499 bronze badges