matrix and vector types extended