transform_maximise function

Transform matrix according to maximise parameter