public static void convert ( final SquareMatrix sm ) { for ( int r = 0 ; r < sm . m_nRows ; ++ r ) { for ( int c = 0 ; c < sm . m_nCols ; ++ c ) { sm . m_aValues [ r ] [ c ] = ( r == c ) ? 1 : 0 ; } } }
Convert a square matrix into an identity matrix .