public void testSolve() {
        RealMatrixImpl m = new RealMatrixImpl(testData);
        RealMatrix mInv = new RealMatrixImpl(testDataInv);
        // being a bit slothful here -- actually testing that X = A^-1 * B
        assertClose("inverse-operate",mInv.operate(testVector),
            m.solve(testVector),normTolerance);
        try {
            m.solve(testVector2);
            fail("expecting IllegalArgumentException");
        } catch (IllegalArgumentException ex) {
            ;
        }       
        RealMatrix bs = new RealMatrixImpl(bigSingular);
        try {
            bs.solve(bs);
            fail("Expecting InvalidMatrixException");
        } catch (InvalidMatrixException ex) {
            ;
        }
        try {
            m.solve(bs);
            fail("Expecting IllegalArgumentException");
        } catch (IllegalArgumentException ex) {
            ;
        }
        try {
            new RealMatrixImpl(testData2).solve(bs);
            fail("Expecting illegalArgumentException");
        } catch (IllegalArgumentException ex) {
            ;
        } 
        try {
            (new RealMatrixImpl(testData2)).luDecompose();
            fail("Expecting InvalidMatrixException");
        } catch (InvalidMatrixException ex) {
            ;
        }  
    }
public void testSolve() {
        RealMatrixImpl m = new RealMatrixImpl(testData);
        RealMatrix mInv = new RealMatrixImpl(testDataInv);
       
        assertClose("inverse-operate",mInv.operate(testVector),
            m.solve(testVector),normTolerance);
        try {
            m.solve(testVector2);
            fail("expecting IllegalArgumentException");
        } catch (IllegalArgumentException ex) {
            ;
        }       
        RealMatrix bs = new RealMatrixImpl(bigSingular);
        try {
            bs.solve(bs);
            fail("Expecting InvalidMatrixException");
        } catch (InvalidMatrixException ex) {
            ;
        }
        try {
            m.solve(bs);
            fail("Expecting IllegalArgumentException");
        } catch (IllegalArgumentException ex) {
            ;
        }
        try {
            new RealMatrixImpl(testData2).solve(bs);
            fail("Expecting illegalArgumentException");
        } catch (IllegalArgumentException ex) {
            ;
        } 
        try {
            (new RealMatrixImpl(testData2)).luDecompose();
            fail("Expecting InvalidMatrixException");
        } catch (InvalidMatrixException ex) {
            ;
        }  
    }
public void testsolve() { realmatriximpl m = new realmatriximpl(testdata); realmatrix minv = new realmatriximpl(testdatainv); assertclose("inverse-operate",minv.operate(testvector), m.solve(testvector),normtolerance); try { m.solve(testvector2); fail("expecting illegalargumentexception"); } catch (illegalargumentexception ex) { ; } realmatrix bs = new realmatriximpl(bigsingular); try { bs.solve(bs); fail("expecting invalidmatrixexception"); } catch (invalidmatrixexception ex) { ; } try { m.solve(bs); fail("expecting illegalargumentexception"); } catch (illegalargumentexception ex) { ; } try { new realmatriximpl(testdata2).solve(bs); fail("expecting illegalargumentexception"); } catch (illegalargumentexception ex) { ; } try { (new realmatriximpl(testdata2)).ludecompose(); fail("expecting invalidmatrixexception"); } catch (invalidmatrixexception ex) { ; } }