# 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 Faster routines for double precision entries from `RDF` or `CDF` are provided by the :class:`~sage.matrix.matrix_double_dense.Matrix_double_dense` class.  :: sage: A = matrix(RR, 2, 3, [3*I,4,1-I,1,2,0]) sage: A = matrix(CC, 2, 3, [3*I,4,1-I,1,2,0]) sage: A.norm('frob') 5.65685424949 sage: A.norm(2)
• ## sage/matrix/matrix_double_dense.pyx

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

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