Passivity of directed and undirected complex dynamical networks with adaptive coupling weights