+def random_lyapunov_like_icecream(dims):
+ r"""
+ Generate a random matrix Lyapunov-like on the ice-cream cone.
+
+ The form of these matrices is cited in Gowda and Tao
+ [GowdaTao]_. The scalar ``a`` and the vector ``b`` (using their
+ notation) are easy to generate. The submatrix ``D`` is a little
+ trickier, but it can be found noticing that :math:`C + C^{T} = 0`
+ for a skew-symmetric matrix :math:`C` implying that :math:`C + C^{T}
+ + \left(2a\right)I = \left(2a\right)I`. Thus we can stick an
+ :math:`aI` with each of :math:`C,C^{T}` and let those be our
+ :math:`D,D^{T}`.
+
+ Parameters
+ ----------
+
+ dims : int
+ The dimension of the ice-cream cone (not of the matrix you want!)
+ on which the returned matrix should be Lyapunov-like.
+
+ Returns
+ -------
+
+ matrix
+ A new matrix, Lyapunov-like on the ice-cream cone in ``dims``
+ dimensions, whose free entries are random floats chosen uniformly
+ from the interval [-10, 10].
+
+ References
+ ----------
+
+ .. [GowdaTao] M. S. Gowda and J. Tao. On the bilinearity rank of a
+ proper cone and Lyapunov-like transformations. Mathematical
+ Programming, 147:155–170, 2014.
+
+ Examples
+ --------
+
+ >>> L = random_lyapunov_like_icecream(3)
+ >>> L.size
+ (3, 3)
+ >>> x = matrix([1,1,0])
+ >>> s = matrix([1,-1,0])
+ >>> abs(inner_product(L*x, s)) < options.ABS_TOL
+ True
+