realsymmetric(k,D) and complexsymmetric(k,D) replace matrixgen(k,D)