public void run() { for (int k = firstIdx; k < lastIdx; k++) { tmp = getQuick(k); Im.setQuick(k, tmp[1]); } } });
public void run() { for (int k = firstIdx; k < lastIdx; k++) { tmp = getQuick(k); R.setQuick(k, tmp[0]); } } });
public void run() { for (int k = firstIdx; k < lastIdx; k++) { tmp = getQuick(k); Im.setQuick(k, tmp[1]); } } });
public void run() { int idx = firstidx; for (int c = firstCol; c < lastCol; c++) { for (int r = 0; r < rows; r++) { v.setQuick(idx++, getQuick(r, c)); } } } });
public void run() { for (int k = firstIdx; k < lastIdx; k++) { tmp = getQuick(k); R.setQuick(k, tmp[0]); } } });
public void run() { int idx = firstidx; for (int c = firstCol; c < lastCol; c++) { for (int r = 0; r < rows; r++) { v.setQuick(idx++, getQuick(r, c)); } } } });
/** * Returns a vector obtained by stacking the columns of the matrix on top of * one another. * * @return */ public DoubleMatrix1D vectorize() { DenseDoubleMatrix1D v = new DenseDoubleMatrix1D((int) size()); int idx = 0; for (int c = 0; c < columns; c++) { for (int r = 0; r < rows; r++) { v.setQuick(idx++, getQuick(c, r)); } } return v; }
/** * Returns a vector obtained by stacking the columns of the matrix on top of * one another. * * @return */ public DoubleMatrix1D vectorize() { DenseDoubleMatrix1D v = new DenseDoubleMatrix1D((int) size()); int idx = 0; for (int c = 0; c < columns; c++) { for (int r = 0; r < rows; r++) { v.setQuick(idx++, getQuick(c, r)); } } return v; }
/** * Returns a vector obtained by stacking the columns of the matrix on top of * one another. * * @return */ public DoubleMatrix1D vectorize() { DenseDoubleMatrix1D v = new DenseDoubleMatrix1D((int) size()); int idx = 0; for (int c = 0; c < columns; c++) { for (int r = 0; r < rows; r++) { v.setQuick(idx++, getQuick(c, r)); } } return v; }
/** * Returns a vector obtained by stacking the columns of the matrix on top of * one another. * * @return */ public DoubleMatrix1D vectorize() { DenseDoubleMatrix1D v = new DenseDoubleMatrix1D((int) size()); int idx = 0; for (int c = 0; c < columns; c++) { for (int r = 0; r < rows; r++) { v.setQuick(idx++, getQuick(c, r)); } } return v; }
public DoubleMatrix1D getImaginaryPart() { final DenseDoubleMatrix1D Im = new DenseDoubleMatrix1D(size); int nthreads = ConcurrencyUtils.getNumberOfThreads(); if ((nthreads > 1) && (size >= ConcurrencyUtils.getThreadsBeginN_1D())) { nthreads = Math.min(nthreads, size); Future<?>[] futures = new Future[nthreads]; int k = size / nthreads; for (int j = 0; j < nthreads; j++) { final int firstIdx = j * k; final int lastIdx = (j == nthreads - 1) ? size : firstIdx + k; futures[j] = ConcurrencyUtils.submit(new Runnable() { double[] tmp; public void run() { for (int k = firstIdx; k < lastIdx; k++) { tmp = getQuick(k); Im.setQuick(k, tmp[1]); } } }); } ConcurrencyUtils.waitForCompletion(futures); } else { double[] tmp; for (int i = 0; i < size; i++) { tmp = getQuick(i); Im.setQuick(i, tmp[1]); } } return Im; }
public DoubleMatrix1D getRealPart() { final DenseDoubleMatrix1D R = new DenseDoubleMatrix1D(size); int nthreads = ConcurrencyUtils.getNumberOfThreads(); if ((nthreads > 1) && (size >= ConcurrencyUtils.getThreadsBeginN_1D())) { nthreads = Math.min(nthreads, size); Future<?>[] futures = new Future[nthreads]; int k = size / nthreads; for (int j = 0; j < nthreads; j++) { final int firstIdx = j * k; final int lastIdx = (j == nthreads - 1) ? size : firstIdx + k; futures[j] = ConcurrencyUtils.submit(new Runnable() { double[] tmp; public void run() { for (int k = firstIdx; k < lastIdx; k++) { tmp = getQuick(k); R.setQuick(k, tmp[0]); } } }); } ConcurrencyUtils.waitForCompletion(futures); } else { double[] tmp; for (int i = 0; i < size; i++) { tmp = getQuick(i); R.setQuick(i, tmp[0]); } } return R; }
public DoubleMatrix1D getImaginaryPart() { final DenseDoubleMatrix1D Im = new DenseDoubleMatrix1D(size); int nthreads = ConcurrencyUtils.getNumberOfThreads(); if ((nthreads > 1) && (size >= ConcurrencyUtils.getThreadsBeginN_1D())) { nthreads = Math.min(nthreads, size); Future<?>[] futures = new Future[nthreads]; int k = size / nthreads; for (int j = 0; j < nthreads; j++) { final int firstIdx = j * k; final int lastIdx = (j == nthreads - 1) ? size : firstIdx + k; futures[j] = ConcurrencyUtils.submit(new Runnable() { double[] tmp; public void run() { for (int k = firstIdx; k < lastIdx; k++) { tmp = getQuick(k); Im.setQuick(k, tmp[1]); } } }); } ConcurrencyUtils.waitForCompletion(futures); } else { double[] tmp; for (int i = 0; i < size; i++) { tmp = getQuick(i); Im.setQuick(i, tmp[1]); } } return Im; }
public DoubleMatrix1D getRealPart() { final DenseDoubleMatrix1D R = new DenseDoubleMatrix1D(size); int nthreads = ConcurrencyUtils.getNumberOfThreads(); if ((nthreads > 1) && (size >= ConcurrencyUtils.getThreadsBeginN_1D())) { nthreads = Math.min(nthreads, size); Future<?>[] futures = new Future[nthreads]; int k = size / nthreads; for (int j = 0; j < nthreads; j++) { final int firstIdx = j * k; final int lastIdx = (j == nthreads - 1) ? size : firstIdx + k; futures[j] = ConcurrencyUtils.submit(new Runnable() { double[] tmp; public void run() { for (int k = firstIdx; k < lastIdx; k++) { tmp = getQuick(k); R.setQuick(k, tmp[0]); } } }); } ConcurrencyUtils.waitForCompletion(futures); } else { double[] tmp; for (int i = 0; i < size; i++) { tmp = getQuick(i); R.setQuick(i, tmp[0]); } } return R; }
for (int c = 0; c < columns; c++) { for (int r = 0; r < rows; r++) { v.setQuick(idx++, getQuick(r, c));
for (int c = 0; c < columns; c++) { for (int r = 0; r < rows; r++) { v.setQuick(idx++, getQuick(r, c));
m = DoubleFactory1D.dense.make(size.numEntries()); for (i = 0; i < size.numEntries(); i++) ((DenseDoubleMatrix1D) m).setQuick(i, data[i]); } else if (info.isSparse()) { m = DoubleFactory1D.sparse.make(size.numEntries());
m = DoubleFactory1D.dense.make(size.numEntries()); for (i = 0; i < size.numEntries(); i++) ((DenseDoubleMatrix1D) m).setQuick(i, data[i]); } else if (info.isSparse()) { m = DoubleFactory1D.sparse.make(size.numEntries());
m = DoubleFactory1D.dense.make(size.numEntries()); for (i = 0; i < size.numEntries(); i++) ((DenseDoubleMatrix1D) m).setQuick(i, data[i]); } else if (info.isSparse()) { m = DoubleFactory1D.sparse.make(size.numEntries());