/** * Returns elements together with their error terms if available, or just the elements otherwise. */ @Override public double[] getExtendedElements() { if (matrix instanceof ExtendedPrecisionMatrix) { return ((ExtendedPrecisionMatrix) matrix).getExtendedElements(); } else { return getElements(); } }
/** * Returns elements together with their error terms if available, or just the elements otherwise. */ @Override public double[] getExtendedElements() { if (matrix instanceof ExtendedPrecisionMatrix) { return ((ExtendedPrecisionMatrix) matrix).getExtendedElements(); } else { return getElements(); } }
/** * Returns the elements of the given matrix, together with error terms if available. */ private static double[] getExtendedElements(final Matrix matrix) { if (matrix instanceof ExtendedPrecisionMatrix) { return ((ExtendedPrecisionMatrix) matrix).getExtendedElements(); } else { return MatrixSIS.castOrCopy(matrix).getElements(); } }
/** * Returns the elements of the given matrix, together with error terms if available. */ private static double[] getExtendedElements(final Matrix matrix) { if (matrix instanceof ExtendedPrecisionMatrix) { return ((ExtendedPrecisionMatrix) matrix).getExtendedElements(); } else { return MatrixSIS.castOrCopy(matrix).getElements(); } }
elements = ((ExtendedPrecisionMatrix) matrix).getExtendedElements(); if (elements.length == length) { return elements;
elements = ((ExtendedPrecisionMatrix) matrix).getExtendedElements(); if (elements.length == length) { return elements;
/** * Constructs a transform from the specified matrix. * The matrix is usually square and affine, but this is not enforced. * * @param matrix the matrix. */ protected ProjectiveTransform(final Matrix matrix) { numRow = matrix.getNumRow(); numCol = matrix.getNumCol(); if (matrix instanceof ExtendedPrecisionMatrix) { elt = ((ExtendedPrecisionMatrix) matrix).getExtendedElements(); assert (elt.length % (numRow * numCol)) == 0; } else { elt = new double[numRow * numCol]; int mix = 0; for (int j=0; j<numRow; j++) { for (int i=0; i<numCol; i++) { elt[mix++] = matrix.getElement(j,i); } } } }
/** * Constructs a transform from the specified matrix. * The matrix is usually square and affine, but this is not enforced. * * @param matrix the matrix. */ protected ProjectiveTransform(final Matrix matrix) { numRow = matrix.getNumRow(); numCol = matrix.getNumCol(); if (matrix instanceof ExtendedPrecisionMatrix) { elt = ((ExtendedPrecisionMatrix) matrix).getExtendedElements(); assert (elt.length % (numRow * numCol)) == 0; } else { elt = new double[numRow * numCol]; int mix = 0; for (int j=0; j<numRow; j++) { for (int i=0; i<numCol; i++) { elt[mix++] = matrix.getElement(j,i); } } } }
/** * Constructs a new matrix and copies the initial values from the given matrix. * * @param matrix the matrix to copy. */ GeneralMatrix(final Matrix matrix) { final int numRow = matrix.getNumRow(); final int numCol = matrix.getNumCol(); ensureValidSize(numRow, numCol); this.numRow = (short) numRow; this.numCol = (short) numCol; if (matrix instanceof ExtendedPrecisionMatrix) { elements = ((ExtendedPrecisionMatrix) matrix).getExtendedElements(); assert (elements.length % (numRow * numCol)) == 0; } else { elements = new double[numRow * numCol]; getElements(matrix, numRow, numCol, elements); } }
/** * Constructs a new matrix and copies the initial values from the given matrix. * * @param matrix the matrix to copy. */ GeneralMatrix(final Matrix matrix) { final int numRow = matrix.getNumRow(); final int numCol = matrix.getNumCol(); ensureValidSize(numRow, numCol); this.numRow = (short) numRow; this.numCol = (short) numCol; if (matrix instanceof ExtendedPrecisionMatrix) { elements = ((ExtendedPrecisionMatrix) matrix).getExtendedElements(); assert (elements.length % (numRow * numCol)) == 0; } else { elements = new double[numRow * numCol]; getElements(matrix, numRow, numCol, elements); } }
((ExtendedPrecisionMatrix) Matrices.inverse(matrix)).getExtendedElements()); work.inverse = this;
((ExtendedPrecisionMatrix) Matrices.inverse(matrix)).getExtendedElements()); work.inverse = this;
elements = ((ExtendedPrecisionMatrix) matrix).getExtendedElements(); if (elements.length > count) { final DoubleDouble t = new DoubleDouble();
elements = ((ExtendedPrecisionMatrix) matrix).getExtendedElements(); if (elements.length > count) { final DoubleDouble t = new DoubleDouble();
return new AffineTransform2D(((ExtendedPrecisionMatrix) matrix).getExtendedElements()); } else { return new AffineTransform2D(
return new AffineTransform2D(((ExtendedPrecisionMatrix) matrix).getExtendedElements()); } else { return new AffineTransform2D(
O, O, O, l }); final double[] elements = ((ExtendedPrecisionMatrix) matrix).getExtendedElements(); assertTrue (r.value > r.error); assertFalse(r.error == 0); // Paranoiac checks for making sure that next assertion will test something.
O, O, O, l }); final double[] elements = ((ExtendedPrecisionMatrix) matrix).getExtendedElements(); assertTrue (r.value > r.error); assertFalse(r.error == 0); // Paranoiac checks for making sure that next assertion will test something.