/** * 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); if (this==rowCompressed) return new RCDoubleMatrix2D(rows,columns); //if (this==rowCompressedModified) return new RCMDoubleMatrix2D(rows,columns); else return new DenseDoubleMatrix2D(rows,columns); } /**
/** * Constructs a matrix with the given cell 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 DoubleMatrix1D make(double[] values) { if (this==sparse) return new SparseDoubleMatrix1D(values); else return new DenseDoubleMatrix1D(values); } /**
/** * Constructs a matrix with the given shape, each cell initialized with zero. */ public ObjectMatrix2D make(int rows, int columns) { if (this==sparse) return new SparseObjectMatrix2D(rows,columns); else return new DenseObjectMatrix2D(rows,columns); } /**
/** * Returns a string representations of all cells; no alignment considered. */ protected String[] formatRow(AbstractMatrix1D vector) { Former formatter = null; formatter = factory.create(format); int s = vector.size(); String[] strings = new String[s]; for (int i=0; i<s; i++) { strings[i] = form(vector,i,formatter); } return strings; } /**
/** * Constructs a matrix with the given shape, each cell initialized with zero. */ public ObjectMatrix1D make(int size) { if (this==sparse) return new SparseObjectMatrix1D(size); return new DenseObjectMatrix1D(size); } /**
/** * Constructs a matrix with the given shape, each cell initialized with zero. */ public ObjectMatrix3D make(int slices, int rows, int columns) { if (this==sparse) return new SparseObjectMatrix3D(slices,rows,columns); return new DenseObjectMatrix3D(slices,rows,columns); } /**
/** * Constructs a matrix with the given shape, each cell initialized with zero. */ public DoubleMatrix3D make(int slices, int rows, int columns) { if (this==sparse) return new SparseDoubleMatrix3D(slices,rows,columns); return new DenseDoubleMatrix3D(slices,rows,columns); } /**
/** * Returns a string representation of the given matrix. * @param matrix the matrix to convert. */ public String toString(ObjectMatrix2D matrix) { return super.toString(matrix); } /**
/** * Construct and returns a new selection view. * * @param offsets the offsets of the visible elements. * @return a new view. */ protected DoubleMatrix1D viewSelectionLike(int[] offsets) { return new SelectedSparseDoubleMatrix1D(this.elements,offsets); } }
/** * 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); if (this==rowCompressed) return new RCDoubleMatrix2D(rows,columns); //if (this==rowCompressedModified) return new RCMDoubleMatrix2D(rows,columns); else return new DenseDoubleMatrix2D(rows,columns); } /**
/** * Constructs a matrix with the given shape, each cell initialized with zero. */ public DoubleMatrix1D make(int size) { if (this==sparse) return new SparseDoubleMatrix1D(size); return new DenseDoubleMatrix1D(size); } /**
/** * Returns a string representations of all cells; no alignment considered. */ protected String[] formatRow(AbstractMatrix1D vector) { Former formatter = null; formatter = factory.create(format); int s = vector.size(); String[] strings = new String[s]; for (int i=0; i<s; i++) { strings[i] = form(vector,i,formatter); } return strings; } /**
/** * Constructs a matrix with the given cell 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 ObjectMatrix1D make(Object[] values) { if (this==sparse) return new SparseObjectMatrix1D(values); else return new DenseObjectMatrix1D(values); } /**
/** * Constructs a matrix with the given shape, each cell initialized with zero. */ public ObjectMatrix2D make(int rows, int columns) { if (this==sparse) return new SparseObjectMatrix2D(rows,columns); else return new DenseObjectMatrix2D(rows,columns); } /**
/** * Constructs a matrix with the given shape, each cell initialized with zero. */ public ObjectMatrix3D make(int slices, int rows, int columns) { if (this==sparse) return new SparseObjectMatrix3D(slices,rows,columns); return new DenseObjectMatrix3D(slices,rows,columns); } /**
/** * Constructs a matrix with the given shape, each cell initialized with zero. */ public DoubleMatrix3D make(int slices, int rows, int columns) { if (this==sparse) return new SparseDoubleMatrix3D(slices,rows,columns); return new DenseDoubleMatrix3D(slices,rows,columns); } /**
/** * Constructs a matrix with the given shape, each cell initialized with zero. */ public DoubleMatrix1D make(int size) { if (this==sparse) return new SparseDoubleMatrix1D(size); return new DenseDoubleMatrix1D(size); } /**
/** * Constructs a matrix with the given cell 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 ObjectMatrix1D make(Object[] values) { if (this==sparse) return new SparseObjectMatrix1D(values); else return new DenseObjectMatrix1D(values); } /**
/** * Constructs a matrix with the given cell 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 DoubleMatrix1D make(double[] values) { if (this==sparse) return new SparseDoubleMatrix1D(values); else return new DenseDoubleMatrix1D(values); } /**
/** * Constructs a matrix with the given shape, each cell initialized with zero. */ public ObjectMatrix1D make(int size) { if (this==sparse) return new SparseObjectMatrix1D(size); return new DenseObjectMatrix1D(size); } /**