Example #1
0
        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);
            }
        }
Example #2
0
 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);
     }
 }
Example #3
0
        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]);
                }
            }
        }
Example #4
0
 public SparseElement(SparseRow parent, SparseElement e)
 {
     row = parent;
     col = e.col;
     x   = e.x;
 }
Example #5
0
 public double x; //the value of the entry
 public SparseElement(SparseRow parent, int col, double x)
 {
     row      = parent;
     this.col = col;
     this.x   = x;
 }