/** * Computes the infinity norm */ protected double normInf() { double[] columnSum = new double[numColumns]; for (MatrixEntry e : this) columnSum[e.column()] += Math.abs(e.get()); return max(columnSum); }
/** * Computes the 1 norm */ protected double norm1() { double[] rowSum = new double[numRows]; for (MatrixEntry e : this) rowSum[e.row()] += Math.abs(e.get()); return max(rowSum); }
/** * Computes the infinity norm */ protected double normInf() { double[] columnSum = new double[numColumns]; for (MatrixEntry e : this) columnSum[e.column()] += Math.abs(e.get()); return max(columnSum); }
/** * Computes the 1 norm */ protected double norm1() { double[] rowSum = new double[numRows]; for (MatrixEntry e : this) rowSum[e.row()] += Math.abs(e.get()); return max(rowSum); }
public double norm(Norm type) { if (type == Norm.One) return norm1(); else if (type == Norm.Frobenius) return normF(); else if (type == Norm.Infinity) return normInf(); else // Maxvalue return max(); }
public double norm(Norm type) { if (type == Norm.One) return norm1(); else if (type == Norm.Frobenius) return normF(); else if (type == Norm.Infinity) return normInf(); else // Maxvalue return max(); }