adding method for adding constants to matrix(for generalization)