Replace if over dimension with eigen block operation

25 jobs for master in 23 minutes and 53 seconds (queued for 5 seconds)