Repository: sympy/sympy

Issue:
Implementation of infinity norm for matrices
The current _**norm()**_ method of the MatrixBase class doesn't have the implementation of infinity norm. 

Discussion:
RavicharanN: Sure, I'll make the changes
RavicharanN: @normalhuman Can you please review it now?
normalhuman: The table of norms in the docstring of the method should have an entry for oo norm: see the line 3381. 

Patch:
diff --git a/sympy/matrices/matrices.py b/sympy/matrices/matrices.py
index 91611b8c08..8456c05a38 100644
--- a/sympy/matrices/matrices.py
+++ b/sympy/matrices/matrices.py
@@ -3378,7 +3378,7 @@ def norm(self, ord=None):
         =====  ============================  ==========================
         None   Frobenius norm                2-norm
         'fro'  Frobenius norm                - does not exist
-        inf    --                            max(abs(x))
+        inf    maximum row sum               max(abs(x))
         -inf   --                            min(abs(x))
         1      maximum column sum            as below
         -1     --                            as below
@@ -3406,6 +3406,8 @@ def norm(self, ord=None):
         0
         >>> A.norm() # Frobenius Norm
         2
+        >>> A.norm(oo) # Infinity Norm
+        2
         >>> Matrix([1, -2]).norm(oo)
         2
         >>> Matrix([-1, 2]).norm(-oo)
@@ -3452,6 +3454,10 @@ def norm(self, ord=None):
                 # Minimum singular value
                 return Min(*self.singular_values())
 
+            elif ord == S.Infinity:   # Infinity Norm - Maximum row sum
+                m = self.applyfunc(abs)
+                return Max(*[sum(m.row(i)) for i in range(m.rows)])
+
             elif (ord is None or isinstance(ord,
                                             string_types) and ord.lower() in
                 ['f', 'fro', 'frobenius', 'vector']):


Test patch:
diff --git a/sympy/matrices/tests/test_matrices.py b/sympy/matrices/tests/test_matrices.py
index ed4924b733..5f4bbb5d3c 100644
--- a/sympy/matrices/tests/test_matrices.py
+++ b/sympy/matrices/tests/test_matrices.py
@@ -2131,6 +2131,7 @@ def test_matrix_norm():
     assert A.norm(-2) == 0
     assert A.norm('frobenius') == 2
     assert eye(10).norm(2) == eye(10).norm(-2) == 1
+    assert A.norm(oo) == 2
 
     # Test with Symbols and more complex entries
     A = Matrix([[3, y, y], [x, S(1)/2, -pi]])