# 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
|
|
6858 | 6858 | Faster routines for double precision entries from `RDF` or `CDF` are provided by |
6859 | 6859 | the :class:`~sage.matrix.matrix_double_dense.Matrix_double_dense` class. :: |
6860 | 6860 | |
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]) |
6862 | 6862 | sage: A.norm('frob') |
6863 | 6863 | 5.65685424949 |
6864 | 6864 | sage: A.norm(2) |
diff -r 5c31405d7399 -r a54097b0f5e7 sage/matrix/matrix_double_dense.pyx
a
|
b
|
|
703 | 703 | p = sage.rings.integer.Integer(p) |
704 | 704 | except: |
705 | 705 | 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]: |
707 | 707 | raise ValueError("condition number integer values of 'p' must be -2, -1, 1 or 2, not %s" % p) |
708 | 708 | # may raise a LinAlgError if matrix is singular |
709 | 709 | c = numpy.linalg.cond(self._matrix_numpy, p=p) |
… |
… |
|
809 | 809 | sage: abs(f-s) < 1.0e-12 |
810 | 810 | True |
811 | 811 | |
812 | | Return values are in `RDF`. |
| 812 | Return values are in `RDF`. :: |
813 | 813 | |
814 | 814 | sage: A = matrix(CDF, 2, range(4)) |
815 | 815 | sage: A.norm() in RDF |
diff -r 5c31405d7399 -r a54097b0f5e7 sage/modules/vector_double_dense.pyx
a
|
b
|
|
585 | 585 | |
586 | 586 | OUTPUT: |
587 | 587 | |
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 |
590 | 590 | of ``p = 2`` is the "usual" Euclidean norm. For other values: |
591 | 591 | |
592 | 592 | - ``p = Infinity`` or ``p = oo``: the maximum of the |