public Matrix copy() { Matrix m = new ParallelColtDenseDoubleMatrix2D( (cern.colt.matrix.tdouble.impl.DenseDoubleMatrix2D) matrix.copy()); if (getMetaData() != null) { m.setMetaData(getMetaData().clone()); } return m; }
public Matrix copy() { Matrix m = new ParallelColtDenseDoubleMatrix2D( (cern.colt.matrix.tdouble.impl.DenseDoubleMatrix2D) matrix.copy()); if (getMetaData() != null) { m.setMetaData(getMetaData().clone()); } return m; }
public Matrix plus(double value) { Matrix result = new ParallelColtDenseDoubleMatrix2D((cern.colt.matrix.tdouble.impl.DenseDoubleMatrix2D) matrix .copy().assign(DoubleFunctions.plus(value))); MapMatrix<String, Object> a = getMetaData(); if (a != null) { result.setMetaData(a.clone()); } return result; }
public Matrix times(double value) { Matrix result = new ParallelColtDenseDoubleMatrix2D((cern.colt.matrix.tdouble.impl.DenseDoubleMatrix2D) matrix .copy().assign(DoubleFunctions.mult(value))); MapMatrix<String, Object> a = getMetaData(); if (a != null) { result.setMetaData(a.clone()); } return result; }
public Matrix plus(double value) { Matrix result = new ParallelColtDenseDoubleMatrix2D((cern.colt.matrix.tdouble.impl.DenseDoubleMatrix2D) matrix .copy().assign(DoubleFunctions.plus(value))); MapMatrix<String, Object> a = getMetaData(); if (a != null) { result.setMetaData(a.clone()); } return result; }
public Matrix times(double value) { Matrix result = new ParallelColtDenseDoubleMatrix2D((cern.colt.matrix.tdouble.impl.DenseDoubleMatrix2D) matrix .copy().assign(DoubleFunctions.mult(value))); MapMatrix<String, Object> a = getMetaData(); if (a != null) { result.setMetaData(a.clone()); } return result; }
public Matrix plus(Matrix m) { if (m instanceof ParallelColtDenseDoubleMatrix2D) { DoubleMatrix2D result = matrix.copy(); result.assign(((ParallelColtDenseDoubleMatrix2D) m).getWrappedObject(), DoubleFunctions.plus); Matrix ret = new ParallelColtDenseDoubleMatrix2D(result); MapMatrix<String, Object> a = getMetaData(); if (a != null) { ret.setMetaData(a.clone()); } return ret; } else { return super.plus(m); } }
public Matrix plus(Matrix m) { if (m instanceof ParallelColtDenseDoubleMatrix2D) { DoubleMatrix2D result = matrix.copy(); result.assign(((ParallelColtDenseDoubleMatrix2D) m).getWrappedObject(), DoubleFunctions.plus); Matrix ret = new ParallelColtDenseDoubleMatrix2D(result); MapMatrix<String, Object> a = getMetaData(); if (a != null) { ret.setMetaData(a.clone()); } return ret; } else { return super.plus(m); } }
public Matrix minus(Matrix m) { if (m instanceof ParallelColtDenseDoubleMatrix2D) { DoubleMatrix2D result = matrix.copy(); result.assign(((ParallelColtDenseDoubleMatrix2D) m).getWrappedObject(), DoubleFunctions.minus); Matrix ret = new ParallelColtDenseDoubleMatrix2D(result); MapMatrix<String, Object> a = getMetaData(); if (a != null) { ret.setMetaData(a.clone()); } return ret; } else { return super.minus(m); } }
public Matrix minus(Matrix m) { if (m instanceof ParallelColtDenseDoubleMatrix2D) { DoubleMatrix2D result = matrix.copy(); result.assign(((ParallelColtDenseDoubleMatrix2D) m).getWrappedObject(), DoubleFunctions.minus); Matrix ret = new ParallelColtDenseDoubleMatrix2D(result); MapMatrix<String, Object> a = getMetaData(); if (a != null) { ret.setMetaData(a.clone()); } return ret; } else { return super.minus(m); } }
/** * Computes the 2D discrete Hartley transform (DHT) of this matrix. * */ public void dht2() { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dht2 == null) { dht2 = new DoubleDHT_2D(rows, columns); } if (isNoView == true) { dht2.forward(elements); } else { DoubleMatrix2D copy = this.copy(); dht2.forward((double[]) copy.elements()); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the 2D discrete Hartley transform (DHT) of this matrix. * */ public void dht2() { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dht2 == null) { dht2 = new DoubleDHT_2D(rows, columns); } if (isNoView == true) { dht2.forward(elements); } else { DoubleMatrix2D copy = this.copy(); dht2.forward((double[]) copy.elements()); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the 2D discrete cosine transform (DCT-II) of this matrix. * * @param scale * if true then scaling is performed * */ public void dct2(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dct2 == null) { dct2 = new DoubleDCT_2D(rows, columns); } if (isNoView == true) { dct2.forward(elements, scale); } else { DoubleMatrix2D copy = this.copy(); dct2.forward((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the 2D inverse of the discrete cosine transform (DCT-III) of * this matrix. * * @param scale * if true then scaling is performed * */ public void idct2(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dct2 == null) { dct2 = new DoubleDCT_2D(rows, columns); } if (isNoView == true) { dct2.inverse(elements, scale); } else { DoubleMatrix2D copy = this.copy(); dct2.inverse((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the 2D inverse of the discrete sine transform (DST-III) of this * matrix. * * @param scale * if true then scaling is performed * */ public void idst2(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dst2 == null) { dst2 = new DoubleDST_2D(rows, columns); } if (isNoView == true) { dst2.inverse(elements, scale); } else { DoubleMatrix2D copy = this.copy(); dst2.inverse((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the 2D inverse of the discrete Hartley transform (IDHT) of this * matrix. * * @param scale * if true then scaling is performed * */ public void idht2(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dht2 == null) { dht2 = new DoubleDHT_2D(rows, columns); } if (isNoView == true) { dht2.inverse(elements, scale); } else { DoubleMatrix2D copy = this.copy(); dht2.inverse((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the 2D discrete sine transform (DST-II) of this matrix. * * @param scale * if true then scaling is performed * */ public void dst2(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dst2 == null) { dst2 = new DoubleDST_2D(rows, columns); } if (isNoView == true) { dst2.forward(elements, scale); } else { DoubleMatrix2D copy = this.copy(); dst2.forward((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the 2D discrete cosine transform (DCT-II) of this matrix. * * @param scale * if true then scaling is performed * */ public void dct2(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dct2 == null) { dct2 = new DoubleDCT_2D(rows, columns); } if (isNoView == true) { dct2.forward(elements, scale); } else { DoubleMatrix2D copy = this.copy(); dct2.forward((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the 2D discrete sine transform (DST-II) of this matrix. * * @param scale * if true then scaling is performed * */ public void dst2(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dst2 == null) { dst2 = new DoubleDST_2D(rows, columns); } if (isNoView == true) { dst2.forward(elements, scale); } else { DoubleMatrix2D copy = this.copy(); dst2.forward((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the 2D inverse of the discrete sine transform (DST-III) of this * matrix. * * @param scale * if true then scaling is performed * */ public void idst2(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dst2 == null) { dst2 = new DoubleDST_2D(rows, columns); } if (isNoView == true) { dst2.inverse(elements, scale); } else { DoubleMatrix2D copy = this.copy(); dst2.inverse((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }