ph-math/src/main/java/com/helger/numbercruncher/matrix/IdentityMatrix.java
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;
      }
    }
  }
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;
      }
    }
  }
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.

@param sm
the square matrix to convert
Convert a square matrix into an identity matrix .