A generalized flexibility matrix based approach for structural damage detection