/** * Copies the non-zero structure of orig into "this" * * @param orig Matrix who's structure is to be copied */ public void copyStructure(DMatrixSparseCSC orig) { reshape(orig.numRows, orig.numCols, orig.nz_length); this.nz_length = orig.nz_length; System.Array.Copy(orig.col_idx, 0, col_idx, 0, orig.numCols + 1); System.Array.Copy(orig.nz_rows, 0, nz_rows, 0, orig.nz_length); }
public virtual void setTo(Matrix original) { DMatrixSparseCSC o = (DMatrixSparseCSC)original; reshape(o.numRows, o.numCols, o.nz_length); this.nz_length = o.nz_length; System.Array.Copy(o.nz_values, 0, nz_values, 0, nz_length); System.Array.Copy(o.nz_rows, 0, nz_rows, 0, nz_length); System.Array.Copy(o.col_idx, 0, col_idx, 0, numCols + 1); this.indicesSorted = o.indicesSorted; }
public DMatrixSparseCSC(DMatrixSparseCSC original) : this(original.numRows, original.numCols, original.nz_length) { setTo(original); }