adds efficient operator= to both sparse and dense matrices
makes small cosmetic changes for better code uniformity