/** * Constructs a matrix with a copy of the given values. <tt>values</tt> is * required to have the form <tt>values[slice][row][column]</tt> and have * exactly the same number of rows in in every slice and exactly the same * number of columns in in every row. * <p> * 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. * @throws IllegalArgumentException * if * <tt>for any 1 <= slice < values.length: values[slice].length != values[slice-1].length</tt> * . * @throws IllegalArgumentException * if * <tt>for any 1 <= row < values[0].length: values[slice][row].length != values[slice][row-1].length</tt> * . */ public DenseDoubleMatrix3D(double[][][] values) { this(values.length, (values.length == 0 ? 0 : values[0].length), (values.length == 0 ? 0 : values[0].length == 0 ? 0 : values[0][0].length)); assign(values); }
/** * Constructs a matrix with a copy of the given values. <tt>values</tt> is * required to have the form <tt>values[slice][row][column]</tt> and have * exactly the same number of rows in in every slice and exactly the same * number of columns in in every row. * <p> * 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. * @throws IllegalArgumentException * if * <tt>for any 1 <= slice < values.length: values[slice].length != values[slice-1].length</tt> * . * @throws IllegalArgumentException * if * <tt>for any 1 <= row < values[0].length: values[slice][row].length != values[slice][row-1].length</tt> * . */ public DenseDoubleMatrix3D(double[][][] values) { this(values.length, (values.length == 0 ? 0 : values[0].length), (values.length == 0 ? 0 : values[0].length == 0 ? 0 : values[0][0].length)); assign(values); }
/** * Computes the 3D discrete Hartley transform (DHT) of this matrix. * */ public void dht3() { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dht3 == null) { dht3 = new DoubleDHT_3D(slices, rows, columns); } if (isNoView == true) { dht3.forward(elements); } else { DoubleMatrix3D copy = this.copy(); dht3.forward((double[]) copy.elements()); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the 3D discrete Hartley transform (DHT) of this matrix. * */ public void dht3() { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dht3 == null) { dht3 = new DoubleDHT_3D(slices, rows, columns); } if (isNoView == true) { dht3.forward(elements); } else { DoubleMatrix3D copy = this.copy(); dht3.forward((double[]) copy.elements()); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the 3D discrete cosine transform (DCT-II) of this matrix. * * @param scale * if true then scaling is performed * */ public void dct3(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dct3 == null) { dct3 = new DoubleDCT_3D(slices, rows, columns); } if (isNoView == true) { dct3.forward(elements, scale); } else { DoubleMatrix3D copy = this.copy(); dct3.forward((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the 3D inverse of the discrete sine transform (DST-III) of this * matrix. * * @param scale * if true then scaling is performed * */ public void idst3(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dst3 == null) { dst3 = new DoubleDST_3D(slices, rows, columns); } if (isNoView == true) { dst3.inverse(elements, scale); } else { DoubleMatrix3D copy = this.copy(); dst3.inverse((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the 3D inverse of the discrete cosine transform (DCT-III) of * this matrix. * * @param scale * if true then scaling is performed */ public void idct3(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dct3 == null) { dct3 = new DoubleDCT_3D(slices, rows, columns); } if (isNoView == true) { dct3.inverse(elements, scale); } else { DoubleMatrix3D copy = this.copy(); dct3.inverse((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the 3D discrete cosine transform (DCT-II) of this matrix. * * @param scale * if true then scaling is performed * */ public void dct3(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dct3 == null) { dct3 = new DoubleDCT_3D(slices, rows, columns); } if (isNoView == true) { dct3.forward(elements, scale); } else { DoubleMatrix3D copy = this.copy(); dct3.forward((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the 3D discrete sine transform (DST-II) of this matrix. * * @param scale * if true then scaling is performed * */ public void dst3(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dst3 == null) { dst3 = new DoubleDST_3D(slices, rows, columns); } if (isNoView == true) { dst3.forward(elements, scale); } else { DoubleMatrix3D copy = this.copy(); dst3.forward((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the 3D inverse of the discrete Hartley transform (IDHT) of this * matrix. * * @param scale * if true then scaling is performed */ public void idht3(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dht3 == null) { dht3 = new DoubleDHT_3D(slices, rows, columns); } if (isNoView == true) { dht3.inverse(elements, scale); } else { DoubleMatrix3D copy = this.copy(); dht3.inverse((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the 3D discrete sine transform (DST-II) of this matrix. * * @param scale * if true then scaling is performed * */ public void dst3(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dst3 == null) { dst3 = new DoubleDST_3D(slices, rows, columns); } if (isNoView == true) { dst3.forward(elements, scale); } else { DoubleMatrix3D copy = this.copy(); dst3.forward((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the 3D inverse of the discrete Hartley transform (IDHT) of this * matrix. * * @param scale * if true then scaling is performed */ public void idht3(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dht3 == null) { dht3 = new DoubleDHT_3D(slices, rows, columns); } if (isNoView == true) { dht3.inverse(elements, scale); } else { DoubleMatrix3D copy = this.copy(); dht3.inverse((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the 3D inverse of the discrete sine transform (DST-III) of this * matrix. * * @param scale * if true then scaling is performed * */ public void idst3(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dst3 == null) { dst3 = new DoubleDST_3D(slices, rows, columns); } if (isNoView == true) { dst3.inverse(elements, scale); } else { DoubleMatrix3D copy = this.copy(); dst3.inverse((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
/** * Computes the 3D inverse of the discrete cosine transform (DCT-III) of * this matrix. * * @param scale * if true then scaling is performed */ public void idct3(boolean scale) { int oldNthreads = ConcurrencyUtils.getNumberOfThreads(); ConcurrencyUtils.setNumberOfThreads(ConcurrencyUtils.nextPow2(oldNthreads)); if (dct3 == null) { dct3 = new DoubleDCT_3D(slices, rows, columns); } if (isNoView == true) { dct3.inverse(elements, scale); } else { DoubleMatrix3D copy = this.copy(); dct3.inverse((double[]) copy.elements(), scale); this.assign((double[]) copy.elements()); } ConcurrencyUtils.setNumberOfThreads(oldNthreads); }
DoubleMatrix3D copy = this.copy(); fft3.realInverse((double[]) copy.elements(), scale); this.assign((double[]) copy.elements());
DoubleMatrix3D copy = this.copy(); fft3.realInverse((double[]) copy.elements(), scale); this.assign((double[]) copy.elements());
DoubleMatrix3D copy = this.copy(); fft3.realForward((double[]) copy.elements()); this.assign((double[]) copy.elements());
DoubleMatrix3D copy = this.copy(); fft3.realForward((double[]) copy.elements()); this.assign((double[]) copy.elements());