Lower triangle matrix using two dimensional array constraints with increasing order

can anyone help me to write a system verilog code for lower triangle matrix with the values will be increasing in order… i have a writeen some logic but im not sure is this logic right or wrong. please help me to find out this. thank you

Int matrix [3][3];

Constraint c{ for( i=0,j=1) matrix[i][j]=0;
for( i=0,j=2) matrix[i][j]=0;
for( i=1,j=2) matrix[i][j]=0;}

foreach (matrix[i][j])
matrix [i][j]= i*3+j;

Foreach (matrix[i,j])
$display(\tmatrix[“%0d, %0d]= %0d” i,j,matrix[i][j]);
End

check this, and you can manipulate values as you needed.
Thanks,
Juhi Patel.
https://www.linkedin.com/in/juhi-patel-455535149/

In reply to Juhi_Patel:

Thank you for the reply @juhi_patel
For increasing order of values, is there any generalised logic
I have used this one
foreach (matrix[i][j])
matrix [i][j]= i*3+j;

In reply to shravani_k:

increasing values can be row wise or column wise, can you please tell what is exact values you are looking for in matrix?
Thanks,
Juhi Patel
https://www.linkedin.com/in/juhi-patel-455535149/

In reply to Juhi_Patel:

i just want the values to be in random ascending order…
my logic is working to get the serial ascending values…
i guess by replacing i to j or viceversa will get row wise ascending or column wise ascending
that doesnt matter…

In reply to shravani_k:

check here for lower triangle with increasing values, for row wise and column wise
Thanks,
Juhi Patel.
https://www.linkedin.com/in/juhi-patel-455535149/