Generate NXN Matrix with following rules

Generate NXN Matrix must following rules

  sum of 1st raw is 0.
  sum of 1st column is 0.
  sum of diagonal is 0.

   //* code

       constraint cons1 {foreach(dyn[i,j])
                              { (dyn[0][j]) ->  dyn[i].sum == 0;
			        (dyn[i][0]) ->  dyn[i]+dyn[j]==0;
                              }
		         } 
   *//

I tried this constraint but this not working.

In reply to Bharat.manvani:

Please use code tags making your code easier to read. I have added them for you.

See 2D array constraint randomization | Verification Academy

Thanks,

Sure, I will remember from next time to use code tags.