converted fitline to C++, fixed Mat::checkVector().