def Compute_structures(V,F):
    """
    For the linear normal kernel
    
    Parameters
    ----------
    @param : V : torch tensor
                 n-points x d-dimension points.
    @param : F : torch Long tensor
                 m-connections x 2-dim tensor containing pair of connected points' indices.

    Returns
    -------
    @output : centers        : torch tensor
                               npoints-1 x d-dimension points, the centers of each discretization segment in the tree.
    @output : lengths        : float
                               npoints-1 x 1-dimension tensor, the length of each discretization segment in the tree.
    @output : normalized_seg : torch tensor
                               npoints-1 x d-dimension normalized vectors of the discretization segments in tne tree. 
    """

    V0, V1 = V.index_select(0,F[:,0]), V.index_select(0,F[:,1])
    
    u                                    =    (V1-V0)
    lengths                              =    (u**2).sum(1)[:, None].sqrt()

    normalized_tgt_ok                       =     u / (lengths.view(-1,1))

    centers                               = (V0+V1)/2.
    return centers, lengths, normalized_tgt_ok