Searching for gravitational wave burst in pulsar-timing-array data with piecewise linear functions