First commit of sparse optimization functions