vector calculation class in c++