adjust matrix generation to more closely conform to canonical MNA
eliminate some for loops by using Eigen's built-in row and dot product features