implement vector and matrix constructors.