replace some instances of LinearFunction with dot.Util.linear