Source: http://dpnc.unige.ch/~sfyrla/teaching/PGC_Automne2017/notes_PGC_web/PGC_full.pdf