private Class<? extends Matrix> getClassFor(int rows, int cols) {
		if (cols==1) {
			switch (rows) {
				case 2: return Vector2.class;
				case 3: return Vector3.class;
				case 4: return Vector4.class;
				default: return Vector.class;
			}
		} else if (rows==2 && cols==2)
			return Matrix2.class;
		else if (rows==3 && cols==3)
			return Matrix3.class;
		else
			return Matrix.class;
	}