protected double normQuick(SparseDoubleMatrix1D v) { IntArrayList indexList = new IntArrayList(); DoubleArrayList valueList = new DoubleArrayList(); v.getNonZeros(indexList, valueList); double norm = 0.0; for (int i = 0; i < valueList.size(); ++i) { norm += valueList.get(i) * valueList.get(i); } return norm; }