void ExtractPositionsFromSolver(int[] layer, ISolverShell solver, double[] positions) { solver.Solve(); for (int i = 0; i < layer.Length; i++) { database.Anchors[layer[i]].X = positions[i] = solver.GetVariableResolvedPosition(layer[i]); } }
void SetXPositions() { ISolverShell solver = InitSolverWithoutOrder(); ImproveWithAdjacentSwaps(); PutLayerNodeSeparationsIntoSolver(solver); solver.Solve(); SortLayers(solver); for (int i = 0; i < LayerArrays.Y.Length; i++) { database.Anchors[i].X = solver.GetVariableResolvedPosition(i); } }
static bool Solve(ISolverShell solver, ProjSolv.Parameters parameters) { bool executionLimitExceeded = false, retval = true; if (!solver.Solve(parameters, out executionLimitExceeded)) { System.Console.WriteLine(" Error - Solve failed"); ++s_cExecutionFailed; retval = false; } if (executionLimitExceeded) { System.Console.WriteLine(" Warning - one or more execution limits were exceeded"); ++s_cExecutionLimitExceeded; } return retval; }
static bool Solve(ISolverShell solver, ProjSolv.Parameters parameters) { bool executionLimitExceeded = false, retval = true; if (!solver.Solve(parameters, out executionLimitExceeded)) { System.Console.WriteLine(" Error - Solve failed"); ++s_cExecutionFailed; retval = false; } if (executionLimitExceeded) { System.Console.WriteLine(" Warning - one or more execution limits were exceeded"); ++s_cExecutionLimitExceeded; } return(retval); }
void ExtractPositionsFromSolver(int[] layer, ISolverShell solver, double[] positions) { solver.Solve(); for (int i = 0; i < layer.Length; i++) database.Anchors[layer[i]].X = positions[i] = solver.GetVariableResolvedPosition(layer[i]); }