Changed the graph argument for the matrix constructor routines to be a target rather than a pointer