public SparseRow(SparseRow r) { int i; this.row = r.row; this.data = null; n = 0; for (i = 0; i < r.n; i++) { SetValue(r.data[i].col, r.data[i].x); } }
public double this[int row, int col] { get { return(rows[row].GetValue(col)); } set { if (rows[row] == null) { rows[row] = new SparseRow(row); } rows[row].SetValue(col, value); } }
public SparseMatrix(SparseMatrix M) { int i; Resize(M.maxrows, M.maxcols); for (i = 0; i < maxrows; i++) { if (M.rows[i] != null) { rows[i] = new SparseRow(M.rows[i]); } } }
public SparseElement(SparseRow parent, SparseElement e) { row = parent; col = e.col; x = e.x; }
public double x; //the value of the entry public SparseElement(SparseRow parent, int col, double x) { row = parent; this.col = col; this.x = x; }