Bistable switching in a nonlinear Bragg reflector