frommatrix function

Converts a backbone adjacency matrix to a graph object of specified class