public ParallelColtDenseDoubleMatrix2D(int rows, int columns) { super(rows, columns); this.matrix = new cern.colt.matrix.tdouble.impl.DenseDoubleMatrix2D(rows, columns); }
public ParallelColtDenseDoubleMatrix2D(int rows, int columns) { super(rows, columns); this.matrix = new cern.colt.matrix.tdouble.impl.DenseDoubleMatrix2D(rows, columns); }
public DoubleMatrix2D like2D(int rows, int columns) { return new DenseDoubleMatrix2D(rows, columns); }
public static DenseDoubleMatrix2D createMatrix( int numRows , int numCols ) { // this matrix type is used at the suggestion of Piotr Wendykier return new DenseDoubleMatrix2D( numRows , numCols ); }
public DoubleMatrix2D like(int rows, int columns) { return new DenseDoubleMatrix2D(rows, columns); }
protected DoubleMatrix2D like2D(int rows, int columns, int rowZero, int columnZero, int rowStride, int columnStride) { return new DenseDoubleMatrix2D(rows, columns, this.elements, rowZero, columnZero, rowStride, columnStride, true); }
public DoubleMatrix2D like2D(int rows, int columns) { return new DenseDoubleMatrix2D(rows, columns); }
public DoubleMatrix2D like2D(int rows, int columns) { return new DenseDoubleMatrix2D(rows, columns); }
public DoubleMatrix2D like2D(int rows, int columns) { return new DenseDoubleMatrix2D(rows, columns); }
public DoubleMatrix2D like2D(int rows, int columns) { return new DenseDoubleMatrix2D(rows, columns); }
public DoubleMatrix2D like2D(int rows, int columns) { return new DenseDoubleMatrix2D(rows, columns); }
protected DoubleMatrix2D like2D(int rows, int columns, int rowZero, int columnZero, int rowStride, int columnStride) { return new DenseDoubleMatrix2D(rows, columns, this.elements, rowZero, columnZero, rowStride, columnStride, true); }
public DoubleMatrix2D like(int rows, int columns) { return new DenseDoubleMatrix2D(rows, columns); }
/** * Constructs a matrix with the given shape, each cell initialized with * zero. */ public DoubleMatrix2D make(int rows, int columns) { if (this == sparse) { return new SparseDoubleMatrix2D(rows, columns); } else { return new DenseDoubleMatrix2D(rows, columns); } }
/** * Constructs a matrix with the given shape, each cell initialized with * zero. */ public DoubleMatrix2D make(int rows, int columns) { if (this == sparse) { return new SparseDoubleMatrix2D(rows, columns); } else { return new DenseDoubleMatrix2D(rows, columns); } }
@Override public BenchmarkMatrix create(int numRows, int numCols) { return wrap(new DenseDoubleMatrix2D(numRows,numCols)); }
/** * Returns a new matrix that has the same elements as this matrix, but is in * a dense form. This method creates a new object (not a view), so changes * in the returned matrix are NOT reflected in this matrix. * * @return this matrix in a dense form */ public DenseDoubleMatrix2D getDense() { final DenseDoubleMatrix2D dense = new DenseDoubleMatrix2D(rows, columns); forEachNonZero(new cern.colt.function.tdouble.IntIntDoubleFunction() { public double apply(int i, int j, double value) { dense.setQuick(i, j, getQuick(i, j)); return value; } }); return dense; }
public ParallelColtDenseDoubleMatrix2D(DoubleMatrix2D m) { super(m.rows(), m.columns()); if (m instanceof DenseDoubleMatrix2D) { this.matrix = (cern.colt.matrix.tdouble.impl.DenseDoubleMatrix2D) m; } else { this.matrix = new cern.colt.matrix.tdouble.impl.DenseDoubleMatrix2D(m.toArray()); // this.matrix = new // cern.colt.matrix.tdouble.impl.DenseDoubleMatrix2D( // m.rows(), m.columns()); // for (int r = 0; r < m.rows(); r++) { // for (int c = 0; c < m.columns(); c++) { // matrix.setQuick(r, c, m.getQuick(r, c)); // } // } } }
public Matrix mtimes(Matrix m) { if (m instanceof ParallelColtDenseDoubleMatrix2D) { cern.colt.matrix.tdouble.impl.DenseDoubleMatrix2D ret = new cern.colt.matrix.tdouble.impl.DenseDoubleMatrix2D( (int) getRowCount(), (int) m.getColumnCount()); matrix.zMult(((ParallelColtDenseDoubleMatrix2D) m).matrix, ret); Matrix result = new ParallelColtDenseDoubleMatrix2D(ret); MapMatrix<String, Object> a = getMetaData(); if (a != null) { result.setMetaData(a.clone()); } return result; } else { return super.mtimes(m); } }
public Matrix mtimes(Matrix m) { if (m instanceof ParallelColtDenseDoubleMatrix2D) { cern.colt.matrix.tdouble.impl.DenseDoubleMatrix2D ret = new cern.colt.matrix.tdouble.impl.DenseDoubleMatrix2D( (int) getRowCount(), (int) m.getColumnCount()); matrix.zMult(((ParallelColtDenseDoubleMatrix2D) m).matrix, ret); Matrix result = new ParallelColtDenseDoubleMatrix2D(ret); MapMatrix<String, Object> a = getMetaData(); if (a != null) { result.setMetaData(a.clone()); } return result; } else { return super.mtimes(m); } }