Completed add_constant method for matrices
tests for add_constant