Constrain a 2D matrix in diamond fashion

In reply to megamind:

Hi Mega,
I have taken your logic and optimized the constrain code.
Thanks for the input thoughts :)