public static SimpleMatrix diag ( Class type , double ... vals ) { SimpleMatrix M = new SimpleMatrix ( vals . length , vals . length , type ) ; for ( int i = 0 ; i < vals . length ; i ++ ) { M . set ( i , i , vals [ i ] ) ; } return M ; }
Creates a real valued diagonal matrix of the specified type