remove type to allow also sparse matrices