Optical nonlinearities in semiconductor optical amplifier and electro-absorption modulator: their applications to all-optical regeneration