Buggy code:
public final class QRDecompositionTest extends MahoutTestCase { @ Test public void randomMatrix ( ) { } @ Test public void rank1 ( ) { } @ Test public void fullRankTall ( ) { } @ Test public void fullRankWide ( ) { Matrix x = QRDecompositionTest . matrix ( ) . transpose ( ) ; QRDecomposition qr = new QRDecomposition ( x ) ; <START_BUG> assertFalse ( qr . hasFullRank ( ) ) ; <END_BUG> Matrix rActual = qr . getR ( ) ; Matrix rRef = QRDecompositionTest . reshape ( new double [ ] { - 2.42812464965842 , 0 , 0 , 0 , 0 , 0.303587286111356 , - 2.91663643494775 , 0 , 0 , 0 , - 0.201812474153156 , - 0.765485720168378 , 1.09989373598954 , 0 , 0 , 1.47980701097885 , - 0.637545820524326 , - 1.55519859337935 , 0.844655127991726 , 0 , 0.0248883129453161 , 0.00115010570270549 , - 0.236340588891252 , - 0.092924118200147 , 1.42910099545547 , - 1.1678472412429 , 0.531245845248056 , 0.351978196071514 , - 1.03241474816555 , - 2.20223861735426 , - 0.887809959067632 , 0.189731251982918 , - 0.504321849233586 , 0.490484123999836 , 1.21266692336743 , - 0.633888169775463 , 1.04738559065986 , 0.284041239547031 , 0.578183510077156 , - 0.942314870832456 } , 5 , 8 ) ; QRDecompositionTest . printMatrix ( "rRef" , rRef ) ; QRDecompositionTest . printMatrix ( "rActual" , rActual ) ; QRDecompositionTest . assertEquals ( 0 , rActual . clone ( ) . assign ( ABS ) . minus ( rRef . clone ( ) . assign ( ABS ) ) . aggregate ( PLUS , IDENTITY ) , 1.0E-12 ) ; Matrix qRef = QRDecompositionTest . reshape ( new double [ ] { - 0.203489262374627 , 0.316761677948356 , - 0.784155643293468 , 0.394321494579 , - 0.29641971170211 , 0.0311283614803723 , - 0.34755265020736 , 0.137138511478328 , 0.848579887681972 , 0.373287266507375 , - 0.39603700561249 , - 0.787812566647329 , - 0.377864833067864 , - 0.275080943427399 , 0.0636764674878229 , 0.0763976893309043 , - 0.318551137554327 , 0.286407036668598 , 0.206004127289883 , - 0.876482672226889 , 0.89159476695423 , - 0.238213616975551 , - 0.376141107880836 , - 0.0794701657055114 , 0.0227025098210165 } , 5 , 5 ) ; Matrix q = qr . getQ ( ) ; QRDecompositionTest . printMatrix ( "qRef" , qRef ) ; QRDecompositionTest . printMatrix ( "q" , q ) ; QRDecompositionTest . assertEquals ( 0 , q . clone ( ) . assign ( ABS ) . minus ( qRef . clone ( ) . assign ( ABS ) ) . aggregate ( PLUS , IDENTITY ) , 1.0E-12 ) ; Matrix x1 = qr . solve ( QRDecompositionTest . b ( ) ) ; Matrix xRef = QRDecompositionTest . reshape ( new double [ ] { - 0.182580239668147 , - 0.437233627652114 , 0.138787653097464 , 0.672934739896228 , - 0.131420217069083 , 0 , 0 , 0 } , 8 , 1 ) ; QRDecompositionTest . printMatrix ( "xRef" , xRef ) ; QRDecompositionTest . printMatrix ( "x" , x1 ) ; QRDecompositionTest . assertEquals ( xRef , x1 , 1.0E-8 ) ; QRDecompositionTest . assertEquals ( x , qr . getQ ( ) . times ( qr . getR ( ) ) , 1.0E-15 ) ; } @ Test public void fasterThanBefore ( ) { } private interface Decomposer { public QR decompose ( Matrix a ) { } } private void decompositionSpeedCheck ( QRDecompositionTest . Decomposer qrf , OnlineSummarizer s1 , Matrix a , String label ) { } private static void assertEquals ( Matrix ref , Matrix actual , double epsilon ) { } private static void printMatrix ( String name , Matrix m ) { } private static Matrix matrix ( ) { } private static Matrix reshape ( double [ ] values , int rows , int columns ) { } private static Matrix b ( ) { } }

Fix:
assertTrue ( qr . hasFullRank ( ) ) ;