Ticket #10837: trac_10837-norms-condition-CDF-edits.patch

File trac_10837-norms-condition-CDF-edits.patch, 2.4 KB (added by Rob Beezer, 12 years ago)
  • sage/matrix/matrix2.pyx

    # HG changeset patch
    # User Rob Beezer <beezer@ups.edu>
    # Date 1298569016 28800
    # Node ID a54097b0f5e7357139a6800d57dcf48b483b0a1e
    # Parent  5c31405d7399ff39fbf5cc3cdb966c0793704908
    10837: norms, condition number edits
    
    diff -r 5c31405d7399 -r a54097b0f5e7 sage/matrix/matrix2.pyx
    a b  
    68586858        Faster routines for double precision entries from `RDF` or `CDF` are provided by
    68596859        the :class:`~sage.matrix.matrix_double_dense.Matrix_double_dense` class.  ::
    68606860       
    6861             sage: A = matrix(RR, 2, 3, [3*I,4,1-I,1,2,0])
     6861            sage: A = matrix(CC, 2, 3, [3*I,4,1-I,1,2,0])
    68626862            sage: A.norm('frob')
    68636863            5.65685424949
    68646864            sage: A.norm(2)
  • sage/matrix/matrix_double_dense.pyx

    diff -r 5c31405d7399 -r a54097b0f5e7 sage/matrix/matrix_double_dense.pyx
    a b  
    703703                p = sage.rings.integer.Integer(p)
    704704            except:
    705705                raise ValueError("condition number 'p' must be +/- infinity, 'frob' or an integer, not %s" % p)
    706             if not p in [-2,-1,1,2]:
     706            if p not in [-2,-1,1,2]:
    707707                raise ValueError("condition number integer values of 'p' must be -2, -1, 1 or 2, not %s" % p)
    708708        # may raise a LinAlgError if matrix is singular
    709709        c = numpy.linalg.cond(self._matrix_numpy, p=p)
     
    809809            sage: abs(f-s) < 1.0e-12
    810810            True
    811811
    812         Return values are in `RDF`.
     812        Return values are in `RDF`. ::
    813813
    814814            sage: A = matrix(CDF, 2, range(4))
    815815            sage: A.norm() in RDF
  • sage/modules/vector_double_dense.pyx

    diff -r 5c31405d7399 -r a54097b0f5e7 sage/modules/vector_double_dense.pyx
    a b  
    585585
    586586        OUTPUT:
    587587
    588         Returned values is a double precision floating point value
    589         in ``RDF`` (or an integer when ``p=0``.  The default value
     588        Returned value is a double precision floating point value
     589        in ``RDF`` (or an integer when ``p=0``).  The default value
    590590        of ``p = 2`` is the "usual" Euclidean norm.  For other values:
    591591
    592592        - ``p = Infinity`` or ``p = oo``: the maximum of the