/** * Checks to see if any of the elements in this matrix are either NaN or infinite. * * @return True of an element is NaN or infinite. False otherwise. */ public boolean hasUncountable() { return MatrixFeatures.hasUncountable(mat); }
/** * Checks to see if any of the elements in this matrix are either NaN or infinite. * * @return True of an element is NaN or infinite. False otherwise. */ public boolean hasUncountable() { return MatrixFeatures.hasUncountable(mat); }
/** * Checks to see if any of the elements in this matrix are either NaN or infinite. * * @return True of an element is NaN or infinite. False otherwise. */ public boolean hasUncountable() { return MatrixFeatures.hasUncountable(mat); }
if(checkUncountable && MatrixFeatures.hasUncountable(A)) { throw new RuntimeException("bad matrix");
if(checkUncountable && MatrixFeatures.hasUncountable(A)) { throw new RuntimeException("bad matrix");
if(checkUncountable && MatrixFeatures.hasUncountable(A)) { throw new RuntimeException("bad matrix");
if(checkUncountable && MatrixFeatures.hasUncountable(A)) { throw new RuntimeException("bad matrix");
if(checkUncountable && MatrixFeatures.hasUncountable(A)) { throw new RuntimeException("bad matrix");
if(checkUncountable && MatrixFeatures.hasUncountable(A)) { throw new RuntimeException("bad matrix");
/** * <p> * Returns the inverse of this matrix.<br> * <br> * b = a<sup>-1<sup><br> * </p> * * <p> * If the matrix could not be inverted then SingularMatrixException is thrown. Even * if no exception is thrown the matrix could still be singular or nearly singular. * </p> * * @see CommonOps#invert(DenseMatrix64F, DenseMatrix64F) * * @throws org.ejml.factory.SingularMatrixException * * @return The inverse of this matrix. */ public T invert() { T ret = createMatrix(mat.numRows,mat.numCols); if( !CommonOps.invert(mat,ret.getMatrix()) ) { throw new SingularMatrixException(); } if( MatrixFeatures.hasUncountable(ret.getMatrix())) throw new SingularMatrixException("Solution has uncountable numbers"); return ret; }
/** * <p> * Returns the inverse of this matrix.<br> * <br> * b = a<sup>-1<sup><br> * </p> * * <p> * If the matrix could not be inverted then SingularMatrixException is thrown. Even * if no exception is thrown the matrix could still be singular or nearly singular. * </p> * * @see CommonOps#invert(DenseMatrix64F, DenseMatrix64F) * * @throws org.ejml.factory.SingularMatrixException * * @return The inverse of this matrix. */ public T invert() { T ret = createMatrix(mat.numRows,mat.numCols); if( !CommonOps.invert(mat,ret.getMatrix()) ) { throw new SingularMatrixException(); } if( MatrixFeatures.hasUncountable(ret.getMatrix())) throw new SingularMatrixException("Solution has uncountable numbers"); return ret; }
/** * <p> * Returns the inverse of this matrix.<br> * <br> * b = a<sup>-1<sup><br> * </p> * * <p> * If the matrix could not be inverted then SingularMatrixException is thrown. Even * if no exception is thrown the matrix could still be singular or nearly singular. * </p> * * @see CommonOps#invert(DenseMatrix64F, DenseMatrix64F) * * @throws org.ejml.factory.SingularMatrixException * * @return The inverse of this matrix. */ public T invert() { T ret = createMatrix(mat.numRows,mat.numCols); if( !CommonOps.invert(mat,ret.getMatrix()) ) { throw new SingularMatrixException(); } if( MatrixFeatures.hasUncountable(ret.getMatrix())) throw new SingularMatrixException("Solution has uncountable numbers"); return ret; }
/** * <p> * Solves for X in the following equation:<br> * <br> * x = a<sup>-1</sup>b<br> * <br> * where 'a' is this matrix and 'b' is an n by p matrix. * </p> * * <p> * If the system could not be solved then SingularMatrixException is thrown. Even * if no exception is thrown 'a' could still be singular or nearly singular. * </p> * * @see CommonOps#solve(DenseMatrix64F, DenseMatrix64F, DenseMatrix64F) * * @throws SingularMatrixException * * @param b n by p matrix. Not modified. * @return The solution for 'x' that is n by p. */ public T solve( T b ) { T x = createMatrix(mat.numCols,b.getMatrix().numCols); if( !CommonOps.solve(mat,b.getMatrix(),x.getMatrix()) ) throw new SingularMatrixException(); if( MatrixFeatures.hasUncountable(x.getMatrix()) ) throw new SingularMatrixException("Solution contains uncountable numbers"); return x; }
/** * <p> * Solves for X in the following equation:<br> * <br> * x = a<sup>-1</sup>b<br> * <br> * where 'a' is this matrix and 'b' is an n by p matrix. * </p> * * <p> * If the system could not be solved then SingularMatrixException is thrown. Even * if no exception is thrown 'a' could still be singular or nearly singular. * </p> * * @see CommonOps#solve(DenseMatrix64F, DenseMatrix64F, DenseMatrix64F) * * @throws SingularMatrixException * * @param b n by p matrix. Not modified. * @return The solution for 'x' that is n by p. */ public T solve( T b ) { T x = createMatrix(mat.numCols,b.getMatrix().numCols); if( !CommonOps.solve(mat,b.getMatrix(),x.getMatrix()) ) throw new SingularMatrixException(); if( MatrixFeatures.hasUncountable(x.getMatrix()) ) throw new SingularMatrixException("Solution contains uncountable numbers"); return x; }
/** * <p> * Solves for X in the following equation:<br> * <br> * x = a<sup>-1</sup>b<br> * <br> * where 'a' is this matrix and 'b' is an n by p matrix. * </p> * * <p> * If the system could not be solved then SingularMatrixException is thrown. Even * if no exception is thrown 'a' could still be singular or nearly singular. * </p> * * @see CommonOps#solve(DenseMatrix64F, DenseMatrix64F, DenseMatrix64F) * * @throws SingularMatrixException * * @param b n by p matrix. Not modified. * @return The solution for 'x' that is n by p. */ public T solve( T b ) { T x = createMatrix(mat.numCols,b.getMatrix().numCols); if( !CommonOps.solve(mat,b.getMatrix(),x.getMatrix()) ) throw new SingularMatrixException(); if( MatrixFeatures.hasUncountable(x.getMatrix()) ) throw new SingularMatrixException("Solution contains uncountable numbers"); return x; }
if( MatrixFeatures.hasUncountable(x)) { failed = true;
if( MatrixFeatures.hasUncountable(x)) { failed = true;
if( MatrixFeatures.hasUncountable(x)) { failed = true;