added the tested smaMatCpp and smaVecCpp function