public static void show ( DMatrixD1 A , String title ) { JFrame frame = new JFrame ( title ) ; int width = 300 ; int height = 300 ; if ( A . numRows > A . numCols ) { width = width * A . numCols / A . numRows ; } else { height = height * A . numRows / A . numCols ; } DMatrixComponent panel = new DMatrixComponent ( width , height ) ; panel . setMatrix ( A ) ; frame . add ( panel , BorderLayout . CENTER ) ; frame . pack ( ) ; frame . setVisible ( true ) ; }
Creates a window visually showing the matrix s state . Block means an element is zero . Red positive and blue negative . More intense the color larger the element s absolute value is .