27.11.2013 Modify Matrix to be a generic class Matrix<E>

In order to allow class Matrix holds Similarity values, the Matrix
class has been modified to be a generic class Matrix<E>. To get the
diagonal calculations, a class method parse has been created.