+def _pretty_print_dict(dictionary):
+ """
+ Return a pretty-printed string representation of a dictionary
+ containing CVXOPT matrices.
+ """
+ result = ''
+ for (key, value) in dictionary.items():
+ if isinstance(value, matrix):
+ # Display matrices on their own lines, indented.
+ result += ' {:s}:'.format(key)
+ colvec = '\n{!s}'.format(value)
+ result += '\n '.join(colvec.splitlines())
+ result += '\n'
+ else:
+ result += ' {:s}: {!s}\n'.format(key, value)
+
+ return result
+
+