Add a way to give scale to StdCostFunc.