01 /*
02 * $Id: ListCompareElements2.java,v 1.8 2006/08/18 06:46:32 koga Exp $
03 *
04 * Copyright (C) 2004 Koga Laboratory. All rights reserved.
05 *
06 */
07 package matxbook.chap18;
08
09 import org.mklab.nfc.matrix.BooleanMatrix;
10 import org.mklab.nfc.matx.MatxList;
11
12
13 /**
14 * @author koga
15 * @version $Revision: 1.8 $, 2004/04/21
16 */
17 public class ListCompareElements2 {
18
19 /**
20 * メインメソッド
21 *
22 * @param args コマンドライン引数
23 */
24 @SuppressWarnings("nls")
25 public static void main(String[] args) {
26 int[] aa = new int[] {1, 2, 3, 4, 5, 6, 7};
27 int[] bb = new int[] {0, 3, 5, 3, 3, 6, 8};
28 MatxList a = new MatxList(7);
29 MatxList b = new MatxList(7);
30 for (int i = 0; i < 7; i++) {
31 a.set(i + 1, aa[i]);
32 b.set(i + 1, bb[i]);
33 }
34 BooleanMatrix bm = a.compareElementWise(b, ".<");
35 MatxList c = a.getSubList(bm.find());
36 c.print("a(a .< b)");
37 }
38 }
|