Converts a set or algebraic structure to a vector.