def __init__(self, data, combinfunc, symmetric=False, diagonal=None):
        """
        Takes a list of data and generates a 2D-matrix using the supplied
        combination function to calculate the values.

        :param data: the list of items.
        :param combinfunc: the function that is used to calculate teh value in a
            cell. It has to cope with two arguments.
        :param symmetric: Whether it will be a symmetric matrix along the
            diagonal.  For example, if the list contains integers, and the
            combination function is ``abs(x-y)``, then the matrix will be
            symmetric.
        :param diagonal: The value to be put into the diagonal. For some
            functions, the diagonal will stay constant. An example could be the
            function ``x-y``. Then each diagonal cell will be ``0``.  If this
            value is set to None, then the diagonal will be calculated.
        """
        self.data = data
        self.combinfunc = combinfunc
        self.symmetric = symmetric
        self.diagonal = diagonal
def __init__ ( self , data , combinfunc , symmetric = False , diagonal = None ) : self . data = data self . combinfunc = combinfunc self . symmetric = symmetric self . diagonal = diagonal
Takes a list of data and generates a 2D-matrix using the supplied
        combination function to calculate the values.

        :param data: the list of items.
        :param combinfunc: the function that is used to calculate teh value in a
            cell. It has to cope with two arguments.
        :param symmetric: Whether it will be a symmetric matrix along the
            diagonal.  For example, if the list contains integers, and the
            combination function is ``abs(x-y)``, then the matrix will be
            symmetric.
        :param diagonal: The value to be put into the diagonal. For some
            functions, the diagonal will stay constant. An example could be the
            function ``x-y``. Then each diagonal cell will be ``0``.  If this
            value is set to None, then the diagonal will be calculated.