dgascore class. numpy optimization (for speed)