// I'm not sure why you can't make v1 as const here inline const double dotprod(const vector3d & v1, const vector3d & v2 ) { return v1._dotprod(v2); }