Here you can find the source of getNonNullVectors(int[][] usageM)
public static int[][] getNonNullVectors(int[][] usageM)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static int[][] getNonNullVectors(int[][] usageM) { List<int[]> nonNullVectors = new ArrayList<int[]>(); for (int[] v : usageM) { boolean isNull = true; for (int i = 0; i < v.length; i++) if (v[i] > 0) isNull = false;// w w w. j a v a 2 s .com if (!isNull) nonNullVectors.add(v); } int[][] newUsageM = new int[nonNullVectors.size()][]; for (int i = 0; i < newUsageM.length; i++) { newUsageM[i] = nonNullVectors.get(i); } return newUsageM; } }