Exemplo n.º 1
0
        public void Initialize(int rows, int maxCols, ArraySet arraySet)
        {
            this.arraySet = arraySet;
            if (rows > arraySet.SparseMatrixMaxRows || maxCols + 20 > arraySet.SparseMatrixMaxCols)
            {
                arraySet.SparseMatrixMaxRows = Math.Max(rows, arraySet.SparseMatrixMaxRows);
                arraySet.SparseMatrixMaxCols = Math.Max(maxCols + 20, arraySet.SparseMatrixMaxCols); // give some room for AddColumn
                arraySet.RecreateSparseMatrixArrays();
            }
            this.rows = rows;
            this.cols = 0;
            //Array.Clear(data, 0, rows * cols); // only need to clear what will be used

            sparseIndex = 0;
            lastCol     = 0;
            finalized   = false;
        }