def _computeSigma(thetaDotX, columns, splitLimit, start=0, end=None):
    if end is None:
        end = len(thetaDotX)

    if (end - start) < splitLimit:
        numColumns = len(columns)

        def unsymmetrizedElementAt(row, col):
            if col < row:
                return 0.0

            right = columns[col][start:end]
            left = columns[row][start:end]
            weights = thetaDotX[start:end]

            return _weightedDotProduct(right, left, weights)

        unsymmetrizedValues = [
            [unsymmetrizedElementAt(row, col) for col in xrange(numColumns)] \
            for row in xrange(numColumns)
            ]

        symmetrizedValues = []
        for row in xrange(numColumns):
            for col in xrange(numColumns):
                if row <= col:
                    elt = unsymmetrizedValues[row][col]
                else:
                    elt = unsymmetrizedValues[col][row]
                symmetrizedValues = symmetrizedValues + [elt]

        tr = numpy.array(symmetrizedValues)
        return tr.reshape((numColumns, numColumns))

    mid = (start + end) / 2
    return _computeSigma(thetaDotX, columns, splitLimit, start, mid) + \
        _computeSigma(thetaDotX, columns, splitLimit, mid, end)
dataset/ETHPy150Open ufora/ufora/packages/python/pyfora/algorithms/logistic/FullRankMajorizationSolver.py/_computeSigma/original