From 779389fb623926afc411587fdc43f69bf63808a6 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 15 Nov 2016 10:58:07 -0500 Subject: [PATCH] Use :math: in a few docstrings in the cones module. --- dunshire/cones.py | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/dunshire/cones.py b/dunshire/cones.py index bf873da..50c57e7 100644 --- a/dunshire/cones.py +++ b/dunshire/cones.py @@ -402,7 +402,7 @@ class IceCream(SymmetricCone): def ball_radius(self, point): - """ + r""" Return the radius of a ball around ``point`` in this cone. Since a radius cannot be negative, the ``point`` must be @@ -411,12 +411,12 @@ class IceCream(SymmetricCone): The minimum distance from ``point`` to the complement of this cone will always occur at its projection onto that set. It is not hard to see that the projection is at a "down and out" angle - of ``pi/4`` towards the outside of the cone. If one draws a + of :math:`\pi/4` towards the outside of the cone. If one draws a right triangle involving the ``point`` and that projection, it becomes clear that the distance between ``point`` and its - projection is a factor of ``1/sqrt(2)`` times the "horizontal" + projection is a factor of :math:`1/\sqrt(2)` times the "horizontal" distance from ``point`` to boundary of this cone. For simplicity - we take ``1/2`` instead. + we take :math:`1/2` instead. Parameters ---------- @@ -446,16 +446,17 @@ class IceCream(SymmetricCone): Examples -------- - The height of ``x`` is one (its first coordinate), and so the - radius of the circle obtained from a height-one cross section is - also one. Note that the last two coordinates of ``x`` are half - of the way to the boundary of the cone, and in the direction of - a 30-60-90 triangle. If one follows those coordinates, they hit - at ``(1, sqrt(3)/2, 1/2)`` having unit norm. Thus the - "horizontal" distance to the boundary of the cone is ``1 - - norm(x)``, which simplifies to ``1/2``. And rather than involve - a square root, we divide by two for a final safe radius of - ``1/4``. + The height of ``x`` below is one (its first coordinate), and so + the radius of the circle obtained from a height-one cross + section is also one. Note that the last two coordinates of ``x`` + are half of the way to the boundary of the cone, and in the + direction of a 30-60-90 triangle. If one follows those + coordinates, they hit at :math:`\left(1, \frac{\sqrt(3)}{2}, + \frac{1}{2}\right)` having unit norm. Thus the "horizontal" + distance to the boundary of the cone is :math:`1 - \left\lVert x + \right\rVert`, which simplifies to :math:`1/2`. And rather than + involve a square root, we divide by two for a final safe radius + of :math:`1/4`. >>> from math import sqrt >>> K = IceCream(3) @@ -749,11 +750,10 @@ class CartesianProduct(SymmetricCone): def cvxopt_dims(self): """ - Return a dictionary of dimensions corresponding to the factors - of this cartesian product. The format of this dictionary is - described in the CVXOPT user's guide: - - http://cvxopt.org/userguide/coneprog.html#linear-cone-programs + Return a dictionary of dimensions corresponding to the + factors of this cartesian product. The format of this dictionary + is described in the `CVXOPT user's guide + `_. Returns ------- -- 2.43.2