I need the code of Progressive mesh based on the edge collapse algorithm

I have a 3D model based on triangle,I need to implement multiresolution level of detail (LOD).
I want to simplify the model with Progressive mesh ,and reduction algorithm use edge collapse.I also need Quadric Error Metric(QEM).
The code can be part of the above mentioned.
Thank you very much!