For k=0
, if i==j
, $A[i,j]=abs(B[i,j])$ and
A[i,j]=-abs(B[i,j])
otherwise. For k=1
, A
replaces each
diagonal element of B
with its absolute value, and replaces each
off-diagonal with the negative of the largest absolute value off-diagonal
in the same row.