def asFlatArray(self,mask=None):
        '''query,target,score,type'''
        r,c = self.matrix.shape
        result = np.zeros((r*c,4),dtype=np.object)
        for i in range(r):
            for j in range(c):
                result[c*i+j,0] = i 
                result[c*i+j,1] = j
                result[c*i+j,2] = self.matrix[i,j]
                if BEE_CODE_MAP.has_key(mask[i,j]):
                    result[c*i+j,3] = BEE_CODE_MAP[mask[i,j]]
                else:
                    result[c*i+j,3] = "0x%02x"%mask[i,j]
        return result
dataset/ETHPy150Open bolme/pyvision/src/pyvision/analysis/bee.py/BEEDistanceMatrix.asFlatArray/original