added a method to set a constant weights matrix