Joint Mode Selection and Resource Allocation for Device-to-Device Communications | Synapse