public static DMatrixRMaj triangularUpper ( int dimen , int hessenberg , double min , double max , Random rand ) { if ( hessenberg < 0 ) throw new RuntimeException ( "hessenberg must be more than or equal to 0" ) ; double range = max - min ; DMatrixRMaj A = new DMatrixRMaj ( dimen , dimen ) ; for ( int i = 0 ; i < dimen ; i ++ ) { int start = i <= hessenberg ? 0 : i - hessenberg ; for ( int j = start ; j < dimen ; j ++ ) { A . set ( i , j , rand . nextDouble ( ) * range + min ) ; } } return A ; }
Creates an upper triangular matrix whose values are selected from a uniform distribution . If hessenberg is greater than zero then a hessenberg matrix of the specified degree is created instead .