Arbitrary gradients and great speedup of Matrix copy and assignement