  This paper concerns the first-order approximation of the
piecewise-differentiable flow generated by a class of nonsmooth vector fields.
Specifically, we represent and compute the Bouligand (or B-)derivative of the
piecewise-$C^r$ flow generated by an event-selected $C^r$ vector field. Our
results are remarkably efficient: although there are factorially many "pieces"
of the desired derivative, we provide an algorithm that evaluates its action on
a given tangent vector using polynomial time and space, and verify the
algorithm's correctness by deriving a representation for the B-derivative that
requires "only" exponential time and space to construct. We apply our methods
in two classes of illustrative examples: piecewise-constant vector fields and
mechanical systems subject to unilateral constraints.
