+
+def _random_skew_symmetric_matrix(dims):
+ """
+ Generate a random skew-symmetrix (``dims``-by-``dims``) matrix.
+
+ Examples
+ --------
+
+ >>> A = _random_skew_symmetric_matrix(randint(1, 10))
+ >>> norm(A + A.trans()) < options.ABS_TOL
+ True
+
+ """
+ strict_ut = [[uniform(-10, 10)*int(i < j) for i in range(dims)]
+ for j in range(dims)]
+
+ strict_ut = matrix(strict_ut, (dims,dims))
+ return (strict_ut - strict_ut.trans())
+
+
+def _random_lyapunov_like_icecream(dims):
+ """
+ Generate a random Lyapunov-like matrix over the ice-cream cone in
+ ``dims`` dimensions.
+ """
+ a = matrix([uniform(-10,10)], (1,1))
+ b = matrix([uniform(-10,10) for idx 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)
+ return append_row(row1,row2)
+
+