Congruences and canonical forms for a positive matrix: Application to the Schweinler–Wigner extremum principle