/** * Constructs a matrix with a copy of the given values. The values are * copied. So subsequent changes in <tt>values</tt> are not reflected in the * matrix, and vice-versa. * * @param values * The values to be filled into the new matrix. */ public DenseDoubleMatrix1D(double[] values) { this(values.length); assign(values); }
/** * Constructs a matrix with a copy of the given values. The values are * copied. So subsequent changes in <tt>values</tt> are not reflected in the * matrix, and vice-versa. * * @param values * The values to be filled into the new matrix. */ public DenseDoubleMatrix1D(double[] values) { this(values.length); assign(values); }
/** * Solves directly at the coarsest level */ private void directSolve() { int k = m - 1; u[k].assign(f[k]); if (transpose) { lu.setLU(lu.getLU().viewDice()); lu.solve(u[k]); lu.setLU(lu.getLU().viewDice()); } else lu.solve(u[k]); }
/** * Solves directly at the coarsest level */ private void directSolve() { int k = m - 1; u[k].assign(f[k]); if (transpose) { lu.setLU(lu.getLU().viewDice()); lu.solve(u[k]); lu.setLU(lu.getLU().viewDice()); } else lu.solve(u[k]); }
/** * Computes the discrete Hartley transform (DHT) of this matrix. * */ public void dht() { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dht == null) { dht = new DoubleDHT_1D(size); } if (isNoView) { dht.forward(elements); } else { DoubleMatrix1D copy = this.copy(); dht.forward((double[]) copy.elements()); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the discrete Hartley transform (DHT) of this matrix. * */ public void dht() { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dht == null) { dht = new DoubleDHT_1D(size); } if (isNoView) { dht.forward(elements); } else { DoubleMatrix1D copy = this.copy(); dht.forward((double[]) copy.elements()); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the discrete sine transform (DST-II) of this matrix. * * @param scale * if true then scaling is performed */ public void dst(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dst == null) { dst = new DoubleDST_1D(size); } if (isNoView) { dst.forward(elements, scale); } else { DoubleMatrix1D copy = this.copy(); dst.forward((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the discrete cosine transform (DCT-II) of this matrix. * * @param scale * if true then scaling is performed */ public void dct(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dct == null) { dct = new DoubleDCT_1D(size); } if (isNoView) { dct.forward(elements, scale); } else { DoubleMatrix1D copy = this.copy(); dct.forward((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the inverse of discrete sine transform (DST-III) of this matrix. * * @param scale * if true then scaling is performed */ public void idst(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dst == null) { dst = new DoubleDST_1D(size); } if (isNoView) { dst.inverse(elements, scale); } else { DoubleMatrix1D copy = this.copy(); dst.inverse((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the discrete cosine transform (DCT-II) of this matrix. * * @param scale * if true then scaling is performed */ public void dct(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dct == null) { dct = new DoubleDCT_1D(size); } if (isNoView) { dct.forward(elements, scale); } else { DoubleMatrix1D copy = this.copy(); dct.forward((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the inverse of the discrete cosine transform (DCT-III) of this * matrix. * * @param scale * if true then scaling is performed */ public void idct(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dct == null) { dct = new DoubleDCT_1D(size); } if (isNoView) { dct.inverse(elements, scale); } else { DoubleMatrix1D copy = this.copy(); dct.inverse((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the inverse of the discrete Hartley transform (IDHT) of this * matrix. * * @param scale * if true then scaling is performed */ public void idht(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dht == null) { dht = new DoubleDHT_1D(size); } if (isNoView) { dht.inverse(elements, scale); } else { DoubleMatrix1D copy = this.copy(); dht.inverse((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the inverse of the discrete cosine transform (DCT-III) of this * matrix. * * @param scale * if true then scaling is performed */ public void idct(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dct == null) { dct = new DoubleDCT_1D(size); } if (isNoView) { dct.inverse(elements, scale); } else { DoubleMatrix1D copy = this.copy(); dct.inverse((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the discrete sine transform (DST-II) of this matrix. * * @param scale * if true then scaling is performed */ public void dst(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dst == null) { dst = new DoubleDST_1D(size); } if (isNoView) { dst.forward(elements, scale); } else { DoubleMatrix1D copy = this.copy(); dst.forward((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the inverse of discrete sine transform (DST-III) of this matrix. * * @param scale * if true then scaling is performed */ public void idst(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dst == null) { dst = new DoubleDST_1D(size); } if (isNoView) { dst.inverse(elements, scale); } else { DoubleMatrix1D copy = this.copy(); dst.inverse((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the inverse of the discrete Hartley transform (IDHT) of this * matrix. * * @param scale * if true then scaling is performed */ public void idht(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dht == null) { dht = new DoubleDHT_1D(size); } if (isNoView) { dht.inverse(elements, scale); } else { DoubleMatrix1D copy = this.copy(); dht.inverse((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }