X-Git-Url: https://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2Fdunshire%2Fmatrices.py;h=7bfc429bdd5651b10e07cae79a653e1e3cc925b5;hb=dae85d103fae8b7247667f2a621fd245f95b5db4;hp=1e0f2a5b7970fd19b78a2d136dc0a98dee2547af;hpb=002b5370da24f083d2088c3482cf076615a13563;p=dunshire.git diff --git a/src/dunshire/matrices.py b/src/dunshire/matrices.py index 1e0f2a5..7bfc429 100644 --- a/src/dunshire/matrices.py +++ b/src/dunshire/matrices.py @@ -109,18 +109,34 @@ def vec(real_matrix): EXAMPLES: - >>> A = matrix([[1,2],[3,4]]) - >>> print(A) - [ 1 3] - [ 2 4] - + >>> A = matrix([[1,2],[3,4]]) + >>> print(A) + [ 1 3] + [ 2 4] + - >>> print(vec(A)) - [ 1] - [ 2] - [ 3] - [ 4] - + >>> print(vec(A)) + [ 1] + [ 2] + [ 3] + [ 4] + + + Note that if ``real_matrix`` is a vector, this function is a no-op: + + >>> v = matrix([1,2,3,4], (4,1)) + >>> print(v) + [ 1] + [ 2] + [ 3] + [ 4] + + >>> print(vec(v)) + [ 1] + [ 2] + [ 3] + [ 4] + """ return matrix(real_matrix, (len(real_matrix), 1))