I came across the following code here, which is from the C++ implementation of Dijkstra algorithm using an adjacency matrix.
//read in edges keeping only the minimum
for(int i=0; i<E; i++) {
int v1,v2,tmp;
fin >> v1; fin >> v2;
fin >> tmp;
adjmat[v1][v2]<?=tmp; // <?= sets left to min(left,right)
adjmat[v2][v1]<?=tmp;
}
Pay attention to the last two lines, which apply operator <?=
. As being commented, the following line
adjmat[v1][v2]<?=tmp; // <?= sets left to min(left,right)
will set left
to min(left,right)
.
I never see this operator before. I tried the code in VS, it can not compile. What is it? How can it set left
to be min(left,right)
?