In wikipedia there is a description of an algorithm you should implement. I don't know what is your input data but I don't think Qt is going to be helpful here that much. Of course you could use Qt types such as QGenericMatrix but I don't see many benefits over other (e.g. pure c++) types.