modify definitions(for more high performance and safety)

Some member functions are called with call by value, in spite of using vector.
I altered some method definitions for passing reference of vector, and added const to parameters to use more safely.