matrix: factory methods and transposition