public void initialize() { disp = new DenseDoubleMatrix1D(2); distance = 0; visited = false; }
/** * 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); }
public void run() { for (int c = firstColumn; --c >= lastColumn;) { ((DenseDoubleMatrix1D) viewColumn(c)).dct(scale); } } });
/** * 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); }
if (other == this) return this; checkSize(other); if (isNoView && other.isNoView) { return this; if (haveSharedCells(other)) { DoubleMatrix1D c = other.copy(); if (!(c instanceof DenseDoubleMatrix1D)) { if (elements == null || elementsOther == null) throw new InternalError(); final int zeroOther = (int) other.index(0); final int strideOther = other.stride; int nthreads = ConcurrencyUtils.getNumberOfThreads();
public void run() { for (int c = firstColumn; --c >= lastColumn;) { ((DenseDoubleMatrix1D) viewColumn(c)).dht(); } } });
public void run() { for (int r = firstRow; --r >= lastRow;) { ((DenseDoubleMatrix1D) viewRow(r)).dst(scale); } } });
public void run() { for (int r = firstRow; r < lastRow; r++) { C.viewRow(r).assign(((DenseDoubleMatrix1D) viewRow(r)).getIfft(scale)); } } });
public DoubleMatrix1D apply(DoubleMatrix1D b, DoubleMatrix1D x) { if (x == null) { x = b.like(); } if (!(x instanceof DenseDoubleMatrix1D) || !(b instanceof DenseDoubleMatrix1D)) throw new IllegalArgumentException("a nad b must be dense vectors"); double[] xd = ((DenseDoubleMatrix1D) x).elements(); double[] bd = ((DenseDoubleMatrix1D) b).elements(); for (int i = 0; i < invdiag.length; ++i) xd[i] = bd[i] * invdiag[i]; return x; }
public void run() { for (int c = firstColumn; --c >= lastColumn;) { C.viewColumn(c).assign(((DenseDoubleMatrix1D) viewColumn(c)).getFft()); } } });
if (y == this) return; checkSize(y); final double[] elementsOther = y.elements; if (elements == null || elementsOther == null)
/** * 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); }
if (other == this) return this; checkSize(other); if (isNoView && other.isNoView) { return this; if (haveSharedCells(other)) { DoubleMatrix1D c = other.copy(); if (!(c instanceof DenseDoubleMatrix1D)) { if (elements == null || elementsOther == null) throw new InternalError(); final int zeroOther = (int) other.index(0); final int strideOther = other.stride; int nthreads = ConcurrencyUtils.getNumberOfThreads();
public void run() { for (int c = firstColumn; c < lastColumn; c++) { ((DenseDoubleMatrix1D) viewColumn(c)).dht(); } } });
public void run() { for (int c = firstColumn; --c >= lastColumn;) { ((DenseDoubleMatrix1D) viewColumn(c)).dst(scale); } } });
public void run() { for (int c = firstColumn; --c >= lastColumn;) { C.viewColumn(c).assign(((DenseDoubleMatrix1D) viewColumn(c)).getIfft(scale)); } } });
public DoubleMatrix1D apply(DoubleMatrix1D b, DoubleMatrix1D x) { if (x == null) { x = b.like(); } if (!(x instanceof DenseDoubleMatrix1D) || !(b instanceof DenseDoubleMatrix1D)) throw new IllegalArgumentException("a nad b must be dense vectors"); double[] xd = ((DenseDoubleMatrix1D) x).elements(); double[] bd = ((DenseDoubleMatrix1D) b).elements(); for (int i = 0; i < invdiag.length; ++i) xd[i] = bd[i] * invdiag[i]; return x; }
public void run() { for (int r = firstRow; --r >= lastRow;) { C.viewRow(r).assign(((DenseDoubleMatrix1D) viewRow(r)).getFft()); } } });
if (y == this) return; checkSize(y); final double[] elementsOther = y.elements; if (elements == null || elementsOther == null)
/** * Sets up the ILU preconditioner * * @param n * Problem size (number of rows) */ public DoubleILU(int n) { this.n = n; y = new DenseDoubleMatrix1D(n); }