]> gitweb.michael.orlitzky.com - dunshire.git/blobdiff - src/dunshire/matrices.py
More "easy" docs work in matrices.py/options.py.
[dunshire.git] / src / dunshire / matrices.py
index 38d4afe78efaad7665b71d936c8ba9e8309de581..3670d8f1e07db9cb0de23bce7b9a3fdbea9b0dfb 100644 (file)
@@ -9,15 +9,24 @@ from cvxopt.lapack import syev
 
 import options
 
+
 def append_col(left, right):
     """
-    Append the matrix ``right`` to the right side of the matrix ``left``.
+    Append two matrices side-by-side.
 
     Parameters
     ----------
+
     left, right : matrix
         The two matrices to append to one another.
 
+    Returns
+    -------
+
+    matrix
+        A new matrix consisting of ``right`` appended to the right
+        of ``left``.
+
     Examples
     --------
 
@@ -39,15 +48,23 @@ def append_col(left, right):
     """
     return matrix([left.trans(), right.trans()]).trans()
 
+
 def append_row(top, bottom):
     """
-    Append the matrix ``bottom`` to the bottom of the matrix ``top``.
+    Append two matrices top-to-bottom.
 
     Parameters
     ----------
+
     top, bottom : matrix
         The two matrices to append to one another.
 
+    Returns
+    -------
+
+    matrix
+        A new matrix consisting of ``bottom`` appended below ``top``.
+
     Examples
     --------
 
@@ -84,9 +101,15 @@ def eigenvalues(symmat):
     symmat : matrix
         The real symmetric matrix whose eigenvalues you want.
 
+    Returns
+    -------
+
+    list of float
+       A list of the eigenvalues (in no particular order) of ``symmat``.
 
     Raises
     ------
+
     TypeError
         If the input matrix is not symmetric.
 
@@ -129,6 +152,7 @@ def identity(domain_dim):
 
     Returns
     -------
+
     matrix
         A ``domain_dim``-by-``domain_dim`` dense integer identity matrix.
 
@@ -163,6 +187,7 @@ def inner_product(vec1, vec2):
 
     Returns
     -------
+
     float
         The inner product of ``vec1`` and ``vec2``.