def compute(self, x, y):
        '''
        Compute distance.
        
        Args:
            x:    Data point.
            y:    Data point.
        
        Returns:
            Distance.
        '''
        if x in self.__memo_dict:
            x_v = self.__memo_dict[x]
        else:
            x_v = self.__cost_functionable.compute(self.__params_arr[x, :])
            self.__memo_dict.setdefault(x, x_v)
        if y in self.__memo_dict:
            y_v = self.__memo_dict[y]
        else:
            y_v = self.__cost_functionable.compute(self.__params_arr[y, :])
            self.__memo_dict.setdefault(y, y_v)

        return abs(x_v - y_v)
Compute distance.
        
        Args:
            x:    Data point.
            y:    Data point.
        
        Returns:
            Distance.