public double norm()
    {
        double sum = 0;

        for (int r = 0; r < nRows; ++r) {
            for (int c = 0; c < nCols; ++c) {
                double v = values[r][c];
                sum += v*v;
            }
        }

        return (double) Math.sqrt(sum);
    }
public double norm ( ) { double sum = 0 ; for ( int r = 0 ; r < nRows ; ++ r ) { for ( int c = 0 ; c < nCols ; ++ c ) { double v = values [ r ] [ c ] ; sum += v * v ; } } return ( double ) Math . sqrt ( sum ) ; }
Compute the Euclidean norm of this matrix.
@return the norm