written constructor for RegularMatrix