PN := dunshire
SRCS := $(PN)/*.py test/*.py
-doc: $(SRCS) doc/source/conf.py doc/makefile
+# Sphinx tries to keep track of which docs need to be built on its
+# own. We could do better, but we would have to duplicate all of the
+# information that we already gave Sphinx to make it work.
+.PHONY: doc
+doc:
cd doc && $(MAKE) html
.PHONY: doctest
(3, 3)
"""
- return matrix([[uniform(-10, 10) for i in range(dims)]
- for j in range(dims)])
+ return matrix([[uniform(-10, 10) for _ in range(dims)]
+ for _ in range(dims)])
def random_nonnegative_matrix(dims):
"""
a = matrix([uniform(-10, 10)], (1, 1))
- b = matrix([uniform(-10, 10) for idx in range(dims-1)], (dims-1, 1))
+ b = matrix([uniform(-10, 10) for _ in range(dims-1)], (dims-1, 1))
D = random_skew_symmetric_matrix(dims-1) + a*identity(dims-1)
row1 = append_col(a, b.trans())
row2 = append_col(b, D)
"""
ambient_dim = randint(1, 10)
K = NonnegativeOrthant(ambient_dim)
- e1 = [uniform(0.5, 10) for idx in range(K.dimension())]
- e2 = [uniform(0.5, 10) for idx in range(K.dimension())]
+ e1 = [uniform(0.5, 10) for _ in range(K.dimension())]
+ e2 = [uniform(0.5, 10) for _ in range(K.dimension())]
L = random_matrix(K.dimension())
return (L, K, matrix(e1), matrix(e2))
# non-height part is sqrt(dim(K) - 1), and we can divide by
# twice that.
fudge_factor = 1.0 / (2.0*sqrt(K.dimension() - 1.0))
- e1 += [fudge_factor*uniform(0, 1) for idx in range(K.dimension() - 1)]
- e2 += [fudge_factor*uniform(0, 1) for idx in range(K.dimension() - 1)]
+ e1 += [fudge_factor*uniform(0, 1) for _ in range(K.dimension() - 1)]
+ e2 += [fudge_factor*uniform(0, 1) for _ in range(K.dimension() - 1)]
L = random_matrix(K.dimension())
return (L, K, matrix(e1), matrix(e2))