Beispiel #1
0
        public void Initialize(ArraySet arraySet, int baseRows, int maximumColumns, Solver solver, int segments)
        {
            this.arraySet = arraySet;
            if (baseRows > arraySet.maxSolverRows || maximumColumns > arraySet.maxSolverCols)
            {
                arraySet.maxSolverRows = Math.Max(baseRows, arraySet.maxSolverRows);
                arraySet.maxSolverCols = Math.Max(maximumColumns, arraySet.maxSolverCols);
                arraySet.RecreateSolverArrays();
            }

            this.solver   = solver;
            this.segments = segments;
            cRows         = baseRows;
            cCols         = 0;

            for (int i = 0; i <= cRows; i++)
            {
                arraySet.rowScale[i] = 1.0;
            }

            if (lp == null)
            {
                lp = new LP(cRows, maximumColumns, arraySet, solver.CalculationOptions.MaxRedecompose);
            }
            else
            {
                lp.Initialize(cRows, maximumColumns, arraySet, solver.CalculationOptions.MaxRedecompose);
            }

            compactSolution = null;
            sort            = null;
            needsDual       = false;
            needsQuadratic  = false;
            maximizeColumn  = -1;
        }