def vecp(mat):
    # This returns the unique elements of a symmetric matrix
    # 2014-02-11 now mirrors matlab vecp.m

    dim = mat.shape[0]

    vec = np.zeros((dim*(dim+1)/2))
    counter = 0
    for iDiag in range(0,dim):
        vec[counter:counter+dim-iDiag] = np.diag(mat,iDiag)

        counter = counter + dim - iDiag

    return vec

#####################################################################
# Function to evaluate the likelihood itself
dataset/ETHPy150Open baudren/montepython_public/montepython/likelihoods/bicep2/bicep_util.py/vecp/original